Commit graph

1640 commits

Author SHA1 Message Date
Vincent Wan db022a966c samples: net: add TLS offload support to mqtt_publisher
This commit adds support in the sample to deal with the case when TLS
is offloaded and mbedtls is not necessary.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-01-31 06:36:08 -05:00
Vincent Wan fec0445ebb samples: net: Add support for cc3220sf_launchxl in mqtt_publisher
This commit adds the necessary changes to allow the mqtt_publisher
sample to run on cc3220sf_launchxl.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-01-31 06:36:08 -05:00
Aurelien Jarno 4394601524 net: sntp: get rid of the callback function
The original SNTP client library was designed for the net-app API, for
which it makes sense to have a callback function, which is called
asynchronously when an answer is received.

For the socket based interface, the callback is called just before
sntp_request() returns. It gets the status and the epoch_time in
parameter, however the status is already returned by sntp_request(). It
therefore make sense to replace the callback function by a pointer to
epoch_time.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-31 10:14:12 +02:00
Paul Sokolovsky d6ffca36f3 samples: sockets: Clean up headers included
Don't include net_app.h and net_buf.h, the first is deprecated, the
latter is low-level header, both shouldn't be used for socket apps.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-30 21:05:11 -05:00
Michael Scott b0de8b88dd samples: lwm2m_client: enable HW flow control for WNC-M14A2A modem
The WNC-M14A2A modem is supposed to use HW flow control on the UART
connected to the MCU.  In the past, we were able to bypass this
requirement by using only the LTE-M firmware which supported pulling
the CTS line high via "send-ok" gpio.

This does NOT work for the LTE firmware.

Now that MCUX UART driver supports hw-flow-control setting, let's use
it in the modem overlay so that regardless of modem firmware
(LTE vs. LTE-M) the sample will "just work".

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-30 02:53:12 -06:00
Michael Scott 0ee0773abd net: lwm2m: remove unused CONFIG_NET_CONTEXT_NET_PKT_POOL config
CONFIG_NET_CONTEXT_NET_PKT_POOL is used by Zephyr's TCP stack as
a way of keeping the original packet data when compression and
other l2 specific actions make the data unusable for retries.

LwM2M uses UDP and this option was never used.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-30 10:35:54 +02:00
Kumar Gala 3e8fc3c0c1 modem: wncm14a2a: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert wncm14a2a driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 14:21:56 -06:00
Ravi kumar Veeramally a9acc6d4d7 net: samples: Add socket based SNTP client application
SNTP client sample requests time sync on IPv4 and IPv6 addresses
using socket based SNTP client library.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-01-29 12:25:01 -05:00
Ravi kumar Veeramally f51cebeea2 net: sntp: Rework SNTP client library to use sockets
As networking libraries and protocols are moving to socket
based implementation, reworked SNTP client library to use sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-01-29 12:25:01 -05:00
Kumar Gala e0cd0c2b67 wifi: winc1500: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert winc1500 driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-28 10:39:59 -06:00
Jukka Rissanen 4043909d69 net: http: Remove HTTP client and server APIs
The old legacy APIs use net-app library and as that is being
removed, then the dependencies need to be removed also.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-25 11:21:20 -05:00
Jukka Rissanen 1cba0161ed net: websocket: Remove the websocket as HTTP APIs are removed
Remove the experimental websocket code as it uses HTTP APIs
which are being removed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-25 11:21:20 -05:00
Paul Sokolovsky fe7043d7ca samples: net: sockets: Set explicit min_flash on some samples
Fixes build issues with lpcxpresso54114_m0 which set to have 32K RAM,
and only 64K Flash.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Paul Sokolovsky 8c50ce934b samples: net: socket: Add "socket" tag to sample.yaml's
So it was easy to run all socket tests without remembering
the exact path(s).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Paul Sokolovsky df95a423b2 samples: echo_async_select: Add select()-based async echo sample
A copy of poll()-based echo_async, converted to use select().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-24 17:14:43 +02:00
Paul Sokolovsky e779f91e0c samples: echo_server: Test overlays for eth_e1000 and eth_stellaris
By adding relevant test config to sample.yaml.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-21 09:09:45 +02:00
Paul Sokolovsky 7117b73562 samples: echo_server: Test overlay-smsc911x.conf via sanitycheck
By adding relevant test config to sample.yaml.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Paul Sokolovsky c3aa195940 samples: sockets: Add eth_smsc911x overlays
Add overlays for commonly used socket samples: big_http_download and
dumb_http_server. Can be used with:

make BOARD=mps2_an385 CONF_FILE="prj.conf overlay-smsc911x.conf"

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Paul Sokolovsky 56cb35a7e8 samples: net: echo_server: Add overlay for eth_smsc911x
As can be used for example with BOARD=mps2_an385.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Robert Lubos 97aa3ac519 samples: openthread: Increase shell stack size
OpenThread commissioner shell command caused stack overflow on shell
thread, hence increase it for OpenThread samples.

Fixes #12455

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-18 15:24:16 +02:00
Jakub Rzeszutko fd0b7f7767 shell: removing legacy shell
Legacy shell removed in order to avoid maintaining two shells
systems.

All examples and tests have been migrated to the new shell.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-01-16 21:35:36 -05:00
Andrei Gansari 4118b8843f drivers: eth_enc28j60: moved to dts
Driver for networking device Microchip ENC28J60 is used as SPI slave,
moved to DTS type definition. Samples echo_client and echo_server use
this device on Arduino 101 board.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 21:28:23 -05:00
Adithya Baglody 25572f3b85 tests: Dont run coverage for select test cases.
Disabled the CONFIG_COVERAGE for benchmarks and other tests.
This is needed because it interferes with normal behavior of the
test case.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-16 06:12:33 -05:00
Paul Sokolovsky fbcc43393c samples: big_http_download: Set min_flash to 128K.
Previously there was just "min_ram: 32", which took care about
suitable flash size implicitly. But now we have interesting boards
(e.g. lpcxpresso54114_m0) which tout RAM of 32K and Flash of 64K.
So, become more explicit about Flash requirement for the sample.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-15 17:22:39 -05:00
Jukka Rissanen a7afdc3512 net: rpl: Remove the deprecated code
The RPL was deprecated earlier so remove it by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-13 09:40:36 -05:00
Andy Ross f033d542ad tests: samples: Disable newlib tests on x86_64
This builds with a host compiler, not one from the SDK, and so no
newlib library is available.  There is work to enable newlib detection
at and above the cmake level.  This patch can be reverted when that
lands.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-11 15:18:52 -05:00
Paul Sokolovsky f3dce8a6e4 drivers: eth: stellaris: Enable automatic Ethernet support in QEMU
When used suitable config overlay, qemu_cortex_m3 with Ethernet
support can be started with just usual "make run".

An example of such overlay is included with samples/net/echo_server,
can be built and run with:

make BOARD=qemu_cortex_m3 \
    CONF_FILE="prj.conf overlay-qemu_cortex_m3_eth.conf" run

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-11 09:48:27 +02:00
Martin Schwan c5de716af4 net: mqtt: Fix typo "seg_tag_list"
Fix a typo in the mqtt_sec_config struct where it was "seg_tag_list"
instead of "sec_tag_list".

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
2019-01-10 11:30:33 +02:00
Andrei Gansari c8d3b3f768 samples: minor documentation fixes
DHCPv4 client typo: '/etc/dhcpd/dhcp.conf'
gPTP Sample -DCONF_FILE=prj.conf (filename changed)

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-01-09 07:57:18 -06:00
Tomasz Bursztyka fc3f090ab8 samples/sockets: Enable 802.15.4 properly for echo apps
These were still running through Ethernet using generic
overlay-802154.conf thus creating a dedicated one.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-08 11:25:33 +02:00
Andy Ross 442e7306bf samples/net/echo: Mark OpenThread test cases as "slow"
The current OpenThread integration wants to download (from github) and
configure the OpenThread source tree every time the app is build.  We
don't want to be doing this in quadruplicate every time sanitycheck is
run.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Andy Ross 5ea39b8c2d samples/net/echo: Remove duplicate test case
These tests were defining a "test_kw41z" case, but that platform is
already whitelisted in the main ("test") case, and this one defines no
different behavior.  It's just a dupe.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
David B. Kinder 06d78354ae doc: regular misspelling scan
Fix misspellings in documentation (.rst, Kconfig help text, and .h
doxygen API comments), missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-26 13:27:14 -05:00
Robert Lubos 167486f4a4 samples: sockets: Update OT overlays for echo samples
Increase rx stack size for OpenThread overlay, as updated revision of
OpenThread requires more stack to operate.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-21 10:27:33 +01:00
Martin Turon 6410a16adb openthread: Update openthread version to latest upstream/master.
Update zephyr integration of openthread to latest api as of 2018-12-17:

2a75d30684

Both echo_server and echo_client compile and are operational.

Signed-off-by: Martin Turon <mturon@google.com>
2018-12-20 12:24:51 +01:00
Tomasz Bursztyka e97a543e9b net/pkt: Remove parameters to "reserve" some headroom
Such parameter is not used anymore, it was defaulted to 0 previously.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Tomasz Bursztyka c77d864841 tests/net: Get rid of the ll reserve
As it is unused now, let's default to 0.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Tomasz Bursztyka d0c1611da3 samples/net: Let's remove the use of ll reserve
This is now useless.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Paul Sokolovsky 4bbdf8b59d samples: sockets: echo_async: Check results of fcntl() calls
Check result of fcntl() to catch any regressions in fcntl() handling
in Zephyr. To facilitate this, also merge block() and nonblock()
functions into single setblocking().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-14 13:21:31 +02:00
Robert Lubos 417cfdd833 samples: sockets: Tweak echo_client/server sample parameters for DTLS
Current application data size in echo_client sample does not fit into a
single datagram with DTLS enbled for default IPv6 MTU (1280 bytes). This
caused abrupt failure of the sample with DTLS enabled over 802.15.4 L2.
Decreasing the application data size allows it to fit into a single UDP
datagram after encapsulating it into DTLS record.

Additionally, finetune DTLS timeout on echo_server to match UDP
application timeout on echo_client (so that a single datagram loss
does not cauase DTLS session to end).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-13 21:13:52 +02:00
Paul Sokolovsky 5ea1e23202 samples: sockets: echo_async: Don't include <sys/fcntl.h>
POSIX doesn't mandate such a header, only <fcntl.h>. <sys/fnctl.h>
is just an internal implementation detail of Newlib on which we should
not rely.

This makes it possible to build this sample against minimal libc.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-13 14:21:34 +02:00
Bub Wei c356b5786f samples: net: zperf: Support existing IP
Considering that IP can be set dynamically by DHCP
or statically before test previously, we could have
alternative way by supporting both setting IP and
existing IP.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-13 14:20:25 +02:00
Andrei Emeltchenko 14f2805c05 wpanusb: Add sanity check configurations
Add sanity check configurations for overlays.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-12-13 12:49:20 +02:00
Andrei Emeltchenko 891356027e wpanusb: Correct configuration for frdm + mcr20a
Make buildable configuration

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-12-13 12:49:20 +02:00
Carles Cufi b51b7becf4 doc: samples: Update samples to point to active boards
Since the Arduino 101 and the Quark SE C1000 are not actively developed
boards, default to other boards that are maintained and used.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-12-12 23:06:16 +01:00
Jukka Rissanen eb9f13e3e2 samples: net: gptp: Update AVnu/gptp build instructions
The OpenAVNU gPTP daemon repository has changed so the compile
instructions were not working.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-12 11:09:40 +02:00
Jukka Rissanen c790290468 samples: net: gptp: Add instructions for native_posix
Remove QEMU instructions as those do not work. Add native_posix
board instructions for running gPTP with linuxptp daemon.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 18:20:54 +02:00
Adithya Baglody a65df22525 samples: rpl_border_router: Fixed headers files.
This sample was creating objects from header file in the bss.
Fixed it by moving the objects to appropriate object files.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-12-07 10:32:41 -05:00
Jukka Rissanen cd4eb946c4 samples: net: Convert to use generic logging macros
Use generic logging macros LOG_*() instead of NET_*() as the
latter are mostly meant for internal networking stack use.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen 86689030e8 net: Clarify logging in networking code
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.

Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.

Fixes #11343
Fixes #11659

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Robert Lubos 3651e03eeb samples: sockets: Add overlay configs to socket echo samples
Add Bluetooth, 802.15.4 and OpenThread overlay configurations to socket
echo_client and echo_server samples.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Robert Lubos fff401d693 samples: net: echo_server config cleanup
* Add generic 802.15.4 overlay config,
* Move OT generic configs into overlay-ot.conf,
* Remove nrf52840_pca10056 board configuration,
* Remove overlay-reel_board-15_4.conf - generic overlay can be used
instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Robert Lubos 34b19acc9f samples: net: echo_client config cleanup
* Add generic 802.15.4 overlay config,
* Move OT generic configs into overlay-ot.conf,
* Remove nrf52840_pca10056 board configuration.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Jakub Rzeszutko b928b71756 shell: rename shell_help_print function
Function printing help has been renamed to shell_help.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko e0be6a10b3 shell: printing command's help by shell engine
Removed printing command help from help handler. It is now
realized by the shell engine. This change saves a lot of flash
but still allows to print help in command handler with function
shell_help_print.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko 5451ff2848 shell: remove "options" concept
Removing help "options" from shell API.

Currently SHELL_OPT macro is not used by users. What is more
commit: a89690d10f ignores possible options created in
command handler by the user. As a result they are not printed
in help message.

Second, currntly implemented "options" in command handlers options are
implemented without SHELL_OPT macro.

And last but not least this change will allow to implement
help handler in a way that user will not need to think about calling
functions printing help in a command handler.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Patrik Flykt 079f55d519 samples: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Jukka Rissanen 4565ca86da samples: net: syslog: Remote syslog service example
The sample application will send syslog messages to remote
syslog server.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-04 15:55:53 -05:00
Jakub Rzeszutko 1a220b4e80 shell: decrease built-in commands flash usage
Rephrase some help messages to decrease flash usage.
Deactivate shell history feature for test test_netusb_rndis

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-04 15:53:02 -05:00
Vijay Kumar B 9452a1f045 samples: net: Modify echo server / client for Stellaris Ethernet.
Add project configuration files for echo_server & echo_client.

Signed-off-by: Fadhel Habeeb <fadhel@zilogic.com>
Signed-off-by: Nirav Parmar <niravparmar@zilogic.com>
Signed-off-by: Vijay Kumar B <vijaykumar@zilogic.com>
2018-12-04 09:36:51 -06:00
Bub Wei c9db778042 samples: net: zperf: Refactor zperf_*_receiver_init
Drop tcp and udp rx threads which are just setting
and returning.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-04 14:01:23 +02:00
Bub Wei a127984613 samples: net: zperf: Remove invalid forever sleep
We are not expecting forever k_sleep in multithreading.
And k_sleep is empty in non-multihreading.
So remove invalid forever sleep to avoid the below issue.

ASSERTION FAIL [duration != (-1)] @ zephyr/kernel/sched.c:807

Please refer to _impl_k_sleep api in zephyr/kernel/sched.c:807

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-03 14:43:49 +02:00
Anas Nashif 0754c67b3d samples: http_server: fixed test dependencies
depend on USB device and increase RAM requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-02 22:36:41 -05:00
Anas Nashif f3f91f88d6 samples: zperf: expand test coverage
depend on USB device and increase RAM requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-02 22:36:41 -05:00
Tavish Naruka df07e093ce samples: net: mqtt_publisher: Update for latest net_config and TLS setup
Remove adhoc handling of BLE connection setup, rely on net_config for
that. Remove board-specific configs, instead have prt.conf and overlay
configs. Perform TLS setup once before main loop, to avoid errors.

Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2018-11-30 11:05:10 -08:00
Bub Wei b5ae7da269 samples: net: zperf: Allow to build with IPv4 or IPv6 only
context4/6 is initilalized in net_context_get function
which is restricted under CONFIG_NET_IPV4/IPV6 with
IS_EANBLED macro. So add the same macro check for
net_context_put function to avoid NET_ASSERT(context).

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-11-30 14:18:34 +02:00
Bub Wei 3c4bb10127 samples: net: Fix zperf build issue
If NET_IPV6 is disabled, build issue happens as below.

zephyr/samples/net/zperf/src/zperf_tcp_receiver.c: In function ‘zperf_tcp_rx_thread’:
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:171:9: error: ‘in6_addr_my’ undeclared (first use in this function)
        &in6_addr_my->sin6_addr);
         ^~~~~~~~~~~
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:171:9: note: each undeclared identifier is reported only once for each function it appears in
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c: In function ‘zperf_tcp_receiver_init’:
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:250:3: error: ‘in6_addr_my’ undeclared (first use in this function)
   in6_addr_my = zperf_get_sin6();
   ^~~~~~~~~~~
*** [CMakeFiles/app.dir/src/zperf_tcp_receiver.c.obj] error 1
*** [CMakeFiles/app.dir/all] error 2

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-11-29 10:35:50 -08:00
Himanshu Jha 21224a9a78 samples: net: ws_echo_server: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Gil Pitney 9991bcb4c5 net: samples: sockets: http_get: Add secure socket offload support
Update the http_get sockets sample to enable association of secure
tags with certificate filenames.

This allows certificates and keys to be provisioned to the file
system on secure flash, without having to include the actual
certificates in the application.

Validated on the cc3220sf_launchxl board.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-11-23 09:16:21 -05:00
Anas Nashif 3d906dc4c1 net: coap: Move both CoAP implementations into one Kconfig
Two separate folders and Kconfig options causing confusion on
CoAP and CoAP_SOCK implementations. This patch simplifies it.
Current CoAP Kconfig option moved to COAP_NET_PKT.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-22 09:08:46 -05:00
Kumar Gala d3c5a4964b samples: wifi: Enable sample on disco_l475_iot1
The disco_l475_iot1 has the Inventek eS-WiFi, so lets enable the sample
on the board.  (This also gets us something that will build test the
eS-Wifi driver as part of sanitycheck).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-21 12:28:25 -05:00
Andrei Gansari f37ec3b0af samples: net: some samples min_flash = 140k
In order to prevent failing tests on i.MX RT the following samples were
limited to a minimum 140k of flash: http_client, http_server,
socket/echo_client and sockets/echo_server.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2018-11-20 09:54:25 -06:00
Anas Nashif 10970a60c0 sanitycheck: remove unused platforms keyword
This keyword had no effect and was being copied over to many samples
errornously.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-19 15:03:55 -05:00
Robert Lubos 1d4223ef3a samples: sockets: Set correct log module name in echo_server
echo_server used incorrect net_echo_client_* names for logger.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 11:40:39 -05:00
Robert Lubos 4d97d9f6be samples: mqtt: Switch MQTT Publisher to new MQTT implementation
Port MQTT Publisher sample to new socket MQTT API.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 09:31:01 -05:00
Robert Lubos f50aa6d3fb net: mqtt: Mark existing implementation as legacy
Rename existing headers and sybols to mqtt_legacy, to allow new
implementation to keep old config and header names.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 09:31:01 -05:00
Michael Scott b010cd763e samples: net: lwm2m_client: expand sanity testing
Let's expand the sanity build testing for the lwm2m_client by
doing the following:

- Add variant builds for DTLS, bluetooth and modem
- Check various combinations of hardware across each of these
  variant builds: frdm_k64f, nrf52_pca10040, nrf52840_pca10056,
  disco_l475_iot1

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-17 00:50:15 -05:00
Michael Scott 7f6fcf2198 dts-binding: modem: wnc-14a2a: remove base_label to fix build errors
When the WNC-14A2A modem binding was originally introduced, I thought
the base_label would shorten the define keeping the result short and
easily portable.  Turns out with the latest changes, it has a side
effect of removing the "DT_*" prefix which is breaking the build.

Let's remove "base_label" from the modem binding and adjust all of
the dts_fixups referring to the WNC14A2A defines.

NOTE: This commit moves the left-over WNC14A2A dts_fixup defines from
the nRF52 soc into samples/net/lwm2m_client as the new values.
They will stay there until the modem can be re-configured as a shield.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-17 00:50:15 -05:00
Michael Scott d80e6f24d4 samples: net: lwm2m_client: add "ok" and baud rate to k64f overlay
During the modem overlay move from the K64F board directory to the
LwM2M sample code, 2 DTS entries were dropped:
current-speed = <115200>;
status = "ok";

Without these entries the DTS defines for UART2 and CURRENT_SPEED
are missing from the generated_dts_board.h file.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-17 00:50:15 -05:00
Kumar Gala edefd7dc7d boards: nrf52840_pca10056: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the
nrf52840_pca10056 board and should be maintained and configured
outside of the board.

This needs to be moved to a shield, see #10965.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 16:31:35 -05:00
Kumar Gala 94bf29561e boards: nrf52840_mdk: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the nrf52840_mdk
board and should be maintained and configured outside of the board.

This needs to be moved to a shield, see #10965.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 16:31:35 -05:00
Robert Lubos f60b580710 samples: sockets: Configure correct number of FDs for echo_server
echo_server can use up to 6 sockets therefore it needs more file
descriptors than the maximum default value specified.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-15 10:02:49 -05:00
Kumar Gala 0324423de6 samples: wifi: winc1500: Don't assume all GPIO pins on same controller
Change the sample to use a different controller device name per pin.  We
shouldn't assume that on a given board that all the pins we are using
will be on the same GPIO controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-13 14:12:18 -05:00
Kumar Gala 9730ca1852 wifi: winc1500: Add Device Tree support
Add a dts binding for the Atmel WINC1500 WIFI chip.  Update the
quark_se_c1000_devboard to utilize this binding as well as the wifi
sample app.

We now get all the GPIOs related to the Atmel WINC1500 from the device
tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-13 14:12:18 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Andrzej Głąbek f39ba7230d dts_fixups: Update labels generated from DTS with DT_ prefix
All labels containing "_<8-hex-digits>_" or "16550_<3or6-hex-digits>_"
in their names, assumed to be generated by the extracting script,
are updated with the DT_ prefix, to reflect the recent changes made
to the script.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Jukka Rissanen 1a67e06f66 samples: net: promisc: Add simple shell to toggle promisc mode
Add a shell that implements "promisc [on | off] <interface>"
command to toggle promiscuous mode support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-13 12:53:44 +02:00
Krzysztof Chruscinski 97345dbb1b logging: Fix errors in log usage
Couple of findings which were revealed after changing
LOG_MODULE_REGISTER macro:
- missing semicolons after LOG_MODULE_REGISTER()
- missing LOG_LEVEL defines
- other

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Jukka Rissanen a8b742362e samples: net: echo-server: Introduce overlay file for e1000
The overlay-e1000.conf can be used for example with Qemu
which has support for e1000 ethernet driver.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-10 09:13:45 -05:00
Tomasz Bursztyka 79e24fe7f0 boards/x86: Removing cc1200 support on quark_se_c1000_devboard
This required wiring external daughter board by hand, it's not provided
by the board directly, let's remove this.

Applying the change on relevant samples.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-09 05:25:11 -06:00
Tomasz Bursztyka eae1ed8f2b samples/net: Removing support of cc2520 on frdm_k64f
There is an mcr20a shield board for frdm_k64f which is easier to use
than wiring a cc2520 by hand. So let's remove this.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-09 05:25:11 -06:00
Andrei Emeltchenko f22060cdbe usb: logs: Rename USB_INF to LOG_INF
Since logger is now suitable for our logs use it directly.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-08 08:35:20 -05:00
Andrei Emeltchenko 17f7abd3dc usb: logs: Rename USB_ERR to LOG_ERR
Since logger is now suitable for our logs use it directly.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-08 08:35:20 -05:00
Andrei Emeltchenko 92c7ab74c0 usb: logs: Rename USB_DBG to LOG_DBG
Since logger is now suitable for our logs use it directly.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-08 08:35:20 -05:00
Ravi kumar Veeramally a34d14b03c net: samples: Remove semaphore from sntp_client
Issue found using Coccinelle. Semaphore is not required at all
in this application.

Fixes #11150

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-07 14:34:52 +02:00
Jakub Rzeszutko 59c23b11ff shell: wildcard active by default
Wildcard plugin is active by default.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-11-06 17:12:41 -05:00
Krzysztof Chruscinski 4962618e5f shell: shell_uart: add ring_buffers and interrupt support
Improved RX path to use ring buffer for incoming data instead of single
byte buffer. Improved TX path to use ring buffer. Added support for
asynchronous UART API (interrupts).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-06 17:11:26 -05:00
Andrei Emeltchenko 5addb3a925 samples: net: Correct FRDM + CR20A configuration
Correct configuration for frdm_k64f + mcr20a shield.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-06 16:09:09 -05:00
Andrei Emeltchenko 94fc0e9cb0 samples: net: Add 802154 overlay configuration for reel_board
Add reel_board configuration.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-06 16:09:09 -05:00
Niranjhana N d158c07ddb samples: net: echo: fix unchecked returns
Before connecting, check for errors in
bind and listen calls in the echo test.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-11-06 13:18:20 +02:00
Jukka Rissanen 4f0d8b7680 samples: net: echo-server: ROM usage of quark_se_c1000_devboard
Tweak ROM usage of quark_se_c1000_devboard so that test_usbnet
test will pass. The board just disables network statistics as
that is not really needed here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-06 11:11:08 +02:00
Anas Nashif bb313d1e71 boards: frdm_k64f: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the frdm_k64f
board and should be maintained and configured outside of the board.

This needs to be moved to a shield, see #10965.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 12:07:30 -06:00
Jukka Rissanen d83ade773f samples: net: zperf: Remove task_profiler as it is not used
The task_profiler is not needed nor used by zperf so remove
it from CMakefile.

Fixes #11051

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-03 23:53:28 +02:00
Anas Nashif eea8e697d2 samples: echo_server: remove features to make binary fit
Remove net shell and stacks to make the binary fit on some platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-02 17:20:06 -04:00
Jukka Rissanen cf063fe85b net: Rename net_is_xxx...() functions to net_xxx_is...()
Unify the function naming for various network checking functions.

For example:
     net_is_ipv6_addr_loopback() -> net_ipv6_is_addr_loopback()
     net_is_my_ipv6_maddr() -> net_ipv6_is_my_maddr()
etc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-02 14:52:33 -04:00
Andrei Emeltchenko 6f045d1b9d net: samples: Refactor netusb configuration for http_server
Move configuration to overlay-netusb.sonf, enable zero-configuration,
working with LLMNR in Windows and avahi-autoipd in Linux.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-02 10:03:04 +02:00
Andrei Emeltchenko 9492abfe1d net: samples: Clean overlay-netusb.conf
Remove CONFIG_LOG which is defined in the main prj.conf

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-02 10:03:04 +02:00
Kumar Gala 856decf2f7 samples: Remove board.h include
Remove including board.h from samples that don't need it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Ravi kumar Veeramally 077408c860 samples: net: coap_server: Implemented over sockets
Sample application coap_server is implemented now over sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-10-31 19:44:25 -04:00
Ravi kumar Veeramally 2ab8f599ce samples: net: coap_client: Implemented over sockets
Sample application coap_client is implemented now over sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-10-31 19:44:25 -04:00
Loic Poulain 6c20180fa7 samples/net/wifi: Add TCP stack
Useful for testing tcp socket via net shell.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2018-10-29 16:38:02 +02:00
Reto Schneider 7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Gil Pitney 40bf45a81d samples: net: wifi: Fix README, to account for new shell regression
This updates documentation to account for the new shell which
does not support 'select' for command context anymore.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-25 20:47:06 +03:00
Gil Pitney 92f4837413 samples: net: wifi: Remove sleep K_FOREVER, which asserts.
The wifi shell sample asserts when trying to do a sleep
forever.

The sleep should not be necessary, so removing it.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-25 20:46:38 +03:00
Jukka Rissanen da699e4a3b samples: net: zperf: UDP download cmd params incorrectly checked
The "zperf udp download" optional port parameter was not properly
checked, the default port check branch was never reached.
Fix also the same issue in tcp download command.

Coverity-CID: 188881
Fixes #10758

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-23 14:23:24 +03:00
Jukka Rissanen 82fa5bcf59 drivers: eth: native_posix: Allow non-root access
Change the default behaviour of the host network interface
setup. Now user needs to execute net-setup.sh script from
net-tools project to setup host ethernet interface. The script
needs to be run as a root user. Then zephyr.exe can be started
as a normal user.

Example:
    cd net-tools
    sudo ./net-setup.sh

This will create zeth network interface and set IP address and
routes properly. See other command line options by typing
    ./net-setup.sh --help

Old behaviour is still there if one enables
    CONFIG_ETH_NATIVE_POSIX_STARTUP_AUTOMATIC=y

in which case one needs to use the command
    sudo --preserve-env zephyr.exe

to start the Zephyr process.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-23 11:08:39 +03:00
Jukka Rissanen fb73aee36f net: openthread: Remove remaining SYS_LOG usage
Remove the last SYS_LOG reference from OpenThread code as SYS_LOG is
being deprecated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-22 11:11:35 +03:00
Andrei Emeltchenko 6f6f0da589 wpanusb: Add registering logs
Add missing log register

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-19 16:21:34 -04:00
Andrei Emeltchenko 302d9c8ef4 wpanusb: Use USB_DBG instead of NET_DBG
Use USB_* log helpers for wpanusb

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-18 09:45:29 -04:00
Andy Ross 220d4f8347 sys_clock.h: Make "global variable" APIs into proper functions
The existing API defined sys_clock_{hw_cycles,ticks}_per_sec as simple
"variables" to be shared, except that they were only real storage in
certain modes (the HPET driver, basically) and everywhere else they
were a build constant.

Properly, these should be an API defined by the timer driver (who
controls those rates) and consumed by the clock subsystem.  So give
them function syntax as a stepping stone to get there.

Note that this also removes the deprecated variable
_sys_clock_us_per_tick rather than give it the same treatment.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-10-16 15:03:10 -04:00
Anas Nashif deaab90641 tests/samples: cleanup tags
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.

Avoid short abbriviations and using full names for fs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Jukka Rissanen a048a7719e samples: net: http_server: Remove Quark devboard from sanity
ROM consumption is higher with new shell which prevents
quark_se_c1000_devboard from building. Remove that board
from sanitychecker runs.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jukka Rissanen 7cd17d58ca samples: net: zperf: Convert to use the new shell
Use new shell instead of the legacy one. This commit also fixes
the configuration file mess and allows the program to be run on
more hardware.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jukka Rissanen 1d81fd8211 samples: net: wpanusb: Removing useless shell
There were no shell commands implemented so remove the shell
support from this sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jukka Rissanen a4a64453d6 samples: net: rpl_border_router: Convert to use new shell
Use new shell instead of the legacy one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jukka Rissanen d8defbd08a net: bt: Convert network Bluetooth shell to use new shell
Use new shell instead of the legacy one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Gil Pitney ca61459300 net: samples: sockets: http_get: build for cc3220sf_launchxl
Adds boards prj conf file, and updates CMakeLists.txt to
enable build.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-12 13:06:53 +03:00
Jukka Rissanen 2c69edc149 net: Remove obsolete config options from samples and tests
Removed obsolete CONFIG_SYS_LOG_* and CONFIG_NET_DEBUG_* options
from various sample and test applications.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-11 14:44:14 -04:00
Jukka Rissanen bdbf551e8a samples: net: coap_client: Remove obsolete prj_bt.conf file
The conf file contained obsolete config options and it was
not really used. Cleaned also the sample.yaml file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-11 14:44:14 -04:00
Gil Pitney ab09674e4c samples: net: include sockets echo sample build in cc3220sf sanitycheck
Previously, wifi-enabled samples were not built by sanitycheck for the
cc3220sf_launchxl.

This patch gets the sockets echo sample to build.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-11 15:51:57 +03:00
Gil Pitney c2cdbbafd7 net: sockets: Get socket offload to build after net logging overhaul.
Also, defines one LOG_MODULE_NAME for the simplelink WiFi driver, and
uses the same name for all files in this driver (module).

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-11 15:51:57 +03:00
Ulf Magnusson 92ef8582b9 Kconfig: Remove redundant $(ZEPHYR_BASE) from 'source's
The $srctree environment variable gives the path relative to which
'(o)source' statements work (the current directory is used if $srctree
is unset). It is set to $ZEPHYR_BASE in cmake/kconfig.cmake, so there's
no need to qualify the source of Kconfig.zephyr in sample Kconfig files
(or in external projects).

All 'source's in Zephyr assume that the Zephyr root directory is used as
the srctree as well, and would break otherwise.

Remove the $(ZEPHYR_BASE)s to make it clearer that all 'source'
statements work relative to the Zephyr root. There was some user
confusion on IRC.

Also explain how things work in the documentation.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-10-10 11:28:27 -05:00
Anas Nashif c1d2930471 drivers: wifi: move to new logger
Move drivers to new logger and change samples enabling logging in
prj.conf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 10:22:01 -04:00
Andrei Emeltchenko 1eb6a01723 usb: Use const for status_callback parameter
usb_dc_status_callback() parameters are interface or configuration
numbers and should be const.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-10 09:21:55 -04:00
Anas Nashif 88aa2ca49f driver: spi: use new logger
move SPI drivers to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Yannis Damigos d1a655a624 subsys/usb: Move to new logger subsystem
Move to new logger subsystem.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-10-08 12:54:57 -04:00
Andrei Emeltchenko c7567fe025 samples: zperf: Fix sanity check with NET, USB and logs
Decrease number of buffer for sanity check, in real sample logs
consuming a lot of memory might be traded for buffers. The sample was
failing for quark_se_c1000_devboard.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-08 12:54:57 -04:00
Yannis Damigos 1674d061b6 drivers: usb: device: Migrate to new logger
Move to new logger subsystem.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-10-08 12:54:57 -04:00
Jukka Rissanen d056d63ee7 samples: net: wifi: Adding sample.yaml file
As the sample.yaml file was missing, then sanitychecker did
not testing any wifi drivers or other wifi related APIs.

Fixes #10389

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-05 10:08:32 -04:00
Jukka Rissanen 69eeddd8a9 drivers: wifi: Convert to use new logging
Convert the wifi drivers to use the new logging system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-05 10:08:32 -04:00
Jukka Rissanen 57a8db7789 net: Use log_strdup() when printing debug strings
As the debugging print calls are async, all the strings that might
be overwritten must use log_strdup() which will create a copy
of the printable string.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen d67414e96c samples: net: syslog: Remove the sample application
The application won't work anymore as it uses the old syslog
logging and networking is now converted to use the new logger
so there is no need for this sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 7088d4e949 samples: net: lwm2m_client: Convert to new logging system
Use new logging system instead of SYS_LOG.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 5ad399e0d1 samples: net: leds_demo: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 61cc71e4c1 samples: net: echo-*: Add openthread tag for sanitychecker
Add "openthread" tag for sanitychecker when it is running
OpenThread specific tests. This way it is easier to run just
those few OpenThread specific tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen e5ab098ceb samples: net: wpanusb: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen b8f70b749b samples: net: wpan_serial: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen ef6eb3d628 samples: net: mqtt_publisher: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 5f2f8629d0 samples: net: rpl_node: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 5ead61089b samples: net: rpl_border_router: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 782655f89b samples: net: nats: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen e1f45c6733 samples: net: lldp: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen f5a3e77434 samples: net: sntp: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 22c8ccbca9 samples: net: zperf: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 77c9071495 samples: net: ws_echo_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 2883d92c5e samples: net: telnet: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen b08d420fad samples: net: stats: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 7b2bdfc491 samples: net: sockets: Convert to use new logging
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 9bae75dbd3 samples: net: ws_console: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 3565d7ff5b samples: net: vlan: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 96be19ae23 samples: net: traffic_class: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 0ccba6a14b samples: net: throughput_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 1bcf1cf475 samples: net: promiscuous: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen d38694af80 samples: net: mdns_responder: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen de5cbf9ed4 samples: net: irc_bot: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 31a6d93c41 samples: net: ipv4_autoconf: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 7218467055 samples: net: http_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen c69cdc0599 samples: net: http_client: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 749e957e62 samples: net: gptp: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen be7ea732e4 samples: net: eth_native_posix: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 85e7610fab samples: net: dns_resolve: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 2f0f88ebf1 samples: net: dhcpv4_client: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 11a019053d samples: net: coap_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen 5f238ac2ea samples: net: echo_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
David B. Kinder 432562dd19 doc: fix doc misspellings
Fix misspellings missed during regular reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-29 22:55:14 -04:00
Robert Lubos a6de97b3a4 samples: net: sockets: Update docs with TLS information
Update documentation of socket samples that support TLS with information
on how to enable it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-26 18:13:34 +03:00
Paul Sokolovsky e4fa2f5db7 samples: sockets: echo_client/server: Build for minimal libc
With recent changes, sockets no longer depend on Newlib libc, so
let's have actual samples which demonstrate this. echo_client/
echo_server, which were ported from net_app samples, are converted.
The rest of socket samples are intended to be buildable on a
POSIX system (e.g. Linux), so they rather stay with more
full-fledged libc.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-09-26 18:11:24 +03:00
Robert Lubos b4d856397e samples: net: sockets: Use TLS overlay config file
Unify method of enabling secure TLS sockets in samples by using TLS
overlay config file instead of standalone config files.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-25 15:20:58 +03:00
Robert Lubos 743e64992b samples: net: sockets: Put echo samples configuration into single file
Avoid having not-necessarily board specific configs in a separate file.
Instead, have a single project file with appropriate overlay configs.
Board specific configurations can be added in future if needed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-25 15:20:58 +03:00
Sebastian Bøe 72e7bfa680 cmake: Remove unnecessary KCONFIG_ROOT configuration
It is no longer necessary to set the KCONFIG_ROOT variable when the
KConfig file is in the application root directory.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-21 13:37:21 -04:00
Jukka Rissanen 27d99d16f8 samples: net: sockets: echo_server: Add VLAN support
If user enables VLAN support, then the sample application will
create two extra VLAN network interfaces for testing purposes.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen b17b1609ec samples: net: sockets: echo-client: Add VLAN support
Add support for VLANs which are disabled by default.
The application can be configured to use the VLANs by setting
the IP addresses properly in config file. The VLAN support in
this sample application is only meant for testing multiple network
interface handling.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen b9fa6d4b22 samples: net: echo-client: Add VLAN support
Add support for VLANs which are disabled by default.
The application can be configured to use the VLANs by setting
the IP addresses properly in config file. The VLAN support in
this sample application is only meant for testing multiple network
interface handling.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen 3d83601661 samples: net: echo_server: Add VLAN support
If user enables VLAN support, then the sample application will
create two extra VLAN network interfaces for testing purposes.

The application can be compiled like this for VLAN support:

  cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Krzysztof Chruscinski 527256501f shell: Rename shell to legacy_shell
New shell implementation is on the way. For now old one and all
references are kept to be gradually replaced by new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Ulf Magnusson d713033d5c Kconfig: Use new preprocessor syntax for env. variables
With the new Kconfig preprocessor (described in
https://github.com/torvalds/linux/blob/master/Documentation/kbuild/
kconfig-macro-language.txt), the syntax for expanding environment
variables is $(FOO) rather than $FOO.

$(FOO) is a general preprocessor variable expansion, which falls back to
environment variables if the variable isn't set (like in Make). It can
also be used in prompts, 'comment's, etc.

The old syntax will probably be supported forever in Kconfiglib for
backwards compatibility, but might as well make it consistent now that
people might start using the preprocessor more.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 19:17:25 -04:00
Gil Pitney 844e6f5a2e samples: net: sockets: echo: enable socket offload for cc3220sf_launchxl
Add a prj conf file for the TI cc3220sf_launchxl board
to enable socket offload to the simplelink WiFi driver.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-09-11 18:42:34 +03:00
Andrei Emeltchenko e02dcf2545 samples: lldp: Add simple parsing to sample
Add simple parsing using LLDP RX API

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-09-11 10:55:01 +03:00
Jukka Rissanen c4cc8a5f3e net: if: Refactor IPv6 address lifetime timer
Refactor IPv6 address lifetime timer setting in net_if_addr to support
longer lifetime than 24 days.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-11 10:53:30 +03:00
Ravi kumar Veeramally 42c19497b6 samples: net: coap: Remove apps using raw mbedtls APIs
This removes these network sample applications
  samples/net/coaps_client
  samples/net/coaps_server

as they are using low level mbedtls APIs. You should use
preferably socket based or net-app based applications.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-09-04 16:17:37 -04:00
Ravi kumar Veeramally 9c605c1711 samples: net: Fix out-of-bound access
Payload variable can hold max 64 bytes but value of size can be more
than that. Memsetting using value of size can overrun payload array.
Fixes coverity issue.

Coverity-CID: 187823
Fixes: #9638

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-09-04 08:10:18 -04:00
Jukka Rissanen 385345218d samples: net: mbedtls: Remove apps using raw mbedtls APIs
This removes these network sample applications

  samples/net/mbedtls_sslclient
  samples/net/mbedtls_dtlsserver
  samples/net/mbedtls_dtlsclient

as they are using low level mbedtls APIs. You should use
preferably the samples/net/sockets/echo_[server|client] applications
instead, or as a last option use net-app based applications
in samples/net/echo_[server|client] if needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-30 14:27:33 -04:00
David B. Kinder 1d1a4b321b doc: fix misspellings in reST files
Fix misspellings missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-28 13:59:38 -04:00
Michael Scott 3b80998ff2 net: lwm2m: correct Copyright to Foundries.io
Due to a change in the company name, the LwM2M copyrights need
to be changed from "Open Source Foundries Limited" ->
"Foundries.io".

Signed-off-by: Michael Scott <mike@foundries.io>
2018-08-27 19:29:16 -04:00
Gil Pitney a4cc88ad30 samples: net: sockets: echo-client: fix sock fd test, allow zero.
Per: http://pubs.opengroup.org/onlinepubs/009695399/functions/socket.html
"Upon successful completion, socket() shall return a non-negative
integer, the socket file descriptor."

The test in prepare_fds() however fails if socket fd is
zero (non-negative), which should be a valid value.

This was found while testing the SimpleLink socket offload driver,
which can return a zero-valued socket fd, per the POSIX spec.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-08-22 15:37:15 -07:00
Anas Nashif a2248782a2 kernel: event_logger: remove kernel_event_logger
Move to more generic tracing hooks that can be implemented in different
ways and do not interfere with the kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Ulf Magnusson bd01344aa0 samples/net/lldp/Kconfig: Get rid of leftover 'option env'
'option env' is no longer required. Kconfiglib expands references to
environment variables directly.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-18 07:54:20 -07:00
Robert Lubos d529aef9f2 net: tls: Apply DTLS review fixes
This commit contains several fixes for DTLS implementation, proposed in
a post-merge review of #9338.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-08-17 15:10:00 +03:00
Jukka Rissanen eeabc2ba3d net: if: Lower ram usage for IP address lifetime handling
Instead of having one delayed_work struct / IP address, use
only one delayed_work struct for lifetime timer. This saves
over 20 bytes / allocated address struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-17 13:36:59 +03:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Jukka Rissanen 38323783f0 samples: net: echo-server: Handle net_buf out-of-mem gracefully
Do not wait forever for network buffers when receiving data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-14 12:17:00 +03:00
Jukka Rissanen b8b230f2e8 samples: net: echo-client: Handle net_buf out-of-mem gracefully
Do not wait forever for network buffers when receiving data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-14 12:17:00 +03:00
Paul Sokolovsky 028aae1ec9 net: config: Rename Kconfig options to correspond to library name
This finishes refactor of splitting off net_config library name from
net_app library, started in c60df1311, c89a06dbc. This commit makes
sure that Kconfig options are prefixed with CONFIG_NET_CONFIG_
instead of CONFIG_NET_APP_, and propagates these changes thru the
app configs in the tree.

Also, minor dependency, etc. tweaks are made.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-13 18:42:31 -07:00
Robert Lubos b7c254fc40 samples: net: Add DTLS support to socket echo_client/echo_server
Add DTLS support to socket echo_client and echo_server samples.

Additionally, move TLS-related configs to overlay-tls.conf config file,
to align with other examples.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-08-13 15:24:34 +03:00
Ulf Magnusson a8aba2f8d0 Kconfig: Include Kconfig.zephyr last in sample Kconfig files
This will make adding properties to symbols in the base Zephyr Kconfig
files work the same as before.

I didn't actually spot any such cases, so this is just to play it safe.
It also makes the sample Kconfig symbols appear at the top in the
menuconfig interface, which might be nice.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-10 12:38:28 -07:00
Ulf Magnusson 3ed9328d33 Kconfig: Get rid of some leftover 'option env's
These are no longer required. Kconfiglib expands references to
environment variables directly.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-10 12:38:28 -07:00
David B. Kinder 2300a5929f doc: fix errors in ipv4_autoconf sample doc
Some reST syntax errors and doc edits got missed during the review
of PR #561 causing problems in the generated HTML.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-09 09:53:15 +03:00
Jukka Rissanen c162bad3af samples: net: lldp: Sample application that enables LLDP support
The application does nothing useful, it just enables Link Layer
Discovery Protocol support which starts to send LLDP network packets
to ethernet network interface. Note that the LLDP packets are only
sent to those network interfaces that claim to support LLDP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-08 09:53:24 +03:00
David B. Kinder 6750b8d2e8 doc: fix misspellings in docs
Occasional scan for misspellings missed during normal doc reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-08 01:49:14 -05:00
Michael Scott 0b0122571c samples: net: lwm2m: cleanup prj.conf
- Remove NET_LOG / NET_BUF_LOG settings, instead just enable SYS_LOG
- Simplify by also removing SYS_LOG_SHOW_COLOR, INIT_STACKS and
  NET_STATISTICS.  These can be enabled by user if wanted/needed.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-08-07 14:41:48 +03:00
Jukka Rissanen b4e36133c2 drivers: eth: native_posix: Exec program after creating zeth
Allow user to configure a program that is executed after the
network interface is created and IP address is setup.
This can be used e.g., to start wireshark to capture
the network traffic of the interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-06 14:20:51 +03:00
Ravi kumar Veeramally 3e27187e00 samples: net: coaps_client: Increase IPv6 mcast table size
Default value 2 was not enough for mcast addresses table.
Core stack adding mcast addresses on various reasons. Also
coaps_client trying to create mcast context for some purpose.
mcast address is not in lookup table, so binding fails. Add
CoAP sample related mcast address to table and then bind the
context.

Fixes #9131

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-08-06 12:42:57 +03:00
Michael Scott 926c341c78 samples: net: lwm2m: add wnc-m14a2a overlay .conf file
Let's add an overlay file to enable using the WNC-M14A2A LTE-M
modem with the LwM2M client.

Also, update documentation for it's use.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-08-06 10:43:46 +03:00
Jukka Rissanen fd1fec8ad6 samples: net: IPv4 autoconf sample application
Adding IPv4 autoconf sample application that can be used to
test IPv4 autoconf functionality.

Signed-off-by: Matthias Boesl <matthias.boesl@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-31 16:34:28 +03:00
Johan Hedberg c761002e30 samples: net/mqtt_publisher: Explicitly disable BT_TINYCRYPT_ECC
This app will not fit in the 96b_nitrogen board with ECC enabled.
"real-ld: region `SRAM' overflowed by 68 bytes". Disable the feature
explicitly since a subsequent patch will auto-enable it for all
combined Bluetooth Host-Controller builds.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-31 13:55:40 +03:00
Robert Lubos 9f817c8c1c samples: net: Allow to register more adresses for OpenThread
Thread registers multiple unicast and multicast adresses by default. As
they are exchanged with Zephyr interface, we need enough buffers to
store them all.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-31 11:13:04 +03:00
Anas Nashif 87de383c66 tests: CONFIG_ARC_INIT is n by default
CONFIG_ARC_INIT is set to 'n' by default, no need to set this in the
prj.conf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-30 15:17:51 -04:00
Jukka Rissanen 9834b551c9 samples: net: gptp: Add support for Atmel SAM E70 Xplained board
Enable PTP clock for GMAC driver if compiled for SAM E70 board.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-27 20:29:15 +03:00
Robert Lubos 29b65859b1 net: samples: Add TLS support to socket echo_client/echo_server
This commit adds TLS support to socket echo_client/echo_server samples.

Credentials used are the same as in the non-socket versions of these
samples, therefore they can be easily tested with net-tools utils.

Maximum payload size for the client was sligtly reduced to fit the
encrypted data within 1280 bytes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-26 12:13:15 -04:00
Robert Lubos 50631b3501 net: samples: Add CA certificates to http_get and big_http_download
Add CA certificates to http_get and big_http_download samples. Use
socket options to configure TLS connection - TLS certificates are now
validated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-26 12:13:15 -04:00
Jukka Rissanen a1594472f2 samples: net: echo-client: Add overlay config support
Refactor the prj*conf files so that there is only one master
prj.conf and several overlay conf files that add / change
only minor subset of functionality.

Use the overlay files like so:
    cmake -DBOARD=nrf52840_pca10056 \
          -DOVERLAY_CONFIG=overlay-ot.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-25 12:42:36 +03:00
Robert Lubos 6c30f5955e samples: net: Fix incorrect error check in echo_server
The logic for error checking after net_pkt_pull was inverted -
build_pkt_reply would exit in case net_pkt_pull succeeded. In result no
responses were sent by echo_server.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-24 17:26:54 +03:00
Jukka Rissanen af34779510 samples: net: tp: Avoid compiler warning
If -fno-strict-overflow compiler flag is disabled, then this warning
is printed:

samples/net/throughput_server/src/server.c:157:6: \
  error: assuming signed overflow does not occur when assuming \
  that (X + c) >= X is always true [-Werror=strict-overflow]
     if (new_print > curr) {

Fixes #8924

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-24 09:20:46 -04:00
Jukka Rissanen c5095797b9 samples: net: Add promiscuous mode application
Simple application that sets all the network interfaces into
promiscuous mode.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-24 15:12:37 +03:00
Jukka Rissanen 72f75e52e1 samples: net: echo-server: Add overlay config support
Refactor the prj*conf files so that there is only one master
prj.conf and several overlay conf files that add / change
only minor subset of functionality.

Use the overlay files like so:
    cmake -DBOARD=nrf52840_pca10056 \
          -DOVERLAY_CONFIG=overlay-ot.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-24 15:11:09 +03:00
Ravi kumar Veeramally 2807e5c1c6 samples: net: echo_server: Fix building of echo replies
If echo-server receives a IPv6 packet with large header (e.g HBHO)
build_reply_pkt() function failed to remove IPv6 header. Reason is
net_buf_pull() doesn't work if header length is more than one
fragment. net_pkt_pull() solves the issue.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-07-23 15:01:09 +03:00
Subramanian Meenakshi Sundaram 7479cc2ee8 samples: net: Fix incorrect use of ipv4 in ipv6 branch
Fixing copy paste error, where ipv4 member of
the structure is used in ipv6 branch.

CID: 187074
Fixes Issue #8992

Signed-off-by: Subramanian Meenakshi Sundaram <subbu147@gmail.com>
2018-07-20 12:06:11 +03:00
Piotr Zięcik 2fe998cdef kernel: Deprecate sys_clock_us_per_tick variable.
On some architectures tick time cannot be expressed as integer
number of microseconds, introducing error in calculations using
sys_clock_us_per_tick variable.

This commit deprecates the sys_clock_us_per_tick variable and
replaces its usage by more precise calculations based on
sys_clock_hw_cycles_per_sec and sys_clock_ticks_per_sec.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-07-20 00:03:52 -04:00
Robert Lubos 7b8b09bde4 samples: net: Explicitly ignore socket close return value
Fixes #8994

Coverity ID :187072

Explicitly ignore return value of socket close.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-18 19:51:17 +03:00
Anas Nashif 4208642a53 samples: fix u32_t type usage
We have been mixing u32_t and uint32_t. Using u32_t when the API expects
something else.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-18 12:32:23 -04:00
Andrei Emeltchenko 29a757a814 samples: wpanusb: Remove old dead code
Remove old unused code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-18 08:23:00 -04:00
Jukka Rissanen e30c3096b2 samples: net: gptp: Add support for FRDM-K64F board
Enable PTP clock for MCUX driver if compiled for FRDM-K64F board.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-18 07:37:41 -04:00
Michael Scott 8fe9f5b4f8 samples: net: wpanusb: fix sanitycheck
With the change to the configuration files, we can now compile
this sample for any platform that uses only the default prj.conf file:
nrf52840_pca10056
nrf52840_pca10059
usb_kw24d512

Update the sample.yaml file to remove the excludes.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Michael Scott 7df65c15d6 samples: usb: wpanusb: update README to rst format
Let's rename README to README.rst and add:
- Some nice formatting for existing content
- Requirements section (including handy links)
- Build and Running section (including multiple overlay options)

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Michael Scott 15d46ddb87 samples: usb: wpanusb: add MCR20A overlay config
Add support for NXP MCR20A 802.15.4 module as an overlay config file.

Use this file like so:
cmake -DBOARD=usb_kw24d512 \
      -DOVERLAY_CONFIG=overlay-mcr20a.conf ..

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Michael Scott bfcc1cfb87 samples: net: wpanusb: add TI CC1200 overlay config
Add support for TI CC1200 802.15.4 module as an overlay config file.

Use this file like so:
cmake -DBOARD=quark_se_c1000_devboard \
      -DOVERLAY_CONFIG=overlay-cc1200.conf ..

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Michael Scott 38590a9a4c samples: net: wpanusb: split cc2520 settings from prj.conf
When the CC2520-specific configs are removed from the prj.conf
file, the sample can be built for hardware that supports
802.15.4 natively w/o any changes to the prj.conf like so:
cmake -DBOARD=nrf52840_pca10056 ..
cmake -DBOARD=usb_kw24d512 ..

The CC2520-specific settings now live in overlay-cc2520.conf
which can be used like so when building for devices that can
use it:
cmake -DBOARD=quark_se_c1000_devboard \
  -DOVERLAY_CONFIG=overlay-cc2520.conf ..

Later, support for other optional HW like CC1200 and MCR20A
can be added in a similar way.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Anas Nashif c8b114f25d samples: exclude socket samples on esp32
ESP32 does not like newlib, exclude for now to get a clean sanitycheck
run. We have issues about this already.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-16 19:00:32 -04:00
Robert Lubos f25baebf27 net: samples: Add TLS support to http_get and big_http_download samples
Add config file that enables to run http_get and big_http_download
samples with TLS enabled and receive the data through HTTPS.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-13 15:03:45 -04:00
Kumar Gala cfd5c9b43d samples: nats: Fix warning when building with newlib
If we use newlib the isdigit (and other similar functions) return an
error as char can possibly be viewed as signed:

usr/include/ctype.h:57:54: error: array subscript has type ‘char’ [-Werror=char-subscripts]
 #define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])

Explicity cast to unsigned char so we deal with both this warning and
possible warning when -Wpointer-sign is enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-13 09:42:14 -05:00
Robert Lubos 13b160b0f5 samples: net: Make echo_client/echo_server use generic mbedTLS config
Use the new, default mbedTLS config file in TLS configuration of
echo_client and echo_server.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-13 10:56:40 +02:00
Robert Lubos ff0950a940 samples: net: Fix echo_client/echo_server TLS config files
Current config files for TLS qemu_x86 contain unrecognized
`CONFIG_RAM_SIZE`, which causes cmake to fail during project generation.
They  should not be needed anyway, as qemu_x86 defaults to 8 MB of RAM.
Additionaly, echo_client crashes in this configuration with default main
stack size, hence increase it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-11 15:44:46 +03:00
Jukka Rissanen 0068151280 samples: net: gptp: Documentation fixes
Clarify the gPTP sample application documentation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-06 19:19:26 -04:00
Jukka Rissanen 16f31f1d3c drivers: eth: native_posix: Enable gPTP support
Allow gPTP code to be run as a linux process and communicate
with gPTP daemon running in linux host.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-05 12:53:37 +03:00
Jukka Rissanen ad150569b6 samples: net: gptp: Allow running gPTP over VLAN
By default gPTP is not run over VLAN but if needed that can be
done by setting CONFIG_NET_GPTP_VLAN and CONFIG_NET_GPTP_VLAN_TAG
options.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-03 20:26:31 +03:00
Jukka Rissanen e9228a3964 net: gptp: Allow gPTP to run over VLAN
Allow this setup as Linux supports this too.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-03 20:26:31 +03:00
Jukka Rissanen f8c6894f15 samples: net: dns: Cross reference mDNS config option
Set CONFIG_MDNS_RESOLVER to get a cross reference to the config
option documentation

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Jukka Rissanen b833d010eb net: llmnr: Add LLMNR responder support
This allows zephyr to listen LLMNR DNS queries sent by Windows
and respond to them. See RFC 4795 for details.

The feature requires that hostname is set properly to the
zephyr device and LLMNR is configured properly.

Typically following config options are enough for this support:

CONFIG_NET_HOSTNAME_ENABLE=y
CONFIG_NET_HOSTNAME="zephyr-device"
CONFIG_DNS_RESOLVER=y
CONFIG_LLMNR_RESPONDER=y

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Jukka Rissanen f47151513c samples: net: dns: Add LLMNR client support to DNS resolver
By default the LLMNR is disabled in this sample. You can enable
it by setting CONFIG_LLMNR_RESOLVER=y

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Jukka Rissanen 67b4c5d5d4 samples: net: gptp: Sample application for gPTP support
The application does not do much, it just registers to a callback
in order to get information about gPTP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-28 16:50:50 +03:00
Robert Lubos b813502077 samples: net: Socket based echo_server
Echo server sample running on top of network sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-06-28 15:18:42 +03:00
Robert Lubos f01b81731b samples: net: Socket based echo_client
Echo client sample running on top of network sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-06-28 15:18:42 +03:00
Sebastian Bøe 2bcfb88aed cmake: Remove duplicate invocations of target_link_libraries on app
It is not necessary to link 'app' with mbedTLS because mbedTLS is
covered by the 'APP_LINK_WITH_MBEDTLS' mechanism that automatically
links 'app' with mbedTLS.

This patch removes the redundant target_link_libraries invocations.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-26 15:53:32 +02:00
Satya Bhattacharya af70e8f7f0 samples: net: Check the return value of close()
Check the return value of close() in socket_dumb_http.c
If non-zero, print the error code

Fixes #8413.

Signed-off-by: Satya Bhattacharya <satyacube@gmail.com>
2018-06-18 10:47:24 +03:00
Gil Pitney 984657022f samples: net: wifi: Add a cc3220sf_launchxl conf file
This enables testing of the scan, connect, and disconnect
wifi_mgmt functions of the wifi shell module for
the cc3220sf_launchxl.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-06-15 10:01:21 -04:00
Jukka Rissanen 416614e26a samples: net: echo-client: Increase buf count for frdm-k64f
Increasing the network buffer count for frdm-k64f so that the
device will not run out of memory so easily.

Fixes #7678

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-11 20:16:37 -04:00
Leandro Pereira fb4227bd97 samples: mbedtls_sslclient: Use entropy driver to kickstart RNG
If an entropy driver is available during build, use it to gather
entropy rather than relying on sys_rand32_get(), which provides no
guarantees that the provided numbers will be good enough from an
encryption standpoint.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-11 17:43:04 -04:00
Robert Lubos 30c4aae948 net: samples: increase main stack size for echo_client
Default stack size was too small for main thread in qemu_x86
configuration and resulted in stack overflow during initialization.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-06-11 17:33:17 -04:00
Paul Sokolovsky 59309c1a2d samples: sockets: dumb_http_server: Use consistent logging settings
Use logging settings consistent with other samples/net/sockets/ apps
(which includes error logging enabled by default).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-11 17:24:54 -04:00
Leandro Pereira 7cfd5a4184 samples: net: hrpl_border_router: Fix NULL pointer dereference
Null-checking `pkt` before making a call to net_pkt_unref() suggests
that it might be NULL, but the pointer is dereferenced before it's
checked.  Perform the check at the beginning of the function and
dereference and drop its reference unconditionally afterwards.

Coverity-ID: 178789
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-08 13:07:19 -05:00
Leandro Pereira b7ad50b473 samples: net: rpl_border_router: Fix out-of-bounds write
While printing debugging information, an out of bounds write could
happen while trying to write out the NUL byte in the url array.

Coverity-ID: 178790
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-08 13:07:19 -05:00
Leandro Pereira e7a3d01dc5 samples: net: dumb_http_server: Handle recv() errors
The recv() call can return errors, so handle them before reading the
received byte.  Unrecoverable errors will just trigger the client
socket to be closed as usual.

Coverity-ID: 182778
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-08 13:07:19 -05:00
Satya Bhattacharya fd561dd596 samples: net: Check the return value of nats_publish
Check and handle the return value of nats_publish() in main.c

Fixes #6258.

Signed-off-by: Satya Bhattacharya <satyacube@gmail.com>
2018-06-06 16:06:39 -05:00
Paul Sokolovsky 659c241e3a samples: net: big_http_download: Ignore close() return value.
We aren't interested in doing error handling for close(), close()
is itself on error handling path, and its purpose if to free
socket resources.

Coverity-CID: 186062
Fixes: #7713

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-29 16:23:46 -04:00
Ulf Magnusson 5405f68878 kconfig: Remove remaining 'option env' bounce symbols
These are no longer needed since commit 4dc9e5b2de ("kconfig: Get rid
of 'option env' bounce symbols"). The C tools are likely to get rid of
them soon too.

The APPLICATION_BASE symbol (option env="PROJECT_BASE") triggered a
compatibility warning, because 'option env' symbols now need to have the
same name as the environment variables they reference to be compatible
with Kconfiglib. APPLICATION_BASE is unused, so just remove it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-28 17:21:11 -04:00
Andrei Emeltchenko ee4a417586 samples: echo_server: Remove conflicting option from conf file
Remove conflicting option CONFIG_NET_IPV6 since it got selected due to
CONFIG_NET_APP_NEED_IPV6 in netusb configuration file.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-05-26 08:27:16 -04:00
Ulf Magnusson 544f827173 samples: mbedTLS server: Remove CONFIG_NET_SLIP_TAP assignment
Was written as "CONFIG_NET_SLIP", which doesn't exist.

Jukka Rissanen indicated in
https://github.com/zephyrproject-rtos/zephyr/pull/7810 that
CONFIG_NET_SLIP_TAP doesn't need to be enabled here ("I prefer we remove
the line completely as the TAP is enabled automatically for qemu_x86"),
so remove the assignment rather than fixing it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 17:21:31 -04:00
Ulf Magnusson 2facf33f28 net: ieee802154: Remove old cc2520 AUTO_ACK assignments
CONFIG_IEEE802154_CC2520_AUTO_ACK started out as
CONFIG_TI_CC2520_AUTO_ACK, which was removed in commit 6b43821f20
("net: Remove legacy Contiki based uIP stack"). The assignments were
later renamed in commit 573774a9bf ("drivers/net/ieee802154: Change
configuration prefix").

Remove them.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:20:37 -04:00
Kumar Gala 8e41572774 drivers: spi: remove dead references to CONFIG_SPI_QMSI{_SS}
During the spi rework we removed the qmsi spi drivers so we no longer
have Kconfig symbols or drivers related to CONFIG_SPI_QMSI{_SS}.  There
are a few references still around that we should remove

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 21:09:32 -04:00
Jukka Rissanen 2dbde4a1fa samples: net: zperf: Remove config files for Galileo board
The support for Galileo board is bitrotted as the config file
contains obsolete values. As testing this old board is difficult
lets remove the config files. These can be re-introduced with
proper and tested settings if needed.

Fixes #7814

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-24 08:02:04 -04:00
Kumar Gala 91d80445f9 samples: net: zperf: Remove dead Kconfig symbol from galileo conf
CONFIG_DEBUG_IP_BUFS was commented out but specified in galileo
specific conf files.  The Kconfig symbol doesn't exist so lets remove
it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-23 17:57:06 -04:00
Kumar Gala 7bb6eb62f2 samples: wifi: remove dead Kconfig symbol
CONFIG_SPI_LEGACY_API symbols has been removed so don't try to set it in
a conf file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-23 17:57:06 -04:00
Ulf Magnusson 1a7ae583af samples: net: mqtt: Remove CONFIG_BT_MAX_CMD_LEN assignment
This symbol started out as CONFIG_BLUETOOTH_MAX_CMD_LEN, which was
removed in commit 50678b03cb ("Bluetooth: Reuse HCI command buffers
for the command response").

The non-existing symbol in the assignment was then renamed to
CONFIG_BT_MAX_CMD_LEN by commit 2975ca0754 ("Bluetooth: Kconfig:
Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*").

Remove the assignment.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-23 13:10:26 -04:00
Jukka Rissanen e7468fb583 samples: net: Fix VLAN tag name in prj.conf file
The prj.conf file was using wrong VLAN tag option names.
The correct names are CONFIG_SAMPLE_VLAN_TAG and
CONFIG_SAMPLE_VLAN_TAG_2 as defined in Kconfig file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-23 12:47:49 -04:00
Ulf Magnusson 4a54005e7b samples: net: Remove undefined references to CONFIG_NET_LOG_ENABLED
Maybe CONFIG_NET_LOG=y was intended, but both files already set it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-23 12:10:38 -04:00
Ravi kumar Veeramally d5df64722b samples: net: rpl_br: Fix coverity issues
Fixes: #7717
Fixes: #7720
Fixes: #7730

Coverity-CID: 186041
Coverity-CID: 186053
Coverity-CID: 186057

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-22 09:54:11 -04:00
Ravi kumar Veeramally 2c305d2cc5 samples: net: Remove unwanted code from coap-server
Probably left over from old ZOAP library. Stripping of headers
not required now.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-22 08:54:54 -04:00
Ravi kumar Veeramally 55680f884a samples: net: Fix coap-client sample
Removed unwanted code, fine tuned a bit. Original use case of
sample (verify CoAP GET, PUT and POST methods) against coap-server
not changed.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-22 08:54:54 -04:00
Ravi kumar Veeramally ac3c6ba990 samples: net: Fix coap-server sample
If client removes observer then it reply with RESET message for
further observer notifications. That means coap-server should stop
sending further notifications to the client.

Current sample unref the packet as soon as it finds pending message
and doesn't bother about message type.

Fixes: #6534

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-22 08:54:54 -04:00
Paul Sokolovsky 0b76b12837 samples: sockets: big_http_download: Update for DHCPv4 support.
Enable CONFIG_NET_DHCPV4, while keeping static IP configuration,
which allows the app to work both with static IP (e.g. when
connected to a workstation without DHCP server) and with DHCP (e.g.
when connected to a router). When using DHCP, getting an address
may take some time, during which getaddrinfo() may fail due to a
timeout. So, add retries for this call.

Tested with qemu_x86 (non-DHCP) and frdm_k64f (both DHCP and
non-DHCP).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-18 13:03:44 +03:00
Ravi kumar Veeramally 26ebb918f7 samples: net: rpl: Add observer support to node application
If coap-client(e.g. RPL BR) wants to get notifications from
coap-server(RPL-node) about parent status, client has to register
observer for notifications.

RPL node application modified to toggle the LED. Do not maintain any
ON/OFF states. Also removed Sparrow (contiki border router) related
patch.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-17 16:25:49 +03:00
Ravi kumar Veeramally 2ef5044277 samples: net: rpl: Enhance RPL border router application
Add CoAP client to RPL BR application. Which can be used to
control leds and get rpl related information from leaf nodes
though CoAP messages. Build toplogy matrics and send it to
Web UI.

Enhanced Web UI components (Interfaces, RPL, Neighbors, Routes
and Topology tabs). Added buttons to control leds on lead nodes.

Added JSON support to handle led on/off requests from UI.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-17 16:25:49 +03:00
Jukka Rissanen 08795cf27d samples: net: rpl: Simple RPL border router application
This is a very simple RPL border router sample application.
It provides HTTP(S) and net-shell interface for getting admin
information about neighbors and routes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-17 16:25:49 +03:00
Tomasz Bursztyka 49bd1e9c6f ieee802154: Add support for filtering source short/ieee addresses
L2 could take advantage of such hardware capability, when supported by
the device. This is also required for OpenThread.

Fixes #5714

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-17 16:18:53 +03:00
Johann Fischer 36eb4dd021 tests: samples: exclude usb_kw24d512 from wpanusb sample
Exclude usb_kw24d512 from wpanusb sample until the the sample
has been reworked and is more generic.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-05-17 07:00:49 -05:00
Tomasz Bursztyka 554999d320 samples/net: Add a simple sample to run wifi shell module
Enabling relevant hardware, currently only winc1500 on
quark_se_c1000_devboard. But it could be easily extended to other
drivers/boards.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-17 10:46:26 +03:00
Anas Nashif ddc30c8e40 samples: leds_demo: depend on netif and gpio
Do not build on unrelated hardware.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-16 23:10:30 +03:00
Ravi kumar Veeramally 6cadd380b7 samples: net: Fix echo_server reply packet preparation
If the incoming packet fragments doesn't have any link layer
header then build_reply_pkt() will set reply packet fragment's link
layer header space to zero. Which is causing issue in case of IPv4.
ARP layer is trying to fill Ethernet headers, but fragments
ll header length is set to zero.

Just use net_pkt_copy_all() to copy payload. That should be enough.

Fixes #6564

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-16 16:40:27 +03:00
Paul Sokolovsky 092f716020 samples: sockets: dumb_http_server: Disable TIME_WAIT delay
This is required to test the server with ab (ApacheBench), which
itself is an important integration test for the IP stack.

Fixes: #7377

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-16 11:03:49 +03:00
Michael Scott 1290139626 net: lwm2m: mark OPTIONAL resources for LwM2M Device
Using OMA Technical Specification LwM2M Enabler 1.0.2 dated
Feb. 9, 2018, let's mark the OPTIONAL resources for an LwM2M
Device object (Section E.4 "LwM2M Object: Device")

As a result, the Device object no longer configures the default
buffers for data storage of several optional resources.
The LwM2M client sample is also changed to to setup these read-only
buffers instead.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-05-16 10:56:07 +03:00
Paul Sokolovsky b56b1436ed samples: sockets: Make more errors fatal
In samples, using CHECK() helper macro, make it exist in case of
error. This makes sure that negative value (error indicator) can't
be passed as argument to other function and fixes Coverity reports.

Coverity-CID: 183062
Fixes: #6101

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-15 18:14:07 +03:00
Paul Sokolovsky 16a8a309a3 samples: sockets: dumb_http_server: Improve error handling
Check socket function return codes to address Coverity issues.

Coverity-CID: 182771
Fixes: #6100

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-15 17:21:08 +03:00
Jukka Rissanen d257b946e3 samples: net: mbedtls_sslclient: Fix prj.conf file
The application started to send data before it had any IP
address configured. This prevents communication to the server.

Fixes #7502

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-15 17:11:56 +03:00
Michael Scott 677262e9f6 samples: net: lwm2m: adjust BT RX buffer count /sizes for BT
Due to higher traffic demands when using 6lowpan, we should raise
the default BT RX buffer counts and sizes.

This avoids the following error on some HW:
[net/buf] [WRN] net_buf_alloc_len_debug: bt_buf_get_rx():4985:
Pool 0x20009424 low on buffers.
[net/buf] [WRN] net_buf_alloc_len_debug: bt_buf_get_rx():4985:
Pool 0x20009424 blocked for 0 secs

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-05-15 10:16:08 +02:00
Jukka Rissanen 3df9201ef3 samples: net: dns_resolver: Add config options for tests
Make sure that we compile sanity checked application with
more config options in order to catch compile issues faster.
In this case DHCPv4 + debugging options are enabled for
sanity checker.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-14 17:22:27 -04:00
Jukka Rissanen 994be4dc4b samples: net: dns: Fix compile error
If DHCPv4 was enabled, then there was compile error as the code
was still using wrong variables.

Fixes #7342

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-14 17:22:27 -04:00
David Leach d536ffa694 samples/echo_server: Increased stack sizes for testing OT on kw41z
Something in the workqueue code path pushed the queue usage past
the end of stack.

Fixes #7107

Signed-off-by: David Leach <david.leach@nxp.com>
2018-05-11 16:39:47 +03:00
Tomasz Bursztyka 7d9631e62a samples/net: Fix echo_client for cc2520
NET_APP settings was missing the device name and enabling the net shell
is nice to verify runtime configuration as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-09 13:18:14 -04:00
Jukka Rissanen 33eb03a8d9 samples: net: https-client: Increasing main stack size
The main stack size was too small for this sample application
when TLS was enabled. Increasing it to 1504 bytes.

Fixes #7269

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-03 08:55:58 +03:00
Anas Nashif b3275d651c tests/samples: add hw dependencies
Add hardware dependencies and filters to make sure we do not explode if
for example we try to build a sample/test using rtc when the platform
does not support that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 19:10:27 -04:00
Ravi kumar Veeramally 6c70aa28d2 samples: net: Fix CoAP server payload dump function
Payload dump function not adopted to multi fragments CoAP packet. Still
assumes whole payload exists in single packet. Also does not handle all
return cases of coap_packet_get_payload() function, which is causing
coverity failures.

Coverity-CID: 185277
Coverity-CID: 185278

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-04-27 13:28:25 +03:00
Jukka Rissanen f59a68b6d8 samples: net: http: Add TLS compilation test
Make sure that TLS configuration is valid by adding a compilation
test for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-26 12:35:05 +03:00
Michael Scott 970b0a9916 samples: lwm2m: update README with use of overlay files
Update the LwM2M client sample documentation with usage examples
of the newly introduced overlay-*.conf fragments.  Remove the
references to prj_dtls.conf.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-04-26 07:59:32 +03:00
Michael Scott 5df33d67fd samples: lwm2m: add overlay conf to support BT networking
The file overlay-bt.conf contains only the needed CONFIG items to
support Bluetooth networking.

For example, DTLS-enabled BLENano2 HW can be supported with the
following build:
cmake -GNinja -DBOARD=nrf52_blenano2 \
  -DCONF_FILE="prj.conf overlay-bt.conf overlay-dtls.conf" ..

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-04-26 07:59:32 +03:00
Michael Scott 30c3461e9b samples: lwm2m: replace prj_dtls.conf with overlay fragment
Instead of maintaining a nearly identical copy of prj.conf to support
DTLS, let's replace it with an overlay-dtls.conf file containing only
the CONFIG settings needed to support DTLS.  This can be used via the
-DCONF_FILE command line argument when configuring the sample:
Non-DTLS-enabled build:
cmake -GNinja -DBOARD=qemu_x86 ..
DTLS-enabled build:
cmake -GNinja -DBOARD=qemu_x86 \
  -DCONF_FILE="prj.conf overlay-dtls.conf" ..

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-04-26 07:59:32 +03:00
Andrei Emeltchenko 190e8d961c usb: wpanusb: Fix setting wrong length
During introduction of RAW channel pkt length was set to wrong value.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko 24cc5cc4ab usb: wpanusb: Make generic interface to raw 802.15.4 channel
Reuse CONFIG_NET_APP_IEEE802154_DEV_NAME option.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko 2b47d35839 usb: wpanusb: Fix regression with putting LQI to wrong place
Fix regression introduced by commit b52c0f24a6

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko acb0f0990e samples: echo_server: Update prj_cc2520 configuration
Fix missing CONFIG_NET_APP_IEEE802154_DEV_NAME option, etc

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko 7337f4a069 usb: wpanusb: Code cleanup
Trivial code cleanup and doc update

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko 74d08efbf2 usb: wpanusb: Correct protocol description
Notice about Vendor type.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko a5e7a8deec usb: wpanusb: Remove unused packet handlers
Remove class and custom handlers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko c8e2387402 usb: wpanusb: Remove unused headers
Remove old headers

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko 9e753f0c20 usb: wpanusb: Clean up code
Remove unused code

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko 10ec019a30 usb: wpanusb: Replace local hexdump() with net_hexdump()
Use standard helper from networking code

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko a9d377e08d usb: wpanusb: Replace char array with structs for descriptor table
Use more readable format for descriptors.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Maureen Helm 4e8f29f319 gpio: Refactor the mcux gpio driver to use dts
Get the driver name, base address, irq number, and irq priority from
dts.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-04-20 08:54:11 -05:00
Erwan Gouriou 162b6e4b35 samples: Allow use of "CONTROLLER" postfix for LED and GPIO
Rework samples using LED and GPIO to enforce use of "CONTROLLER"
as LED and PGIO postifx.
Change impact all samples that could be run by boards yet moved to
GPIO node generations, which is only STM32 for now

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-19 09:32:39 -05:00
Tarun Kumar Agarwal 3aa3e97675 samples: net: coap: Solved the payload issue in coap GET Method
In sample application of COAP there is no need of payload
for GET method & it is only applicable to put
and post methods are modified in coap-client.c

Signed-off-by: Tarun Kumar Agarwal <tarun.kumar.agarwal@intel.com>
2018-04-16 10:36:57 +03:00
Jukka Rissanen 79c4a5b4bf samples: net: coap_client: Fix compile error
The mgmt_event is undeclared so we need to remove this piece of
code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-12 15:10:19 +03:00
Marti Bolivar 023ae27d25 samples: telnet: fix net mgmt event handler
This is missing a mandatory check against the actual event.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-04-12 10:35:10 +03:00
Marti Bolivar cd6a3f0457 samples: coap_client: fix net mgmt event handler
This is missing a mandatory check against the actual event.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-04-12 10:35:10 +03:00
David Leach 292033c1d0 openthread: kw41z: Adding echo/server project config files for KW41Z OT
- Added example OpenThread projects for KW41Z in echo/server samples
- Added projects to sample.yaml for sanity testing

Signed-off-by: David Leach <david.leach@nxp.com>
2018-04-11 16:57:12 +03:00
Jukka Rissanen 435d173870 samples: net: stats: Print ethernet statistics
If ethernet statistics collection is enabled, then print it
to the user.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-11 16:49:48 +03:00
Tomasz Bursztyka f9159ab6bd samples/telnet: Fix accessing iface ipv4 config
A left over from commit 47dafffb67

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-11 16:28:16 +03:00
Andrei Emeltchenko a68a177cc7 wpanusb: Use DEBUG syslog level
Remove magic number

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Andrei Emeltchenko 32e089d2f0 wpanusb: Remove old hardcoded VID / PID
Use values defined in USB Device configuration

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Andrei Emeltchenko c925bf5175 wpanusb: Remove unneeded configuration option
Remove unneeded configuration option reported during build.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Andrei Emeltchenko 05893ec51c wpanusb: Assign USB Product ID to 802.15.4 over USB
Assign special Product ID (0x101) to wpanusb protocol exporting
IEEE802.15.4 over USB.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Jukka Rissanen 15ccd9cc0d sample: net: stats: Example how to use net_mgmt for statistics
Simple application that queries network statistics periodically
via net_mgmt interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-10 13:29:39 +03:00
Anas Nashif 016b21a463 tests: mbedtls_sslclient: fix filtering and default conf
Remove galileo as the only board to build for and cleanup the filtering.
Also, remove arduino 101 conf, this is not a networking platform we want
to tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Loic Poulain 7c5c222ca0 samples: net: Add test cases for USB EEM
Add test for zperf and http_server apps.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2018-04-06 06:50:34 -04:00
David B. Kinder e48b64d1be doc: fix doc misspellings in doc, boards, samples
Occasional spelling-check scan found some misspellings.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-04-05 19:17:01 -04:00
Jukka Rissanen 73b43e0024 drivers: eth: native_posix: Add VLAN support
Support also virtual LAN (VLAN) with native_posix ethernet driver.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-05 08:54:19 -04:00
Jukka Rissanen 5fbd48077b samples: net: vlan: Simple app for setting virtual lan settings
This application just enables VLAN tag for ethernet interface.
Set CONFIG_SAMPLE_VLAN_TAG option to define the desired VLAN tag.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-05 08:54:19 -04:00
Jukka Rissanen a0df4f6698 samples: net: Fix sanitycheck for sam_e70_xplained board
Some of the sanitycheck tests were having too small limit for
network buffers when compiling for sam_e70_xplained board.
Increase the buffer limits when testing this for this board.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-05 08:25:49 -04:00
Alberto Escolar Piedras 2d926f3594 native: doc eth TAP: can only be compiled in Unix
Minor change in eth tap interface, as it can only be compiled
in Unix

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-04-04 15:30:07 -04:00
Andrei Emeltchenko 0dfeb32a31 usb: Remove USB VID / PID for sanity check builds
We can use default values of CONFIG_USB_DEVICE_VID and
CONFIG_USB_DEVICE_PID for sanity check builds.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-03 15:58:33 -04:00
Jukka Rissanen 217c0edddd samples: net: http_server: Send final chunk
The final ending chunk was not sent after the request was served.
This caused the remote client to constantly send the same request
to the server.

Fixes #6356

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-29 16:54:04 +03:00
Tarun Kumar Agarwal 17234a9f59 samples: net: add put and post methods to coap
In sample application of COAP put and post
methods are implemented in coap-server.c
and coap-client.c

Signed-off-by: Tarun Kumar Agarwal <tarun.kumar.agarwal@intel.com>
2018-03-29 09:30:45 -04:00
Jukka Rissanen 9626cba0cb sample: net: echo-server: Cleanup config files
Combine several generic config file into prj.conf that can be
used by several boards and configurations.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-28 09:41:05 +03:00
Jukka Rissanen ba3c0bb123 samples: net: Add traffic class sample application
This demostrates how to classify the network traffic when sending
data. The application will create similar functionality as
echo-client so user can use echo-server running in remote host to
test this sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen ca8b00a3cc net: if: Make interface IP configuration more flexible
Instead of always allocating both IPv6 and IPv4 address information
to every network interface, allow more fine grained address
configuration. So it is possible to have IPv6 or IPv4 only network
interfaces.

This commit introduces two new config options:
CONFIG_NET_IF_MAX_IPV4_COUNT and CONFIG_NET_IF_MAX_IPV6_COUNT
which tell how many IP address information structs are allocated
statically. At runtime when network interface is setup, it is then
possible to attach this IP address info struct to a specific
network interface. This can save considerable amount of memory
as the IP address information struct can be quite large (depends
on how many IP addresses user configures in the system).

Note that the value of CONFIG_NET_IF_MAX_IPV4_COUNT and
CONFIG_NET_IF_MAX_IPV6_COUNT should reflect the estimated number of
network interfaces in the system. So if if CONFIG_NET_IF_MAX_IPV6_COUNT
is set to 1 and there are two network interfaces that need IPv6
addresses, then the system will not be able to setup IPv6 addresses to
the second network interface in this case. This scenario might be
just fine if the second network interface is IPv4 only. The net_if.c
will print a warning during startup if mismatch about the counts and
the actual number of network interface is detected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen 47dafffb67 net: if: Separate IP address configuration from net_if
Move IP address settings from net_if to separate structs.
This is needed for VLAN support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen 4402fbcdd6 samples: net: websocket_console: Do not copy pass end of string
We might access too long string when copying URL.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-26 13:00:11 +03:00
Jukka Rissanen 6170ae5e2e net: websocket: Use system provided base64 function
Instead of using mbedtls_base64, use system provided base64 encoding
function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-23 08:30:26 -04:00
Carles Cufi 8aa9a37902 drivers: flash: nrf: Rename nrf5 to nrf
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.

Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 20:07:09 +01:00
Jukka Rissanen 44eb83624f tests: net: websocket: Fix null pointer dereference
Network packet cannot be NULL so no need to check its value.

Coverity-CID: 183063
Fixes #6669

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-20 12:19:13 -04:00
Anas Nashif e5f1b51f01 debug: fix RTT console Kconfig
Use HAS_ Kconfig option as intended, those are invisible option that
signify support of a certain feature that can be selected by a hardware
or platform.

For RTT and system view this was not dont in an inconsistent way.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-19 15:37:26 -04:00
Jukka Rissanen e4212306cd samples: net: eth_native_posix: Sample for native networking
This application just enables native host networking and net-shell
which allows connectivity from zephyr to host system via tap device.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-18 20:47:36 -04:00
Paul Sokolovsky e82578919a mbedtls: Replace COAP-specific max len setting with generic
Instead of CONFIG_COAP_MBEDTLS_SSL_MAX_CONTENT_LEN, use recently
introduced CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-03-18 09:38:22 -07:00
Paul Sokolovsky 7558ce8cdb mbedtls: Add CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN
This value allows to set max payload length of a TLS protocol
message, and passed thru to mbedTLS as MBEDTLS_SSL_MAX_CONTENT_LEN
setting. The only safe value is 16384, which translates to 32KB
of RAM required just for mbedTLS input/output buffers. Any other
value can be configured *only* per a particular application
(e.g. knowing that it won't pass more than spefific amount of
data at once and/or won't connect to a server with a long cert
chain). Previosuly, we had quite an adhoc and inflexible config
with random values for that setting, based on protocol.

Note that while the safe value is 16384, "backward compatible"
default of 1500 is used (good for DTLS on the other hand).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-03-18 09:38:22 -07:00
Loic Poulain 175dd9600e net: samples: Reduce net pkt RAM usage
There are 174 RX/TX net pkt reserved, this make build fail
with some boards due to ram overflow (e.g quark_se_c1000).
Fix this by reducing NET_PKT RX/TX reserve to 100, which
seems fair enough for this use case. Moreover, don't think
there is any reason to have more NET_PKT than NET_BUF.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2018-03-16 14:45:24 -07:00
Kumar Gala 0fea45aa4f samples/tests: net: websocket: Fix yaml files
The yaml files had a '-' before test: which was causing an error
relating to trying to load the yaml

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-03-15 16:29:01 -05:00
Jukka Rissanen 2abba3582d samples: net: syslog: Remote syslog service example
The sample application will send syslog messages to remote
syslog server.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-15 15:19:46 +02:00
Jukka Rissanen 2f4fa71b87 samples: net: websocket: Add console sample application
This sample application implements a web service that provides
zephyr console over websocket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-15 15:17:36 +02:00
Jukka Rissanen 1e6ed0335a samples: net: websocket echo-server application
This is a http(s) server that supports also websocket.
It sends back any data sent to it over a websocket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-15 15:17:36 +02:00
Sundar Subramaniyan 2114da018a tests: samples: Exclude nrf52840_pca10056 from wpanusb sample
With usb_device support added to nrf52840_pca10056 board, sanity
check script compiles the sample net/wpanusb and it fails with
undefined reference for symbol cc2520_configure_gpios.

First of all cc2520 shouldn't be compiled at all for nrf52840
since it has its own ieee802154 radio. The prj.conf under the
sample samples/net/wpanusb simply hard codes the config
CONFIG_IEEE802154_CC2520=y and is causing the ieee80211_cc2520.c
file to be compiled. If it's removed from the configuration file
we get other errors. So it is not straight forward.

For now, as a workaround, exclude the nrf52840_pca10056 platform
until there's a proper fix.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-15 12:39:53 +01:00
Stig Bjørlykke a7e01f4d40 samples: net: Remove references to ZoAP
Rename variable zpkt to cpkt to complete the move from ZoAP to CoAP.

Remove unused tests/net/lib/zoap/CMakeLists.txt file.

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
2018-03-09 20:25:37 -05:00
Ravi kumar Veeramally ebc81bdf8d net: http: Provide destination address in http replies
net_app_ctx maintains multiple net contexts(net_ctx). But when http
api's wants to reply or send some data, its always choose the first
net_context in the array, which is not correct always.

net_app_get_net_pkt_with_dst() api will select proper context
based on destination address. So with the help of new api in
net_app, http can select proper context and send packets. To
achieve this, desination address is provided in http_recv_cb_t
and http_connect_cb_t callbacks. Also chaged relevant API's to
provide destination address in http message preparation methods.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-03-05 10:23:17 +01:00
Paul Sokolovsky a3a5c48d93 samples: net: echo_async: Better error and write handling
Initially this sample was intended to be very simple and schematic,
but as this sample going to become a base for stream API conversion,
time to handle all the edge conditions.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-03-02 16:50:41 +01:00
Paul Sokolovsky 8e867378da samples: sockets: echo: Better error and short write handling
Initially this sample was intended to be very simple and schematic,
but as this sample going to become a base for stream API conversion,
time to handle all the edge conditions.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-26 10:20:50 -06:00
Paul Sokolovsky ec207f4250 net: app: Move mbedTLS debug log level config to mbedTLS Kconfig
mbedTLS log level is obviously a mbedTLS config setting. It makes
sense to have it defined in mbedTLS Kconfig, and different parts
of Zephyr to reuse as needed (e.g. net-app vs upcoming TLS wrapper
for sockets).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-22 18:44:55 -05:00
Kumar Gala d9bd6909c3 samples: dump_http_server: move generated files into include/generated
Move the generated files into include/generated so they live with the
build and not in the zephyr source tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-02-21 18:53:23 -05:00
Pedro Martucci a495b31ee0 sample: net: RPL mesh sample over QEMU
Create a net sample to setup a multi-node RPL mesh network using QMEU.
To enable this, it was necessary implement a hw filter on IEEE 802.15.4
UART Pipe driver and create a QEMU pipe management on cmake.

This sample use a tool developed on zephyr net-tools repository called
virtual-hub.

Signed-off-by: Pedro Martucci <pedropaulomartucci@gmail.com>
2018-02-20 14:47:14 +02:00
Paul Sokolovsky 7e06be2218 samples: sockets: http_get: Include Host: header in request
The Host header is even mandatory in HTTP 1.1, and indeed without
it, many virtual hosting setups don't work (which are many), so to
be faithful to what README says: "You can edit the source code to
issue a request to any other site on the Internet", let's
complicate the sample by including it.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-19 10:39:14 +02:00
Paul Sokolovsky f303e9d115 samples: sockets: Add big_http_download sample
This sample downloads a more or less big file (~6MB as preconfigured)
over HTTP and checks its hash for integrity. It also repeat such a
download indefinitely, counting total number of bytes transferred.

This is thus a kind of traffic load testing sample. (Ported to C
from MicroPython original).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-17 09:11:29 -05:00
Paul Sokolovsky 42680b07af mbedtls: Switch default MBEDTLS_CFG_FILE to config-mini-tls1_2.h
The previous default, "config-threadnet.h", is more or less arbitrary
choice made in a commit 312def2c78 1.5 years ago. In particular,
it's not related to Thread support in Zephyr per se (there was no
such support at that time).

It doesn't make sense to have a default intended for a particular,
not widely used (yet) protocol. Instead, the default should work
out of the box with a contemporary widely deployed arrays of TLS
servers, which are HTTPS server. config-mini-tls1_2.h works with
https://google.com, and by extension, with many other servers on
the Internet.

So, have that as the default, and let applications with special
needs to override that to what they need.

Addresses: #6132

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-15 12:35:31 -05:00
Paul Sokolovsky bc1a82acc7 samples: net: sockets: Clean up/improve socket samples
With 323e8cf069 applied and printf() working out of the box,
CONFIG_NET_BUF_LOG=y workarounds can be removed from configs of
all samples.

Also, print an intro message at the start of each server sample,
to give a user hint that the app didn't just hang and what to do
next. (The port waiting for connection is printed. We can't (easily)
print host address, because the samples should run on both Zephyr
and POSIX systems, and finding out local host address would require
hairy #ifdef's undermining the purpose of these samples (that is,
showing that the *same* code can be used on both types of systems)).

Fixes: #5379

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-11 09:49:31 -05:00
Johan Hedberg dd09cbc1c4 net: buf: Redesigned API with split data and meta-data
Redesign of the net_buf_simple and net_buf structs, where the data
payload portion is split to a separately allocated chunk of memory. In
practice this means that buf->__buf becomes a pointer from having just
been a marker (empty array) for where the payload begins right after
the meta-data.

Fixes #3283

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg 1d131338bc net: samples: zperf: Reduce quark_se_c1000_devboard buffer counts
This gives a bit more margin to the available RAM.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg 5856540c90 net: samples: throughput_server: Decrease buffer count
Decrease the buffer count in order to give a reasonable margin to the
available RAM.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Paul Sokolovsky 166cd7f66d samples: sockets: http_get: More configurability and logging
Make it easy to override HTTP host/port/path. Print URL which we
request and make few other adjustment to the output for clarity.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-06 12:57:48 +02:00
Andrei Emeltchenko c3a9f8d4f8 usb: sanitycheck: Clean up sample.yaml
Remove old sample VID/PID and use new style.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-02-05 06:39:50 -08:00
Kamil Sroka 8dd852dc92 samples: net: Add config and enable CI for OpenThread on nRF52840
Add samples config for nRF52840 with OpenThread
for echo_client and echo_server.

Add OpenThread to CI for echo_client and echo_server on nRF52840

Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
2018-01-29 22:42:03 -05:00
Jukka Rissanen 37f54c11fa samples: net: perf: Add sample for throughput measurement
Add a simple UDP server application that will receive UDP data
and print various statistics like number of packets received and
dropped, amount of bytes received, and how many packets / sec
we were able to receive.

Currently the sample only provides a config file for FRDM-K64F board.
Note that this sample should not be run in QEMU as the performance
is very bad there because of SLIP link between Linux host and QEMU.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-01-29 01:57:41 +05:30
Paul Sokolovsky 6bab4998ba samples: net: zperf: Fix only IPv4/only IPv6 build, better messages
The code couldn't really build with only CONFIG_NET_IPV4 or
CONFIG_NET_IPV6 enabled, because some parts weren't covered
by #ifdef's. Regroup the code to get it covered.

Also, improve error/notice messages.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-01-22 10:15:27 +02:00
Carles Cufi 72046a8abc doc: getting_started: Support multi-OS instructions
In order to be able to document the build on Windows and UNIX
systems, slight variations are required on the app commands
that are used throughout the documentation system.

This includes getting rid of the prompt symbol and providing commands
for both UNIX and Windows operating systems.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-18 16:53:31 -05:00
Andrei Emeltchenko 314d182f79 samples: zperf: Add USB RNDIS configuration check
Add configuration for zperf sample allowing to build USB dongle with
zperf for testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Andrei Emeltchenko 7e80f41162 usb: Rename SYS_LOG_USB to SYS_LOG_USB_DEVICE
At the moment CONFIG_SYS_LOG_USB_LEVEL name does not specify that this
is log level for the Device Stack. Make it clear renaming to the
proper name.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Andrei Emeltchenko 6e17e71fb5 samples: Correct default SYS_LOG_USB and SYS_LOG_USB_DRIVER levels
Making configuration files useful.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Tomasz Bursztyka 5195ddf472 drivers/ieee802154: Cleanup Kconfig
A very old reference to former net stack was still lurking around.
Removing it.

Taking the opportunity to clear up dependencies.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-01-10 21:53:01 -05:00
Anas Nashif 9512f0ddf3 samples: rpl: do not build when assert is enabled
Was failing due to increased size of binary.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-09 11:13:08 -05:00
Anas Nashif 4d2ad0a8a5 Bluetooth: remove unused BT_DEBUG_COLOR
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-09 10:59:41 -05:00
Sebastian Bøe 6f642a19fd cmake: Ported mbedTLS to use Zephyr interface libraries
mbedTLS include directories will now default to be in the 'app'
include path when mbedTLS has been enabled.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-02 22:09:01 -05:00
Ravi kumar Veeramally a0371ae92f net: tcp: Add initial support for TIMEWAIT timer
Right now in FIN_WAIT1 state, if we receive FIN+ACK message, then
tcp state changed to FIN_WAIT2 on ACK flag and immediately on FIN
flag state changed to TIME_WAIT. Then final ACK is prepared and sent
(in queue at-least) to peer. Again immediately state changed to
TCP_CLOSED, where context is freed. net_context_put frees context
and releases tcp connection. Final ACK packet which is in queue
is dropped.

As a side effect of freed ACK packet, peer device keep on sending
FIN+ACK messages (that's why we see a lot of "TCP spurious
retransimission" messages in wireshark). As a result
of context free (respective connection handler also removed), we see
lot of packets dropped at connection input handler and replying with
ICMP error messages (destination unreachable).

To fix this issue, timewait timer support is required. When tcp
connection state changed to TIMEWAIT state, it should wait until
TIMEWAIT_TIMETOUT before changing state to TCP_CLOSED. It's
appropriate to close the tcp connection after timewait timer expiry.

Note: Right now timeout value is constant (250ms). But it should
be 2 * MSL (Maximum segment lifetime).

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-12-31 11:58:27 -05:00
Anas Nashif b5b8095749 samples: bluetooth and net samples need test setup
remove build_only and make them depend on test harness (bluetooth)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Michael Scott 2fc554b8fc crypto: config: config-coap: add CONFIG for setting max content length
The CoAP samples use an MBEDTLS config "config-coap.h" which could be
re-used by the LwM2M sample, except that most servers use a larger
maximum content length setting of 1500 bytes.

Let's add a CONFIG to set this for users of the CoAP lib and set the
CONFIG value for the samples to the 256 size currently used.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 17:52:13 -05:00
Michael Scott 5f4c7fcf5c samples: lwm2m: update documentation for DTLS support
- Mention the prj_dtls.conf setting
- Explain setting up security in the Leshan Demo Server web UI.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 16:46:48 -05:00
Michael Scott 100f8273dd samples: lwm2m: add support for DTLS
To test, use -DCONF_FILE=prj_dtls.conf

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 16:46:48 -05:00
Anas Nashif 23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Sebastian Bøe 1588125672 samples: Don't read board from cmake -DBOARD=x
The CMakeLists.txt file was reading ${BOARD}, but this means the user
must set BOARD like this cmake -DBOARD=foo. The user must be allowed
to set BOARD from the environment.

The code was unnecessary anyway because the convention
prj_${BOARD}.conf is known by boilerplate and therefore not necessary
to specify.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-11 09:06:48 -05:00
Sebastian Bøe b7fa4f1e29 samples: echo_server: Test the nrf build in CI
This introduces an nrf build to CI for the echo_server sample. Doing
so ensures that https://github.com/zephyrproject-rtos/zephyr/pull/5018
cannot regress again.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-06 11:11:59 -06:00
Jukka Rissanen 6faf997b97 samples: net: echo-server: Fix compilation with mbedtls
The echo-server 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-22 18:45:35 -05:00
Jukka Rissanen 37247bda78 samples: net: zperf: Ignore error when creating TCP sample pkt
When sending TCP sample packet, just fill the packet to max and
ignore any overflow error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 10:10:31 -05:00
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
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
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
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
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
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
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
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
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 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
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
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
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
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
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
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
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
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
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
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