Commit graph

1640 commits

Author SHA1 Message Date
Andrei Emeltchenko c2dbbf77c1 samples: net: lldp: Set optional TLV system_name
Add optional TLV to LLDP DU.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-09 16:02:11 -05:00
David B. Kinder 505cc2bb0e doc: use :zephyr_file: where appropriate
A new role :zephyr_file: is available that renders to a link to the file
or folder in GitHub.  Find appropriate references using :file: and
convert to :zephyr_file: to take advantage of its linking capability.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-09 09:50:27 -05:00
Tedd Ho-Jeong An 4063b3b149 sample: sockets: can: Update error handle flow
This patch updates error handle flows for socket apis.

Fix: #13859
Coverity-CID: 190956

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-08 08:43:29 -05:00
Jukka Rissanen 9a0cf4b48f doc: net: Fix VLAN documentation in doc and in sample
The VLAN documentation had double wording and proper links to files
in github was missing, which did not look good in the rendered HTML
page.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-07 20:31:04 -05:00
Kumar Gala a2d61fedf6 kconfig: remove stale CONFIG_IEEE802154_CC2520_AUTO_ACK
CONFIG_IEEE802154_CC2520_AUTO_ACK seems to creep back in, but has long
since be removed.  We remove old references a few times.

Commit 2facf33f28 - "net: ieee802154: Remove old cc2520 AUTO_ACK
assignments".

Remove them again.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 13:04:29 -06:00
Kumar Gala 6833ea718f kconfig: Remove dead references to CONFIG_PCI_DEBUG
CONFIG_PCI_DEBUG isn't a Kconfig option we support anymore so remove
some dead references to it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 13:04:29 -06:00
Tedd Ho-Jeong An 32caf24cb4 samples: sockets: echo_async: Add more error checking
This patch adds more error checking and handling for socket APIs.

Fixes: #13885
Coverity-CID: 190928

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-07 10:15:59 -05:00
Kumar Gala eba74fa809 samples: net: nets: Remove references to CONFIG_NET_DHCPV6
CONFIG_NET_DHCPV6 doesn't exist so remove references to it in the
sample, leave comments about TODO if/when this might exist.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 10:13:27 -05:00
Kumar Gala 9740078d6c samples: net: wpan_serial: Remove dead code related to CONFIG_DCD_DSR
CONFIG_DCD_DSR does not exist so the code block associated with it would
never be built, so remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 10:13:10 -05:00
Tedd Ho-Jeong An 2df4652077 samples: sockets: echo_async_select: Add error check
This patch adds error checking routine for socket APIs.

Fixes: #13852
Coverity-CID: 190966

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-07 09:40:13 -05:00
Ravi kumar Veeramally f860d31465 samples: net: coap_client: Fix coverity issue
Fix uninitialized variable.

Coverity-CID: 190969
Fixes: #13850

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-03-01 19:44:11 +01:00
Sebastian Bøe 4e5300ba7f cmake: Drop all in-tree usage 'set_conf_file'
Port all users of 'set_conf_file' to use the built-in rules
instead. This follows the convention-over-configuration principle to
make the system as a whole simpler and more consistent.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-03-01 09:44:09 +01:00
Jukka Rissanen 2db03ce277 samples: net: socket: can: Do cleanup if failure
If bind() fails or TX thread cannot start, then cleanup the
socket by calling close()

Coverity-CID: 191003
Fixes #13824

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-28 08:46:52 -06:00
Paul Sokolovsky fff2011fb5 samples: sockets: echo_server: Print port number to connect to
We have a great number of samples now, using different port numbers,
etc. Let them be self-documenting and print out port number used.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-02-27 08:32:58 -06:00
Andrew Boie feab37096b libc: fix CONFIG_STDOUT_CONSOLE semantics
The intent of this Kconfig is to allow libc stdout
functions like printf() to send their output to the
active console driver instead of discarding it.

This somehow evolved into preferring to use
printf() instead of printk() for all test case output
if enabled. Libc printf() implementation for both
minimal libc and newlib use considerably more stack
space than printk(), with nothing gained by using
them.

Remove all instances where we are conditionally
sending test case output based on this config, enable
it by default, and adjust a few tests that disabled
this because they were blowing stack.

printk() and vprintk() now work as expected for
unit_testing targets, they are just wrappers for
host printf().

Fixes: #13701

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-26 08:00:33 -06:00
Kumar Gala bb6b1918b2 drivers: can: stm32: Cleanup Kconfig enablement
Follow the pattern we have for other peripherals in that if the driver
class (CAN) is enabled than enable the driver for that class
(CAN_STM32).  Also have the STM32 CAN driver depend on being on a STM32
SoC.

Remove setting of CONFIG_CAN_STM32 in any .conf files as it will get set
of CONFIG_CAN is set/enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-25 10:05:21 -06:00
Robert Lubos 756043c2b3 samples: net: lwm2m: Fix system workqueue stack size
System workqueue stack was not large enough to handle DTLS handshake,
which lead to system crash.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-02-23 07:42:38 -05:00
Jukka Rissanen c478b5bb6e can: Rename can_msg and can_msg_filter structs
In order to follow the naming from Linux, change the name of
can_msg to zcan_frame, and can_msg_filter to zcan_filter.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Jukka Rissanen 58f3ae5334 can: Add Linux compatible frame and filter structs
Add new "struct can_frame" which is compatible with Linux so that it
is easier to port socket-can applications from Linux.
Rename existing can_filter to can_msg_filter so that the name will
not conflict with Linux compatible can_filter struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Jukka Rissanen 8b7057c918 samples: net: promiscuous_mode: Add missing README.rst file
The promiscuous mode sample was missing documentation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-21 16:38:13 -05:00
Jukka Rissanen c17d302321 doc: net: Enhance DNS resolver documentation
Add more information about DNS resolver to documentation. Move
generic DNS information from the sample application into DNS
resolver documentation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-20 19:41:47 -05:00
Jukka Rissanen 41d17433f0 doc: net: Add more info for network connectivity with host
Added more detailed information how to connect Zephyr instance
to host system like Linux desktop.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-20 07:32:42 -05:00
Krzysztof Chruscinski 3605e48c44 shell: Modify subcommands to use SHELL_STATIC_SUBCMD_SET_CREATE
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.

Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-20 07:31:35 -05:00
David B. Kinder 882702e688 doc: fix misspellings in docs
Fix misspelling in boards, samples, and doc missed during regular
reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-19 21:35:45 -05:00
Jukka Rissanen 8bf1dfc97b samples: syslog_net: Fix link to RFC 5426
The RFC link pointed to wrong document.

Fixes #13005

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-19 15:08:05 -05:00
Bub Wei 55a0e7001d samples: net: zperf: Refactor udp_received
Use the state machine states to determine if the session has ended.
This way zperf will properly reply stat packet to remote client even if
duration of the session is non zero.

Also we don't need to update counter (received packet number) at end of
the session.

Note: if id < 0, it means session end, otherwise it's session ongoing.
(id is the first feild of application data from remote client).

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-02-18 15:12:27 -05:00
Jukka Rissanen f626c3ccbe samples: net: sockets: Add smoke testing support
The net-app based echo-server/client applications were used for
various smoke testing purposes. As those two apps are now removed
we need to introduce the same support into sockets based echo-client
and echo-server applications.

Fixes #13300 #13481

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-18 15:10:01 -05:00
Paul Sokolovsky 89dfa5bb5b samples: dumb_http_server: Fix typos and improve wording in docs
Both actual typos and just less word repetition.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-02-18 15:08:37 -05:00
Carlos Stuart 75f77db432 include: misc: util.h: Rename min/max to MIN/MAX
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.

This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.

All files that use these macros have been updated.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-14 22:16:03 -05:00
Michael Scott a10610eb9f samples: net: lwm2m: add timer object to lwm2m client
Let's provide example usage of the IPSO Timer object in our LwM2M
sample.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-12 21:19:49 -05:00
Michael Scott e50ad09325 samples: net: lwm2m: Add decimal value to dummy temp sensor
Now that float handling is fixed, let's display a decimal value
in our dummy temperature sensor.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-12 21:19:49 -05:00
Kumar Gala 861c82d05f samples: net: zperf: rename WLAN to WIFI
We refer to it as WIFI and not WLAN, so use that CONFIG symbol and
string.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-11 22:29:58 -05:00
Andy Gross d0fc82c02d samples: net: Add Google IOT Cloud full stack application
This application provides a full stack implementation for
communicating with the Google IOT Cloud.  It leverages the
a JWT library to create JSON tokens which are then signed using
a RSA or ECDSA private key.  The signed token is used to
authenticate with the Google IOT cloud servers.  Once that is
accomplished, the application can subscribe, or publish data at
will.

Included in the application is a python script that can be used to
create RSA/ECDSA certificates and keys.  The user will load the
certificate for the appropriate device on the Google IOT Cloud.  The
private key is created by the script and stored in a C structure format
that is then consumed by the application.  It is important to note that
any keys generated from the scripts SHOULD NOT BE STORED publicly.

Please refer to the README for more information.

Signed-off-by: David Brown <david.brown@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-08 15:32:58 -06:00
Jukka Rissanen 62c75107a3 samples: net: can: Add socket CAN sample
Simple socket CAN application that sends data periodically and
receives the data back.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-08 12:03:34 -05:00
Andrei Emeltchenko bf0a4a8cfb samples: usb: Update samples for new port name
Use new multi instance interface and new port names.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Tomasz Gorochowik d0808216f5 samples: net: mqtt_publisher: Add proxy support
If appropriate configuration is enabled, assume (with the default
configuration) that the proxy server uses the same address as the broker
and the default 1080 port.

The default settings can be changed in the configuration header.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-02-08 14:20:44 +02:00
Andrei Gansari 0ceab99865 samples: net: removed unused common cmake
CONFIG_NET_TESTING never used, removed in this commit.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-02-08 13:57:55 +02:00
Ravi kumar Veeramally 2c3ecd8c51 net: samples: Disable IPv4 from packet socket sample
IPv4 is not needed for packet socket sample. Previous commit
helps to remove dependencies.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-02-08 12:35:03 +02:00
Anas Nashif 74c573635f samples/tests: filter based on toolchain features
Do not run with toolchains that do not support newlib.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-07 22:46:10 -06:00
Ravi kumar Veeramally 7e8ded911d samples: sockets: Add packet socket sample application
Sample application which opens a packet socket and receives
every packet on the wire and send some dummy packet over
socket. Simple demo of how to use packet sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-02-07 14:43:30 +02:00
Ravi kumar Veeramally 1e47f26d1c net: coap: Remove legacy CoAP implementation
As we are removing net_app and net_pkt based libraries and
applications, CoAP legacy based libraries and apps are moved
to socket based implementations. So removing legacy CoAP.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-02-04 16:49:59 -05:00
Tomasz Bursztyka 4b78a251d7 net/context: Make recv_cb providing the ip and protocol headers
If status is 0, both ip_hdr and proto_hdr will own a pointer to the
relevant IP and Protocol headers. In order to know which of ipv4/ipv6
and udp/tcp one will need to use respectively net_pkt_family(pkt) and
net_context_get_ip_proto(context).

Having access to those headers directly, many callbacks will not need
to parse the packet again no get the src/dst addresses or the src/dst
ports. This will be change after this commit.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-01 14:34:38 +02:00
Jukka Rissanen 48abdc2cb9 samples: net: Remove net-app based sample applications
As net-app API is removed, remove also all the sample applications
that use it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-01 12:29:21 +02:00
Paul Sokolovsky 30ba9de4c4 samples: sockets: Remove Zephyr logging from POSIX-compatible samples
As example of echo_async_select added recently shows, we no longer
need to define a logger unconditionally in each source file. These
samples are intended to show Zephyr compatibility with POSIX sockets
API, so the less there're differences between Zephyr vs POSIX
ifdefs, the better.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-02-01 08:50:02 +02:00
Michael Scott 9cd0cfa564 samples: lwm2m: migrate to BSD socket APIs
The LwM2M library has moved from the network application library
APIs to BSD socket APIs.  Let's make the needed changes in the
LwM2M sample to follow those changes.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Michael Scott 180a365d2f net: lwm2m: support for LwM2M bootstrap
Now that the security data can be loaded into and used from the
security / server objects, we can add support for LwM2M bootstrap.

This is a mode where initially a connection can be made to a server
which can update several LwM2M (including security and server
data) and then trigger a "bootstrap complete".  Once this happens
the client will start it's connection process over but now with
the new information.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Michael Scott 54c10c04e5 net: lwm2m: use security data for connections
In order to support bootstrap mode, we need to store server data
in the security / server objects.  Once the connection to the
bootstrap server is made, it will clear these objects and add
new server connection data.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Michael Scott 3bfb7debb3 net: lwm2m: move to flat buffers
As part of the migration from net_app APIs to socket APIs, let's
stop referencing the net_pkt fragments throughout the LwM2M library.

Establish a msg_data flat buffer inside lwm2m_message and use that
instead.

NOTE: As a part of this change we remove the COAP_NET_PKT setting.
The COAP library reverts to COAP_SOCK behavior.

This doesn't mean we use sockets in LwM2M (yet), it only means we
use the socket-compatible COAP library which parses flat buffers
instead of net_pkt fragments.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Michael Scott d003910460 net: lwm2m: create DTLS config layer for LwM2M
Currently, this will select the needed configs for LwM2M and net_pkt.
During the migration to socket APIs, the net_pkt selections will change
to socket-based selects.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Robert Lubos 18af0d1572 samples: sockets: Update echo_client/echo_server documentation
As the net-app based echo samples are being removed, there's no use
referencing them any longer in their socket counterparts.

Additionally, overlay configuration descriptions were added in the
same manner original samples did.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-31 13:56:05 -05:00
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