Commit graph

2652 commits

Author SHA1 Message Date
Tomasz Bursztyka b52c0f24a6 net/ieee802154: Make RAW mode generic
- Renaming NET_L2_RAW_CHANNEL to NET_RAW_MODE
- Create a generic IEEE 802.15.4 raw mode for drivers
- Modify the IEEE 802.15.4 drivers so it passes the packet unmodified,
up to code using that mode to apply the necessary changes on the
received net_pkt according to their needs
- Modify wpanusb/wpan_serial relevantly

Fixes #5004

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-11-22 10:10:09 -05:00
Jukka Rissanen 93c426e778 samples: net: zperf: Check UDP pkt before accessing it
Check that we do not try to access fragment when UDP packet is
received if pkt is NULL. In practice this should not happen for
UDP but do the checks in proper order anyway.

Coverity-CID: 179252
Fixes #5057

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Jukka Rissanen f7f671d18b samples: net: zperf: Check pkt before accessing it
The pkt was accessed before NULL check.

Coverity-CID: 179250
Fixes #5059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Jukka Rissanen b0b053e91e samples: net: zperf: Remove deadcode
As we are checking that pkt is not NULL already in the start
of the function, remove the checks later in the code in function
zperf_tcp_receiver.c:tcp_received()

Coverity-CID: 179248
Fixes #5061

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Johan Hedberg 4fe3e03152 Bluetooth: samples/mesh_demo: Fix address handling
Clean up and fix the address handling.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 13:30:30 +02:00
Johan Hedberg e31102c890 Bluetooth: samples/mesh_demo: Remove unused model publication
This app isn't (at least yet) using the model publication for
anything, and in fact this could cause trouble due to missing
publication net_buf_simple buffer.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Johan Hedberg 8f1541184f Bluetooth: Mesh: Fix non-periodic Model Publication
The only generally available model supporting publication that's
convenient to be used for testing is the Health Server Model.
Unfortunately since this model supports period publication, the
non-periodic side got less attention and had some bugs.

The first thing that needs to be done is to verify that the period
returned by bt_mesh_model_pub_period_get() is positive. If it's zero
then no periodic publication should take place.

Another thing that this patch cleans up is the naming of the callback
used for periodic publishing. There's no need do require the callback
to call bt_mesh_model_publish() since this must happen no matter what,
so instead rename the callback from 'func' to 'update' and have the
access layer call bt_mesh_model_publish() if the callback was
successful.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Jukka Rissanen 9d99691e7b samples: net: echo_client: Only send allowable number of bytes
Honor the device MTU when sending data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-20 16:39:36 -05:00
Jukka Rissanen d206ad2799 samples: net: echo-client: Fix compilation with mbedtls
The echo-client compilation failed because mbedtls config file
was not found. Added suitable magic to CMakeLists.txt fixing that.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-20 16:39:09 -05:00
Johan Hedberg e7bb76e2b6 Bluetooth: Mesh: Fix model publication
Model publication was broken in a couple of ways:

 - The Publish Retransmit State was not taken into account at all
 - Health Server used a single publish state for all elements

To implement Publish Retransmit properly, one has to use a callback to
track when the message has been sent. The problem with the transport
layer sending APIs was that giving a callback would cause the
transport layer to assume that segmentation (with acks) is desired,
which is not the case for Model Publication (unless the message itself
is too large, of course). Because of this, the message sending context
receives a new send_rel ("Send Reliable") boolean member that an app
can use to force reliable sending.

Another challenge with the Publish Retransmit state is that a buffer
is needed for storing the AppKey-encrypted SDU once it has been sent
out for the first time.To solve this, a new new net_buf_simple member
is added to the model publication context. The separate 'msg' input
parameter of the bt_mesh_model_publish() API is removed, since the
application is now expected to pre-fill pub->msg instead.

To help with the publishing API change, the Health Server model gets a
new helper macro for initializing the publishing context with a
right-sized publishing message.

The API for creating Health Server instances is also redesigned since
it was so far using a single model publishing state, which would
result in erratic behavior in case of multiple elements with the
Health Server Model. Now, the application needs to provide a unique
publishing context for each Health Server instance.

The changes are heavily intertwined, so it's not easily possible to
split them into multiple patches, hence the large(ish) patch.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-20 15:00:29 +02:00
Youvedeep Singh 691d709943 samples: nrf52: power_mgr: Increase idleness for main thread
Increase sleep time for main thread (1 sec to 1 minute) to keep SOC
in Low Power State for longer time. Currently nrf SOC is entering into
low power state and exiting immedately after 1 sec.
With this change SOC will wake stay in Low Power State till GPIO is
pressed or sleep time expired (whichever is earlier).

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-18 11:21:13 -05:00
Andrei Emeltchenko 59161cebcd net: doc: Add Ethernet over USB basic documentation
Add basic documentation about Ethernet over USB and describe
prj_netusb.conf configuration file.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-18 08:49:57 -05:00
Jukka Rissanen 624a75c76e samples: net: http-server: Do not set Content-Length
As per https://tools.ietf.org/html/rfc7230#section-3.3.2:
"A sender MUST NOT send a Content-Length header field in any
message that contains a Transfer-Encoding header field."

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-17 17:38:39 -05:00
Johan Hedberg bd69b2127e Bluetooth: Mesh: Use dedicated struct for heartbeat subscription
This simplifies the API since there is no-longer a need to pass a huge
number of function arguments around.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-16 15:35:10 +02:00
Johan Hedberg d4365e16f9 Bluetooth: Mesh: Use dedicated struct for heartbeat publication
This simplifies the API since there is no-longer a need to pass a huge
number of function arguments around.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-16 15:35:10 +02:00
Sebastian Bøe 49e7ca957e cmake: set IS_TEST in the samples that were including Makefile.test
For an unknown reason, various samples in KBuild were including
Makefile.test, this had some desired benefits, one of which is that
the popular BOOT_BANNER appears. The CMake-equivalent of including
Makefile.test is setting the flag IS_TEST. This commit reverts the
behaviour of the samples back to how it was pre-cmake.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-16 08:26:25 -05:00
Sebastian Bøe c7c7917da2 cmake: set IS_TEST in the hello_world sample
The Kbuild equivalent of IS_TEST was used for hello_world before, so
we revert back to the old behaviour. This resolves
https://github.com/zephyrproject-rtos/zephyr/issues/4904

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-16 08:26:25 -05:00
Anas Nashif d55884a34d sample: crypto: also test mbedTLS config
expand testing to mbedTLS

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-16 05:48:16 -05:00
Luiz Augusto von Dentz 27628a23fc net: http_client: Fix having IPv4 options in prj_bt.conf
IPSP/6LoWPAN is IPv6 only, it cannot transport IPv4 packets.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-11-16 10:41:07 +02:00
Luiz Augusto von Dentz 697e5698b3 net: samples: Remove CONFIG_NET_L2_BT_ZEP1656
CONFIG_NET_L2_BT_ZEP1656 should only be used with older Linux up to
4.11 which by now should have been updated in all distros.

For those sticking with older distros should select it manually as
it does breaks IID address it should never be used in production.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-11-16 10:41:07 +02:00
David B. Kinder be9ee06bd9 doc: fix misspellings in boards and samples docs
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-11-15 12:59:22 -05:00
Kumar Gala 7cd27be39a drivers/ieee802154_kw41z: Update kw41z to support event trace buffer
Added conditionally enabled event state tracing support.
Needed for enhanced debug visibility of tight timed events where
normal print debug messages affect the timing of things. This is a
simple buffer that allows post analysis via gdb of what sequencer
events occurred.

Signed-off-by: David Leach <david.leach@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-15 08:30:16 -06:00
David Leach fcffac92b7 drivers/ieee802154_kw41z: Reduce debug logging due to false positives
- Removed some debug output and changed the level of others to reduce
  the amount of information logged. The reason is that some of this is
  causing false positive distractions.
- Removed enabling of FILTER error IRQ events. It isn't needed and is
  only informational.
- Changed frame control AR bit inspection to use native retrieval
  routine.
- Addressed some coding style issues.

Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-15 08:30:16 -06:00
David Leach e8431daac0 drivers/ieee802154_kw41z: Stabilize the KW41Z IEEE802.15.4 driver
- Reworked the driver logic around TX/RX to correctly handle the
  expectations of the underlying 802.15.4 hardware IP.
- Fixed a problem with TX always reporting an error to the stack
  which resulted in constant retries.
- Fixed bug in RX to TX transition which would occasionally cause the
  driver to error the TX.
- Changed RX logic to ensure that invalid RX frames were not passed up
  the stack.
- Simplified hardware timer usage to only use TMR3.
- Added RX watermark and TMR3 support to fix a hardware problem where
  the hw IP can get stuck on a receive in noisy environments.
- Modified samples/net/echo_client and echo_server kw41z project config
  files to provide enanced debug visibility into stacks and threads.

Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-15 08:30:16 -06:00
Sebastian Bøe 40ddb7f747 samples: external_lib: Build binaries in the build directory
This fixes https://github.com/zephyrproject-rtos/zephyr/issues/4925

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-15 08:49:06 -05:00
Johan Hedberg e6aa6a0784 Bluetooth: samples/mesh_demo: Add heartbeat publication support
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 255edcfde2 Bluetooth: Mesh: Provisioning: Add NetKeyIndex to complete callback
It may be useful for the app to know what the initial NetKeyIndex that
it was given during provisioning is.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 70cbcef576 Bluetooth: Mesh: Rename health server code from health to health_srv
This is in anticipation of soon adding health client support, which
could then cause confusion due to the ambiguous API names.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 3b252ca2be Bluetooth: Mesh: Rename configuration server code from cfg to cfg_srv
Now that there's support for configuration client as well, rename cfg
to cfg_srv to avoid any confusion.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 86624941e4 Bluetooth: samples/mesh_demo: Add dummy provisioning
Some of the provisoning routines, such as node reset assume that we
have a valid bt_mesh_prov pointer.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 0ef7c6e09a Bluetooth: Mesh: Add more flexible APIs for provisioning bearers
Add the ability to track the provisioning bearer through an extra
parameter to link_open/close. Also introduce new public functions to
enable/disable specific provisioning bearers. This also means that one
now needs to explicitly enable provisioning bearers after calling
bt_mesh_init().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg a81fa43a59 Bluetooth: Mesh: Use proper _t suffix for typedefs
To be consistent with the coding style, use a _t suffix for typedefs.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Jukka Rissanen ba6c72fff1 samples: net: http: Possible null memory access in client & server
We might access null pointer in debug print.

Coverity-CID: 178789
Fixes #4785

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-14 23:03:16 +02:00
Jukka Rissanen a38345ad98 samples: net: http: Do not overrun url array
It is possible to access past end of url buffer by one byte.

Coverity-CID: 178790
Fixes #4784

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-14 23:03:16 +02:00
Johan Hedberg 6f4d627983 Bluetooth: samples/mesh_demo: Convert to using Configuration Client API
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +02:00
Johan Hedberg 588887c9b7 Bluetooth: Mesh: Add primary address to provisioning complete callback
It may be useful for the app to know that the local node's primary
address is.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +02:00
Zhang WenChao b6171378fc sample: blink_led: Add support for stm32f4_disco
Signed-off-by: Zhang WenChao <zhangwenchao001@gmail.com>
2017-11-14 07:04:00 -05:00
Robert Chou 1d70a39d1b net: samples: replace tag zoap with coap
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-11-14 06:42:57 -05:00
Michael Scott 92cf80e9b2 net: http: dont add CRLF to protocol
In http_request() a CRLF is added to the header information after
the protocol is added.  2 CRLF in a row means the header information
is done, so following header information will be ignored.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-11-14 09:52:59 +02:00
Paul Sokolovsky ed3ede06e1 samples: net: sockets: Reinstate POSIX Makefiles.
All current socket samples as one of the points show portability to
POSIX platforms, and provide POSIX makefiles to let user build such
a version of application easily. These Makefiles were lost during
CMake conversion.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-11-13 16:41:14 -05:00
Sebastian Bøe 965f78088f samples: dump_http_server: Change where the .inc file is written
KBuild would write the .inc file to the source directory, this was
changed during the CMake migration because whenever possible it should
be avoided to write files outside of the build directory.

But Makefile.posix assumes that these files are generated in the
source directory so we need to keep generating them there for now.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-13 10:08:41 -05:00
Johan Hedberg b4700c3f2b Bluetooth: Mesh: Clarify API for empty model arrays
Avoid applications defining empty model arrays by themselves by
documenting the BT_MESH_MODEL_NONE helper macro (renamed to be more
intuitive) and using it in the mesh sample app.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-13 14:38:04 +02:00
Johan Hedberg a554ae2bc1 Bluetooth: Mesh: Remove reference to non-existing Kconfig option
There's no such Kconfig option as CONFIG_BT_MESH_TX_SEG_COUNT.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-13 14:38:04 +02:00
Carles Cufi 697e30459d samples: grove: Convert doc to CMake.
Convert doc of samples/grove to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi d1235f9bd8 samples: subsys: Convert doc to CMake
Convert doc of samples/subsys to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi 8146d8efbb samples: sensor: Convert doc to CMake
Convert doc of samples/sensor to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi 19d1e9afd1 samples: drivers: Convert doc to CMake
Convert doc of samples/drivers to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi bd9d38b5bd samples: boards: Convert doc to CMake
Convert doc of samples/boards to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi 08183f7e73 samples: basic: Convert doc to CMake
Convert doc for samples/basic to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi ece86b23ac samples: misc: Convert doc to CMake
Convert misc samples doc to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi 915bf989cf samples: mmu: Convert doc to CMake
Convert the samples/mmu documentation to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Michael Scott 9a380bf08f samples: net: lwm2m_client: update README
Update the sample README with the latest changes during the
1.10 development cycle.  We removed the 2 concurrent IPv4
and IPv6 connections and now the sample will make a single
connection based on whatever is configured (currently IPv6
takes precedence over IPv4).

Added instructions for how to switch the sample to IPv4.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-11-11 10:06:43 -05:00
Jukka Rissanen dea2868a82 samples: net: Update compilation instructions for cmake
Update network sample documentation for cmake.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-10 11:36:33 -05:00
Jukka Rissanen 3c0a0053fa samples: net: Remove QEMU_NET_STACK setting from CMakeLists.txt
The QEMU_NET_STACK is enabled automatically if building
a networking application to QEMU so no need to do it for
each networking sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-10 14:52:53 +02:00
Johan Hedberg c7001a4620 Bluetooth: samples: Remove references to Kbuild-style building
Update the documentation for the Bluetooth samples not to refer to the
old style of building using make. Instead, simply refer to the general
instructions.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-09 10:57:49 -05:00
Andrei Emeltchenko 994ec924e3 usb: samples: Support build for 96b_carbon board
Rename netusb project file to be more general and support sanity build
for 96b_carbon board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-09 09:31:58 -05:00
Jukka Rissanen d63efc3aa1 samples: net: rpl: RPL node application was missing sample.yaml
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-09 10:59:30 +02:00
Jukka Rissanen 025e07e413 samples: net: rpl: Fix compile error in rpl-node application
Some required files were removed from samples/net/common which
caused compile error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-09 10:59:30 +02:00
Sebastian Bøe 6d35480e36 cmake: Fixed samples/net/rpl-node
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 8dd5107d6a cmake: Ported samples/net/rpl-node
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe c7832bd343 cmake: Use -serial bt-server when CONFIG_BT
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 09f646a628 cmake: Fixed NODE_ADDR
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 5630ccfc23 cmake: Introduce a default VID and PID
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Anas Nashif cd313cb82d sampels: remove obsoleted static_lib sample
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Andrew Boie f90242a448 mem_domain_apis_test: fix sample.yaml
This should be runnable on any board that supports user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-11-08 09:15:14 -08:00
Andrei Emeltchenko fb4dfa9d6f net: samples: Add netusb configuration to zperf
Add configuration for USB CDC ECM Ethernet Networking.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-08 10:55:50 -05:00
Andrei Emeltchenko 6048c0cd2f net: Fix zperf TCP build
Fix zperf for TCP tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-08 10:55:50 -05:00
Johann Fischer cebc1c501b samples: webusb: rework usb descriptor
Remove Intel's VID and PID, rework usb descriptor
and remove cdc_acm.h header dependencies.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-11-07 15:31:02 -05:00
Adithya Baglody 792fc9ed01 samples: MPU: updated the memory domain test for x86.
GH-3852

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-11-07 12:22:43 -08:00
Johan Hedberg b451f132c5 samples: bluetooth/mesh: Add Friend support
Make it possible to use the mesh sample app as a Friend node.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-07 18:59:06 +03:00
Sahaj Sarup b6c70fd331 samples: Basic Thread Demo
A basic demo to showcase multi-threading using K_THREAD_DEFINE

Signed-off-by: Sahaj Sarup <sahaj.sarup@linaro.org>
2017-11-07 08:28:32 -05:00
Jukka Rissanen 6ddc85d522 samples: net: HTTP client sample using net-app
This is a sample HTTP client application that uses new http API
instead of legacy one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Jukka Rissanen 5c9de9035d samples: net: HTTP server sample using net-app
This is a sample HTTP server application that uses new http API
instead of legacy one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Jukka Rissanen 770de2c69a samples: net: http: Remove deprecated HTTP client/server samples
As the old HTTP API is deprecated, the old samples can be removed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Jukka Rissanen 2486694eb9 net: http: Create HTTP library that uses net-app
Create http library that uses net-app instead of net_context
directly. The old HTTP API is deprecated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Youvedeep Singh 3a179e29b0 samples: boards: nrf52: test demo for nrf52 power management
This sample tesecase provides sample code :-
1. Triggers Low Power tasks into nrf52 SOC (CONST LAT and LOW PWR)
2. Triggers System Off state.
3. Wake up device through port Event by GPIO (Button 1).

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-06 09:29:10 -05:00
Jukka Rissanen 795bffbee2 samples: net: echo-client: Fix compile warning
This is similar fix as in commit 643cc4a22c but this one fixes
the thread parameter in UDP DTLS thread.

Fixes this function parameter datatype warning:

expected ‘k_thread_stack_t * {aka struct _k_thread_stack_element *}’
 but argument is of type ‘u8_t * {aka unsigned char *}’

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-03 10:49:33 -04:00
Savinay Dharmappa 4cec15270d sample: subsys: logging: kernel_event_logger: Add sample application
patch adds a sample application to demonstrate use of kernel event
logger feature.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-11-02 22:22:54 -04:00
Anas Nashif 373b6bed8b samples: remove ieee802154 sample, we have echo server/client
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-02 15:53:04 -04:00
Jukka Rissanen 862ddb17ab samples: net: coaps_server: Fix coap packet parsing
The length and the start of the coap payload was not correct
because the received packet did not had IP and UDP header in place.

Fixes #4630

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-02 14:43:10 +02:00
Leandro Pereira da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira adce1d1888 subsys: Add random subsystem
Some "random" drivers are not drivers at all: they just implement the
function `sys_rand32_get()`.  Move those to a random subsystem in
preparation for a reorganization.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Anas Nashif 0fb51fa849 headers: fix global includes for various source files
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Anas Nashif 9b7abb9d8c samples: bluetooth: add nrf52_pca10040 to beacon sample
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Michael Scott 98d8c6a665 net: lwm2m: fix all return values from resource callbacks
Previously, post_write and execute callbacks returned 1 when handled
and 0 for error condition.  However, this wasn't detailed enough and
the engine can't propagate any sort of error back to users -- so it
doesn't even check the return values in many cases!

Let's adjust the resource callback functions of all objects and the
lwm2m_client sample to return 0 for success or a valid error code.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Michael Scott ccbd696706 net: lwm2m: remove predefined firmware buffer from firmware_pull
Now that we can access resource data in the lwm2m subsys, let's use
the user provided firmware push buffer (5/0/0) to also store the
firmware pull data.

This way the size of the firmware pull buffer is completely up to the
application.

NOTE: This patch adds a 64 byte firmware buffer to the lwm2m_client
sample for this purpose.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Michael Scott 1bab82f8f0 samples: lwm2m: remove large buffer size requirement
Now that the LwM2M library can parse across multiple fragements,
let's remove the larger than normal buffer size setting.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Anas Nashif 780324b8ed cleanup: rename fiber/task -> thread
We still have many places talking about tasks and threads, replace those
with thread terminology.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-30 18:41:15 -04:00
Andrei Emeltchenko 2d822f1504 samples: http_server: Add netusb configuration
Add configuration to http_server sample making it possible to work
with USB Device stack with Ethernet ECM protocol.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-30 11:50:42 -04:00
Andrei Emeltchenko c4a3d6817c samples: echo_server: GPIO should be selected in the board configs
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-30 08:30:48 -04:00
Paul Sokolovsky 44e25bc53c Bluetooth: ipsp: Add detailed instructions
Given that 6lowpan/BLE support is still work in progress, uses
debugging interfaces to setup, has known issues, and otherwise
not widely known or adopted, provided detailed instructions,
including reasonable diagnosing steps on how to set up and test
such a connection.

Tested using 96b_carbon.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-30 08:10:35 -04:00
Andrei Emeltchenko 66df6f1130 net: sample: Add USB Ethernet stick configuration
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-28 14:38:19 -04:00
Andrei Emeltchenko 61202e898e usb: Add sanity_check configuration for netusb
Add netusb and composite netusb build check configurations.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-28 14:38:19 -04:00
Andy Ross 4a8a24fe39 Revert "cdc_acm : Restrict writing more than 4 bytes into TX USB Endpoint."
This reverts commit 1da0a9eebd.

The workaround caused a severe performance penalty, and only worked
for USB packets of 4-15 bytes in length (16+ byte packets weren't
subject to the hardware bug).  Single-byte packets (very common for
cdc_acm serial port transfers) would still be duplicated sometimes.

The upcoming DMA implementation does not share the performance
penalty, and also is not subject to the bug for those sizes of packets
(though it DOES still have a problem with single-byte packets!).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-10-28 14:38:19 -04:00
Tomasz Bursztyka 1b77ee12ea samples/net: Reducing prj*.conf files by relevantly removing 6Lo option
If NET_L2_IEEE802154 and NET_IPV6 are enabled:
- NET_6LO is enabled
- NET_L2_IEEE802154_FRAGMENT is enabled

Thus removing setting this config options to yes where applicable.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-28 14:28:02 -04:00
Marti Bolivar 306c717b9e samples: drivers: add WS2812 sample application
This is similar to the LPD8806 sample, but uses the WS2812 driver
instead. The app configuration is a bit more finicky, so try to
provide helpful references. This could be made more beginner-friendly
with the addition of timing diagrams, etc., but this should be enough
for an experienced developer to use.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Marti Bolivar 3e674eac98 samples: drivers: add LPD8806 sample application
This sample displays the colors red, green, and blue on consecutive
LEDs in an LED strip, moving the starting point where red begins
further down the strip at each time step. The color band wraps around
to the beginning when it reaches the end.

Since this is the first application in samples/drivers to have
documentation, add samples/drivers/drivers.rst as well, and include it
in the top-level toctree from samples/samples.rst.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Paul Sokolovsky 50d7ca11bc samples: echo_server: Clean up frdm_k64f config
Remove CONFIG_NET_L2_ETHERNET, as it's automatically set by the
board. This effectively makes prj_frdm_k64f.conf fairly portable,
e.g. the same config can be used for frdm_kw41z whcih uses 802.15.4
connectivity instead.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-28 09:24:58 -04:00
Michael Scott 907e7671e9 samples: lwm2m: reduce footprint of lwm2m conf
LwM2M is intended for constrained devices.  The default samples
settings are quite large by that standard and can be reduced to
reflect actual usage.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-26 09:25:56 +03:00
Michael Scott f34d0ebb8a samples: lwm2m: combine prj_*.conf files
After the LwM2M sample was introduced several HW related defaults were
added to Kconfig.  We no longer need separate prj*.conf files for K64F
and qemu_x86.  Let's combine them into a single prj.conf file and
adjust documentation.

NOTE: This also adjusts README.rst

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-26 09:25:56 +03:00
Kumar Gala c1881b22fe samples: net: wpanusb: Fix build error due to missing USB device vid/pid
We removed the default values for:
* CONFIG_USB_DEVICE_VID
* CONFIG_USB_DEVICE_PID

So put some dummy values in the sample.yaml to get things building
again.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-25 11:52:50 +02:00
Jukka Rissanen 643cc4a22c samples: net: echo-client: Fix compile warning
Fixes this function parameter datatype warning:

expected ‘k_thread_stack_t * {aka struct _k_thread_stack_element *}’
 but argument is of type ‘u8_t * {aka unsigned char *}’

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-24 11:41:40 -07:00
Jukka Rissanen 62fb302396 samples: net: echo-client: Fix DTLS compilation
If DTLS was enabled, then certifacate setup function was missing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-24 11:41:40 -07:00
Johan Hedberg 5640b631b4 samples: mesh_demo: Enable relay by default for the micro:bit
The relay functionality was supposed to be always enabled rather than
always disabled on the micro:bit.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-23 12:39:52 +02:00
Adam Podogrocki 61467e019e iwdg: the sample of the use of STM32 Independent Watchdog
JIRA: ZEP-2347

Change-Id: I808e9f110681735cae45d14c5802636012f018cc
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-10-23 09:51:16 +02:00
Andrew Boie 21a7a0f576 Revert "samples: MPU: updated the memory domain test for x86."
This reverts commit 35a4c679b4.
2017-10-20 15:02:59 -04:00
Adithya Baglody 35a4c679b4 samples: MPU: updated the memory domain test for x86.
GH-3852

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-10-20 10:39:51 -07:00
Anas Nashif 321e6c2701 samples: echo client/server: test more configurations
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-20 13:22:25 -04:00
Anas Nashif 1c60c00504 samples: echo_server: remove unrelated CONFIG_ARC_INIT
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-20 13:22:25 -04:00
Jukka Rissanen 6a0c5dede7 samples: net: ieee802154: Update config to sane values
The IEEE 802.15.4 UART pipe config files in
echo_server/prj_qemu_802154.conf and echo_client/prj_qemu_802154.conf
did not had proper configuration options set. This prevents
qemu<->qemu communication between the echo-server and echo-client.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-20 12:55:55 -04:00
Chunlin Han c7a55004bd samples: fix mem_domain_apis_test doesn't be built during sanitycheck
Use platform_whitelist to specify supported boards to make sure
mem_domain_apis_test sample will be built during sanitycheck.

Signed-off-by: Chunlin Han <chunlin.han@linaro.org>
2017-10-19 09:41:27 -04:00
Andrei Emeltchenko 45c4d07287 usb: Add missing tag to sanity check configuration
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-19 09:30:58 -04:00
Andrei Emeltchenko 44a3cca2e2 usb: Remove default Vendor and Product ID
Vendor ID and Product ID should be assigned on build time by
respective process.

For sanity check we assign some random values which are only used for
build tests and should not be used for real products.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-19 09:30:58 -04:00
Johan Hedberg ee107baad9 samples: mesh_demo: Use second button to change target address
It's been observed that that the relay toggling functionality is not
very useful, and that it's better left enabled always. Change the
purpose of the second button to instead modify the target address that
messages sent through the first button get directed to. By default the
destination is the group address, i.e. all nodes receive the message.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-18 16:08:22 -04:00
Paul Sokolovsky 5cbfa397c5 samples: sockets: dumb_http_server: Use big payload by default
This sends out 2KB+ payload (i.e. guaranteedly more than 1 network
packet). When this sample was initially written, using such payload
quickly let to a deadlock somewhere in the network stack. However
as of now, running with such payload can sustain testing with
"ab -n10000" (10000 consecutive HTTP requests using Apache Bench),
so set is as a default, to serve as a mark point against possible
future regressions.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-18 12:38:36 -04:00
David B. Kinder 4600c37ff1 doc: Fix misspellings in header/doxygen comments
Occasional scan for misspellings missed during PR reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 19:40:29 -04:00
Michael Scott 1965e5e9fc net: lwm2m: add RD client callbacks for app
Applications may want to be notified when various events
happen in the LwM2M rd client.  Let's implement an event
callback which sends: connect, disconnect and update events.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
Robert Chou b93eb8dee1 net: lwm2m: add firmware push support
1. Add handling block1 option in handle_request(). The basic idea is
   to declare structure block_context at compiled time and use "token"
   as a key to pick up the on-going block cotext. It should be able to
   support multiple blockwise transfer concurrently
2. Use write callback implemented in lwm2m_obj_firmware to deal w/ the
   update state transition and than call the callback registered by the
   application
3. move default_block_size to lwm2m_engine.c to share between
   lwm2m_engine and lwm2m_obj_firmware_pull

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
[michael.scott@linaro.org: rebased on LwM2M net_app changes.]
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
Robert Chou d9f5fe7455 net: lwm2m: add state machine for firmware pull update
1. Parse firmware pull URI
2. Add lwm2m_firmware_get/set_update_cb() for application to register
   callback. This is because we want to check the update_state before
   we pass to the application
3. Add lwm2m_firmware_get/set_update_result() and
   lwm2m_firmware_get/set_update_stat() to manage the state transition
   as well as the sanity check

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
[michael.scott@linaro.org: rebased on net_app framework and
lwm2m_message refactoring.]
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
David B. Kinder ee71332b99 doc: fix doc misspellings
Found some spelling issues missed during regular PR review

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 14:31:52 -04:00
Jukka Rissanen 6f41e3a191 samples: net: http_client: Disable OPTIONS method
As many HTTP servers do not support OPTIONS method, disable it
by default.

Fixes #4325

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-17 13:52:26 -04:00
Jukka Rissanen e5958d3a8d sample: net: mdns: Add mDNS responder application
This application does not do anything itself, it just waits
mDNS queries and responds to them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-17 08:36:39 -04:00
Harry Jiang 17404abed3 samples: environmental_sensing: fix the data type for read_u32()
Signed-off-by: Harry Jiang <explora26@gmail.com>
2017-10-17 09:10:26 +03:00
Paul Sokolovsky a39ec5f72c drivers: slip: Rework logging to follow conventions
Previously, there was boolean CONFIG_SLIP_DEBUG, which effectively
switched between "logging off" and "debug-level logging". Instead,
switch to CONFIG_SYS_LOG_SLIP_LEVEL (the naming of the option follows
existing conventions) which allows to select any of the standard 5
logging levels.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-16 12:31:17 -04:00
Jukka Rissanen 8b6a7690ef samples: net: echo_client: Print the used protocol when sending
Useful when debugging what protocol is being used when sending
TCP data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-16 16:36:01 +03:00
Jukka Rissanen f766ba4171 samples: net: echo_client: Connect both IPv4 and IPv6 before sending
Make sure we are connected before starting to send IPv4 and IPv6 TCP
data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-16 16:36:01 +03:00
Robert Chou a2af43e270 net: samples: fix early unref issue for coap_client/server
Explicitly call net_pkt_ref()/net_pkt_unref() to avoid packet being
freed after calling net_context_sendto() at retransmit_request().
Also, do not return when net_context_sendto() returns error. Instead,
we should keep retrying.

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-16 12:38:28 +03:00
Robert Chou d2e98c86fa net: samples: fix malformed payload when coap_client/server retransmit
Original coap_client implementation does not setup "appdatalen" of
net_pkt correctly and does not strip the IP + UDP headers when doing
the retransmit. This will result in malformed coap packet. Fix it by
adding a strip_headers() function to set appdatalen and get rid of
IP + UDP headers.

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-16 12:38:28 +03:00
Paul Sokolovsky de6fafb701 samples: net: sockets: Print incoming connection number
This helps to debug issues with mass connection handling (e.g. when
issues happen at ~500th connection).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-16 11:01:06 +03:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Andrew Boie 8bfac9b6c3 philosophers: run with threads in user mode
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-13 12:56:14 -07:00
Johann Fischer 5ab2cb96eb samples: cdc_acm: add composite configuration
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-13 09:18:14 -04:00
Robert Chou 4869c16eae net: samples: fix coap_client early unref packet issue
1. After calling sendto(), the packet will be unreferenced.
   Call coap_pending_cycle() to make sure the packet is referenced until
   we got the response from the peer or retransmission timeout.
2. In retransmit_request(), we rearrange the order to avoid the issue.
3. Remove IPv4 configuration for source code is expecting IPv6
4. Correct a typo in README.rst
5. Initialize the interface w/ IPv6 address

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-13 14:38:18 +03:00
Robert Chou 4fbf721390 net: sample: correct coap-server ETSI TD_COAP_BLOCK_03/04 testcases
When testing against etsi_coaptest.sh, test cases TD_COAP_BLOCK_03/04
will get stuck. This is because these testcases send out a blockwise
transfer but with an empty payload. Although this should be a legit
request, large-update/create handlers did not check "MORE" flag in
block1 option and always return an error when request comes with empty
payload.

Corrected as below
1. Initialize coap_block_context when first block arrives.
   (SIZE1 option is not always available. In the case that SIZE1 is
    unavailable, the zoap_block_context will be re-initialized each time
    a new block has arrived)
2. Check "MORE" flag of block1 option. If it's the last block, then
   an empty payload should be allowed.
3. Response w/ 2.04 CHANGED when the last block has arrived for
   large-update
4. Response w/ 2.02 CREATE when the last block has arrived for
   large-create
5. Remove adding block2 option to the response since we are not sending
   back any data to the caller

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-13 13:50:28 +03:00
Tomasz Bursztyka 4f0b25bef1 samples/wpan: Use set_filter() instead of former API function
Replace set_ieee_addr/set_shord_addr and set_pan_id relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Andrzej Puzdrowski a568e1399f sample: drivers: soc_flash_nrf5: Test of write-block-size get API
Added example code of using the new API for retrieving write-block-size.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-10-11 11:19:15 -05:00
Marti Bolivar 1047be9dbe samples: flash_shell: update to keep up with flash driver changes
Keep the flash shell up to date with the latest flash driver updates.

- Get the driver name from soc.h
- Add a write_block_size command
- Implement flash_shell_page_layout() using flash_page_foreach()

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-06 22:12:23 -04:00
Ravi kumar Veeramally b4dbd50b8d net: samples: Add leds demo app over RPL and CoAP
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally c30f692af0 net: samples: Modify coaps_client to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally 7519240502 net: samples: Modify coaps_server to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally bde8c6d616 net: samples: Modify zoap_client to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally 3e4a70669a net: samples: Modify zoap_server to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally e6bda22710 net: samples: Modify leds_demo to use new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Michael Scott 41897d7e19 samples: net: irc-bot: fix help text buffer size
At 32 bytes the snprintk call to fill the help buffer was most often
running out of room and returning an error.  Let's expand it to 64.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 201076254a samples: net: irc-bot: handle private messages in some commands
Users can private message the bot and the bot should respond directly
back to that user rather than rudely ignoring them.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 61c8c3fc7a samples: net: irc-bot: establish a static global for nickname
Let's create a static global var for nickname so that we can use it
later without having to pass it all the way through callbacks, etc.

Also limit the size to 16 bytes as IRC servers will truncate anything
beyond.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 2eb4a37bac samples: net: irc-bot: remove use of zirc and zirc_chan
These structures were originally intended to prototype an IRC library
which would be later moved into the subsys/net/lib/irc folder.

Unfortunately, that effort has faded and they make this code much more
complex than necessary.  Let's remove them in favor of simplicity.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 45561c7310 samples: net: irc-bot: move initialite_hardware() code to main()
The code is easier to follow this way.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00