Commit graph

2626 commits

Author SHA1 Message Date
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
Michael Scott 34ca5ee67b samples: net: irc-bot: declare banner text at the top
For style points let's declare the text shown at the beginning
of main() function to the top of our source as APP_BANNER so that
it's obvious and presents nicely.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott b5617b1106 samples: net: irc-bot: fix cmd parsing across multiple buffers
Let's simplify the parsing function which scans incoming traffic
for carriage returns and let the net_pkt_read() function cross
multiple buffers if needed.  Also, gracefully skip lines which
are longer than the command buffer.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 3e1e2d53ec samples: net: irc-bot: clean up prj.conf
Several settings were out-dated or now enabled elsewhere.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 334667342c samples: net: irc-bot: add support for CONFIG_NET_CONTEXT_NET_PKT_POOL
Some L2 layers such as bluetooth need to have extra buffer pools to
hold copies of packets for use with TCP.  Let's add support for that
so that future enablement of other boards won't get bitten.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 86c426d3e8 samples: net: irc-bot: migrate from NET_LOG to SYS_LOG
Let's migrate from using NET_LOG_* functions to the SYS_LOG
facility which allows for granular control over the display
of info, debug and error messages unique to the file that
you're in.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 80bad32828 samples: net: irc-bot: migrate to net_app API
Let's remove all of the extra coding to handle DHCP, DNS and event
management.  This is all handled by the net_app API.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Tomasz Bursztyka 10904a0d29 net/samples: Build cc2520 frdm's common code only when relevant
If cc2520 is not selected, then won't be any need for that part.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-06 18:30:18 -04:00
Johann Fischer 927cdf9c32 samples: usb: set default log levels in mass sample to error
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-05 12:09:59 -04:00
Tomasz Bursztyka 0576a393f2 samples/net: Let's merge ieee802154 qemu and hw tests into one
There is now only samples/net/ieee802154 for low level IEEE 802.15.4
test.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Tomasz Bursztyka d4eeaff93c samples/net: Removing config support for arduino_101 with CC2520
It's useless now, arduino_101 has proven not working very well with x86
gpios and CC2520 never got to work properly there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Tomasz Bursztyka 91df111386 samples/net: Getting rid of common ieee802154 settings altogether.
Only ieee802154 should have been using it, but it ended in various
samples that did not require it anymore once they've been using
net_app. Unlike former samples settings, net_app settings are tied to
net_app, so let's just forget about all of it and silently use net_app.
If something goes wrong in setting net options, it will be a unique
place.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Paul Sokolovsky c80e9d00da samples: net: echo_client: Consistently enable net_app for all configs
This app now depends on net_app API, so it must be enabled for all
project configs we have.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-04 10:46:12 +03:00
Aska Wu 89f28ac7c8 net: sample: Add sntp client sample
This sample demostrates how to use SNTP client library to get the
current time from SNTP/NTP server.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-10-03 15:29:27 -04:00
Anas Nashif 71a927955e usb: move headers to include/usb/class
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif 18a33edd39 usb: fix local includes and add usb namespace
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif fde34dd54b usb: fix header by adding subsystem prefix
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif 95d4ebbcd9 samples: net: use 'run' target in common Makefile.ipstack
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 10:27:17 -04:00
Chunlin Han fe48e9efde sample: demonstrate the usage of memory domain APIs
The demo application to demonstrate the usage of memory domain APIs.

Signed-off-by: Chunlin Han <chunlin.han@linaro.org>
2017-09-29 16:48:53 -07:00
Johan Hedberg d712a4e1a3 Bluetooth: Mesh: Remove local network interface Kconfig option
From section 3.4.5.3 in the Mesh Profile Specification 1.0:

    "A node shall implement a Local Network Interface."

Removing the Kconfig option also helps clean up quite a lot of code.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-27 16:33:06 +03:00
Johan Hedberg 8f168c85f7 samples: microbit/pong: Fix incorrect placement of parenthesis
The code was causing only one byte of data to be placed in timeout
instead of sizeof(timeout) as intended.

Coverity-CID: 170744

Fixes #4057

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-26 12:55:14 +03:00
Paul Sokolovsky ef39533365 samples: sockets: Add a dumb HTTP server example
It's dumb, because it doesn't really parse HTTP request, just always
sends the same page in response. Even such, it's useful for socket
load testing with tools like Apache Bench (ab) and for regression
checking in the net subsystem.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-09-22 08:24:36 -04:00
Luiz Augusto von Dentz 9b5d3f174f Bluetooth: ipsp: Add dedicated conf file for CONFIG_NET_L2_BT_ZEP1656
CONFIG_NET_L2_BT_ZEP1656 shall only be used with hosts that are known to
not comply with RFC 7668.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Luiz Augusto von Dentz a4e176b6a3 Bluetooth: ipsp: Add note about the Linux 4.12 kernel release
Since 4.12 Linux kernel has fixes required to comply to RFC 7668.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Luiz Augusto von Dentz b81ab53f89 Bluetooth: ipsp: Add CONFIG_NET_APP_BT_NODE=y to prj_dbg.conf
CONFIG_NET_APP_BT_NODE is required in order for the Bluetooth L2 driver
to register IPSS service.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Andrei Emeltchenko 54831ec5c7 usb: webusb: Move USB version definition to right place
Make it possible to reuse definitions from other samples.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 13:10:04 -04:00
Andrei Emeltchenko 4efaefba5c usb: Allow to select configuration for composite devices
Composite multifunction USB devices should be able to know about
configuration change, implement it through existing callback.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00