samples: net: NATS protocol sample
NATS is a publisher/subscriber protocol implemented on top of TCP. It
is specified in [1], and this is a sample implementation for Zephyr
using the new IP stack. The API is loosely based off of [2].
With this sample, it's possible to subscribe/unsubscribe to a given
subject, and be notified of changes asynchronously. In order to
conserve resources, the implementation does not keep its own track of
subscribed subjects; that must be performed by the application itself,
so it ignore unknown/undesired subjects.
TLS is not supported yet, although basic auth is. The client will
indicate if it supports username/password if a certain callback is set
in the struct nats. This callback will then be called, and the user
must copy the username/password to the supplied user/pass buffers.
Content might be also published for a given subject.
The sample application lets one observe the subject "led0", and turn it
"on", "off", or "toggle" its value. Changing the value will, if
supported, act on a status LED on the development board. The new
status will be published.
Also worth noting is that most of the networking and GPIO boilerplate
has been shamelessly copied from the IRC bot example. (Curiously, both
protocols are similar.)
[1] http://nats.io/documentation/internals/nats-protocol/
[2] https://github.com/nats-io/go-nats
Jira: ZEP-1012
Change-Id: I204adc61c4c533661eacfb8c28c1c08870debd91
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-02-25 03:03:30 +08:00
|
|
|
CONFIG_INIT_STACKS=y
|
|
|
|
|
|
|
|
CONFIG_NET_LOG_ENABLED=y
|
|
|
|
CONFIG_SYS_LOG_NET_LEVEL=2
|
|
|
|
CONFIG_NET_DHCPV4=y
|
|
|
|
CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3
|
|
|
|
CONFIG_NET_IPV6=y
|
|
|
|
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3
|
|
|
|
CONFIG_NET_LOG=y
|
|
|
|
CONFIG_NET_MAX_CONTEXTS=10
|
2017-04-03 23:14:35 +08:00
|
|
|
CONFIG_NET_PKT_RX_COUNT=14
|
|
|
|
CONFIG_NET_PKT_TX_COUNT=14
|
samples: net: NATS protocol sample
NATS is a publisher/subscriber protocol implemented on top of TCP. It
is specified in [1], and this is a sample implementation for Zephyr
using the new IP stack. The API is loosely based off of [2].
With this sample, it's possible to subscribe/unsubscribe to a given
subject, and be notified of changes asynchronously. In order to
conserve resources, the implementation does not keep its own track of
subscribed subjects; that must be performed by the application itself,
so it ignore unknown/undesired subjects.
TLS is not supported yet, although basic auth is. The client will
indicate if it supports username/password if a certain callback is set
in the struct nats. This callback will then be called, and the user
must copy the username/password to the supplied user/pass buffers.
Content might be also published for a given subject.
The sample application lets one observe the subject "led0", and turn it
"on", "off", or "toggle" its value. Changing the value will, if
supported, act on a status LED on the development board. The new
status will be published.
Also worth noting is that most of the networking and GPIO boilerplate
has been shamelessly copied from the IRC bot example. (Curiously, both
protocols are similar.)
[1] http://nats.io/documentation/internals/nats-protocol/
[2] https://github.com/nats-io/go-nats
Jira: ZEP-1012
Change-Id: I204adc61c4c533661eacfb8c28c1c08870debd91
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-02-25 03:03:30 +08:00
|
|
|
CONFIG_NET_SHELL=y
|
|
|
|
CONFIG_NET_STATISTICS=y
|
|
|
|
CONFIG_NET_TCP=y
|
|
|
|
CONFIG_NETWORKING=y
|
|
|
|
CONFIG_DNS_RESOLVER=n
|
|
|
|
|
|
|
|
CONFIG_PRINTK=y
|
|
|
|
CONFIG_SYS_LOG_SHOW_COLOR=y
|
|
|
|
|
2017-03-15 23:01:47 +08:00
|
|
|
CONFIG_NET_APP_SETTINGS=y
|
|
|
|
CONFIG_NET_APP_MY_IPV6_ADDR="2001:db8::1"
|
|
|
|
CONFIG_NET_APP_PEER_IPV6_ADDR="2001:db8::2"
|
samples: net: NATS protocol sample
NATS is a publisher/subscriber protocol implemented on top of TCP. It
is specified in [1], and this is a sample implementation for Zephyr
using the new IP stack. The API is loosely based off of [2].
With this sample, it's possible to subscribe/unsubscribe to a given
subject, and be notified of changes asynchronously. In order to
conserve resources, the implementation does not keep its own track of
subscribed subjects; that must be performed by the application itself,
so it ignore unknown/undesired subjects.
TLS is not supported yet, although basic auth is. The client will
indicate if it supports username/password if a certain callback is set
in the struct nats. This callback will then be called, and the user
must copy the username/password to the supplied user/pass buffers.
Content might be also published for a given subject.
The sample application lets one observe the subject "led0", and turn it
"on", "off", or "toggle" its value. Changing the value will, if
supported, act on a status LED on the development board. The new
status will be published.
Also worth noting is that most of the networking and GPIO boilerplate
has been shamelessly copied from the IRC bot example. (Curiously, both
protocols are similar.)
[1] http://nats.io/documentation/internals/nats-protocol/
[2] https://github.com/nats-io/go-nats
Jira: ZEP-1012
Change-Id: I204adc61c4c533661eacfb8c28c1c08870debd91
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-02-25 03:03:30 +08:00
|
|
|
|
|
|
|
CONFIG_TEST_RANDOM_GENERATOR=y
|
|
|
|
|
|
|
|
CONFIG_JSON_LIBRARY=y
|