Commit graph

294 commits

Author SHA1 Message Date
Jukka Rissanen 41202ba928 samples: net: sockets: Do not reference default board in docs
Some of the socket samples had wrong information about what default
board to use. Currently there is no default board and user must
select the board when building the application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-16 16:47:37 +03:00
Andrei Emeltchenko 299c9fedd4 samples: net: Clean up netusb overlay configuration
Clean up configs which do not belong to Ethernet over USB.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-04 21:23:53 +03:00
Jukka Rissanen b031a5a163 samples: net: websocket: App for doing Websocket client requests
This is BSD sockets based application for connecting to
Websocket server.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-04 16:38:34 +03:00
Jukka Rissanen a07045d8b2 samples: net: http_client: HTTP client sample application
Simple HTTP client sample that connects to HTTP server and does
GET and POST requests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-04 16:38:34 +03:00
Andrei Emeltchenko 3c08b27ddf samples: net: dumb_http_server: Add zero configuration
Adds zero configuration based on LLMNR. This should be working in
Windows out of the box, zephyr can be accessed with http://zephyr/.
Can be combined with netusb configuration (RNDIS is supported in
Windows).

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-04 10:24:56 +03:00
Andrei Emeltchenko a080154584 samples: net: dumb_http_server: Add netusb configuration
Add configuration for netusb.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-04 10:24:56 +03:00
Jan Van Winkel 391076c73e samples: net: echo-server: Init tcp6_handler_in_use for IPv6
Initialize tcp6_handler_in_use instead of tcp4_handler_in_use for IPv6
in start_tcp.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-10-02 10:07:03 +03:00
Jukka Rissanen 7e0d8bcf7a samples: net: echo-server: Add support for multiple listeners
By default only one listener is enabled, but if user specifies
CONFIG_NET_SAMPLE_NUM_HANDLERS with value larger than 1, then
multiple threads are created, and each will be able to accept
connections.

Fixes #19374

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-01 14:21:38 +03:00
Vincent Wan 17d0d8e1b3 modules: Kconfig.simplelink: Remove POSIX_API, use fine-grained opts
PR #18780 introduces a way to decouple pthread support from the general
CONFIG_POSIX_API global switch. This commit modifies the build of
SimpleLink components to take advantage of it, since SimpleLink
libraries only require pthread, sem, clock, and sleep support, not
entire POSIX API.

This fixes the build errors in the http_get sample introduced
by the merge of #18736. As such, this patch also removes
cc3220sf_launchxl exclude from sample.yaml of that sample.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-09-25 20:56:29 -07:00
Paul Sokolovsky be1eac6058 samples: sockets: Fix syntax of combined "filter" clauses in sample.yaml
Now that we have support for properly combine conditions from multiple
"filter" clauses in one sample.yaml file (e.g. from "common" and
test-specific sections), use it instead of previous adhoc syntax
relying on string concatenation.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-09-19 00:29:41 -04:00
Robert Lubos 324f99e0ac samples: net: Add mbedTLS tweaks in overlay-ot.conf
Add some mbedTLS tweaks for OpenThread in overlay-ot.conf.
Add sample configuration to enable Commissioner/Joiner, disabled by
default.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-09-17 20:07:58 +08:00
Jan Van Winkel 6a6c034749 samples: net: Moved declaration of packet_data
Move declaration of struct packet_data before definition of a variable
of its type.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-09-17 11:27:19 +02:00
Paul Sokolovsky 1858b31536 samples: sockets: sntp_client: Build for both native Zephyr and POSIX
To make sure sntp API plays well with CONFIG_POSIX_API.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-09-12 17:30:29 +03:00
Ravi kumar Veeramally e2b1ec8565 samples: net: coap_client: Fix coverity issue
Ignore socket close() return value in this sample.

Fixes #18961

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-09-10 22:17:54 +03:00
Vincent Wan 3142503ecb samples: net: sockets: disable http_get in test build
Build errors were introduced by the merge of #18736. Until PR #18780 is
approved to allow the SimpleLink libraries to build without
CONFIG_POSIX_API, this patch excludes cc3235sf_launchxl from the test
build.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-09-10 10:22:30 +03:00
Vincent Wan fb0c846db9 samples: net: Adding board config files for CC3235SF
Config files are added to support cc3235sf_launchxl as a new board.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-09-10 10:22:30 +03:00
David B. Kinder 60136f00cb doc: add how to exit from QEMU in samples
While trying out the hello_world sample built for QEMU, I was expecting
the sample app to exit and I'd return to a command prompt.  Nope.  You
need to exit QEMU manually, so add that step to the sample instructions.
Looking around, there are more uses of QEMU like this that could use
this added step after running the sample app.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-09-02 12:06:08 -04:00
Paul Sokolovsky 5eb974d8e7 samples: net: sockets: Allow to build and test with POSIX subsys
With CONFIG_POSIX_API enabled, these samples now build under Zephyr
with exactly the same source as e.g. Linux (or in general, other POSIX
systems). However, building without CONFIG_POSIX_API (i.e. with
CONFIG_NET_SOCKETS_POSIX_NAMES aux option) is retained for now.

Add testcase definitions to build these samples with CONFIG_POSIX_API
in CI.

Fixes: #17353

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-08-30 07:37:18 +02:00
Jukka Rissanen cac26db2bc samples: net: civetweb: Ignore return values
We do not need the return values from various calls to pthread_*()
functions.

Coverity-CID: 203462
Coverity-CID: 203535

Fixes #18376
Fixes #18377

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-27 17:47:27 +02:00
Piotr Zierhoffer 0c378149c4 samples: net: civetweb: Remove an unnecessary config option
CONFIG_NET_SOCKETS_POSIX_NAMES is incompatible with POSIX_API, so it's
disabled by the build system. It's no longer required anyway.

It is a leftover from before #16557 was merged.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2019-08-23 21:14:16 +02:00
Ravi kumar Veeramally 85ef00deb4 samples: net: echo_client: Add SOCKS5 support
SOCKS5 support added to echo_client. Details are added
in README file about how to verify this feature using
echo-client with echo-server running on Linux host.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-08-17 23:22:06 +02:00
Tomasz Gorochowik 0409dd1ce8 Samples: net: civetweb: add README
Closes: #18212

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-08-16 11:37:54 +02:00
Alexander Wachter f8a5b013d7 samples: net: echo_client and echo_server: Add 6LoCAN config
This commit adds a sample configuration for 6LoCAN to the
echo_client and echo_server example.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-08 13:25:01 +03:00
Alexander Wachter 35f01673ac net: l2: 6LoCAN implementation
This commit is an implementation of 6LoCAN, a 6Lo adaption layer for
Controller Area Networks. 6LoCAN is not yet standardised.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-08 13:25:01 +03:00
Carles Cufi 26b438042c samples: net: civetweb: Remove strcspn() implementation
Now that strcspn() is implemented in our minimal libc, remove it from
the civetweb sample to avoid the linker complaining about multiple
definitions.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-07-31 16:30:32 -05:00
Tomasz Gorochowik f2bf9a17c5 samples: net: Add civetweb HTTP sample
This commit adds civetweb as a west module and a sample that uses it.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2019-07-30 13:17:55 +03:00
Anas Nashif 578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Jukka Rissanen a62c6b2b04 samples: net: echo-server: Add PPP overlay config file
A sample overlay config file for PPP added.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-29 10:24:46 +03:00
Robert Lubos 54eb4adff9 samples: net: echo_client: Fix bug in workqueue processing
The `start_udp_and_tcp` funcion is a blocking function, therefore it
should not be called from the system workqueue, as it would stall it.
Because it was called in such a way, the retry mechanism, which
also relied on the system workqueue did not work properly.

This commit fixes the issue, by keeping the main application processing
in the main thread, and using a semaphore to synchronize with the
connection manager.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-07-25 14:26:27 +03:00
Nicolas Pitre 6609c12516 tests: enable native_posix_64 testing
Whenever conditions are applied to native_posix, they should apply to
native_posix_64 too.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-16 10:41:11 -07:00
Marc Herbert c429051380 tests/net/: samples/net/: add a few 'userspace' tags
See commit message 4afcc0f8af for the long story.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-07-15 09:05:10 -04:00
Anas Nashif 84e87a1eb4 samples: net: quark/arduino 101 do not have ethernet support
Remove old configurations of boards that do not support networking
natively and very custom and difficult to test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Jukka Rissanen a845c57bd7 samples: net: echo-client: Start service in correct time
Start to monitor Connected and Disconnect events and then start
and stop the echo service according to system connectivity status.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-12 12:33:19 +03:00
Maureen Helm 4d5ee282be samples: net: Convert mcr20a samples to use the frdm_cr20a shield
Converts all net samples that enable the mcr20a 802.15.4 driver to use
the frdm_cr20a shield instead of hardcoding configs for the frdm_k64f
base board. This makes it possible to build mcr20a samples for other
base boards with compatible arduino headers.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-07-09 18:15:45 -07:00
Nicolas Pitre d19a5f9119 net: socket: mgmt: use uintptr_t for the nm_pid field
This may contain a pointer so make sure it is sufficiently wide
on 64-bit targets.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-05 10:06:23 -04:00
Jukka Rissanen 530a1e5415 samples: net: echo_server: Enable SO_TIMESTAMPING if needed
If user has set CONFIG_NET_CONTEXT_TIMESTAMP then enable
network packet throughput collection for UDP packets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-03 09:42:45 +03:00
Jukka Rissanen 645d2b204b samples: net: sock: mgmt: Print IP addresses for each event
Print IP address for added or removed IP address. This helps
to understand what IP address is being removed or added.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-01 13:50:08 -07:00
Jukka Rissanen c283016f3d samples: net: sock: mgmt: Add network management socket app
A simple application that listens network management events
using BSD socket API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-01 13:50:08 -07:00
Anas Nashif 9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 5d001f3e41 cleanup: include/: move misc/byteorder.h to sys/byteorder.h
move misc/byteorder.h to sys/byteorder.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Jukka Rissanen 404ac51055 samples: net: socket: can: Close the socket periodically
This is done only for testing purposes, in real life the socket
would be closed if it is not used or needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Jukka Rissanen ae89c2239b samples: net: can: Add second RX socket receiver
This is done so that we can test socket CAN dispatcher.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Carles Cufi b476643695 doc: Cleanup references to cmake
Clean up some stray references to cmake in doc, boards and
samples that don't make explicit use of the zephyr app extension,
as well as other minor doc fixes.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-06-17 10:09:57 -07:00
Ulf Magnusson a84ded74ea dts: Replace status = "ok" with status = "okay"
The DT spec. only has "okay" and not "ok". The Linux kernel has around
12k "okay"s and 300 "ok"s.

The scripts/dts scripts only check for "disabled", so should be safe re.
those at least.

The replacement was done with

    git ls-files | xargs sed -i 's/status\s*=\s*"ok"/status = "okay"/'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-14 19:51:13 -05:00
Jukka Rissanen 104014154e samples: net: echo-server: Ignore the return value of close()
We are not interested in whether the close() call succeeds or
not when the connection is terminated.

Coverity-CID: 198878
Fixes #16569

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-09 10:23:57 +03:00
Andrei Emeltchenko de26f76ef2 samples: net: echo_server: Fix usbnet configuration
This patch enables USB tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Paul Sokolovsky 08be81d949 samples: sntp_client: Switch from sntp_request() to sntp_query()
sntp_request() was deprecated and superceded by sntp_query(), which
provides better time resolution.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
Jukka Rissanen 59eb48329e samples: net: can: Add missing tag to SocketCAN sample
We should have "net" tag as this is a networking sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-10 22:43:27 +03:00
David B. Kinder c5112327a7 doc: fix mentions of Wi-Fi trademark name
The approved trademark name is Wi-Fi so update references to WiFi and
other spellings to Wi-Fi in documentation and Kconfig help strings.
(Note that use of spelling variatios of "wifi" in module names, CONFIG
names, link names and such are untouched.)

https://www.wi-fi.org/

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-05-06 20:10:59 -04:00
Paul Sokolovsky 901d85bde0 samples: sntp_client: Elaborate sample to workable state
1. Output what steps the app performs, so it doesn't look to user
that it simply hanged.
2. Don't use infinite timeouts, because that will hang.
3. Clearly note which requests are for IPv4 vs IPv6 server.
4. Define IPv4 gateway. This sample is configured to run against
SNTP on local Linux host, but standard distros (e.g. Ubuntu) don't
run SNTP server by default, so usual outcome for running this sample
will be timeout. A realistic way to get successful output would be
to run it against a server on the Internet, for what a gateway is
required.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-04-24 12:50:12 +03:00
Jukka Rissanen a9395157a3 samples: net: dumb_http_server: Check EOF while skipping headers
If recv() returns 0 bytes, then terminate the connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-04-23 13:13:35 +03:00
Jukka Rissanen 3d6ce30f29 samples: net: dumb_http_server: Add net_pkt.h file inclusion
The function net_pkt_get_info() is found in net_pkt.h and not
in buf.h. This caused
"implicit declaration of function ‘net_pkt_get_info’"
warning if CONFIG_NET_BUF_POOL_USAGE was enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-04-23 13:13:35 +03:00
Charles Youse 8e307a3ad9 ethernet/eth_e1000.c: change to new PCI(e) functions
Migrate from "legacy" PCI support (drivers/pci) to new PCI(e) support.

The e1000 driver is merely for testing with QEMU and so should not be
a model for the use of PCI(e) functions. Consult instead "real-world"
PCI(e) drivers like the NS16550 UART (drivers/serial/uart_ns16550.c).

Signed-off-by: Charles Youse <charles.youse@intel.com>
2019-04-22 09:34:00 -07:00
Vincent Wan 751025957a samples: sockets: sntp_client: Add support for cc3220sf_launchxl
This commits adds a configuration file for cc3220sf_launchxl
suitable for the example.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-04-19 13:54:21 -05:00
Vincent Wan be5bfb6169 samples: sockets: sntp_client: make IPv6 & NET_CONFIG_SETTINGS optional
In this commit, a config.h header file is added to support the case
when the NET_CONFIG_SETTINGS is not used. main.c is also modified to
enable platforms that do not support IPv6. These changes are necessary
in order to allow cc3220sf_launchxl support.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-04-19 13:54:21 -05:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Anas Nashif da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Patrik Flykt 21358baa72 all: Update unsigend 'U' suffix due to multiplication
As the multiplication rule is updated, new unsigned suffixes
are added in the code.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Paul Sokolovsky 946836577b samples: sockets: Add e1000 and stellaris ethernet drivers overlays
Add qemu ethernet driver overlays for big_http_download and
dumb_http_server samples, which are default integration samples/
tests for TCP stack. This change follows up after similar addition
of such overlays to other samples (and smsc911x overlay addition
to these samples).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-26 07:29:40 -05:00
Tedd Ho-Jeong An 5d35b66327 Samples: net: can: initialize the variables
Initialize the variables.

Fix Bug: #14819
Coverity CID: 196637

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-24 10:55:06 -05:00
Vincent Wan 111dab4a25 samples: sockets: echo_async: Add support for cc3220sf_launchxl
Adding support for cc3220sf_launchxl by introducing a board-specific
Kconfig file.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-20 11:36:18 -05:00
Vincent Wan 734e247d02 samples: sockets: echo_async: Make IPV6 optional
Changing the example to not use IPv6 when it is not configured,
given IPv6 is not enabled on some platforms such as cc3220sf_launchxl.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-20 11:36:18 -05:00
Robert Lubos e39aed53a2 samples: net: Update overlay-bt.conf in various samples
`CONFIG_NET_L2_BT` no longer forces required BT configuration, but
depends on a user to set a valid configuration instead. Hence, we
need to select a proper configuration in the overlay config file.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-03-20 11:32:40 -05:00
Tedd Ho-Jeong An 980cf393f0 Samples: echo-client: Add overlay when echo-server is running on Linux
This patch adds the overlay when the echo-server is running on Linux and
echo-client is running on Qemu.

Fix: #14654

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-20 11:31:57 -05:00
Marcio Montenegro 69613cad6a samples: net: sockets: echo_client : Fix tcp_stop() error
Check for an open socket, 0 is a valid file descriptor.

Signed-off-by: Marcio Montenegro <msam@cesar.org.br>
2019-03-18 11:34:47 -05:00
David B. Kinder 6000a6205a doc: prepare for improving doc API linking
Linking to API material requires knowing the pecularities of how
doxygen, sphinx, and breathe work. In an attempt to hide some of this
we're preparing the current docs to allow use of configuration defaults
that will let us more simply use a default role that will hunt for a
reference target in the various domains that are available by using a
default "role" of "all".  This will let us use the simple notation
`functionname` or `typename` without fully specifying the reference as
:c:func:`functionname`.

This patch cleans up exising docs that were (incorrectly) using single
backtics where double backtics should have been used, and also found
some typos (such as a space between the role name and the reference,
such as :file: `filename`, and a missing colon such as
c:func:`functionname`)

This is a start to address issue #14313

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-15 05:47:19 +01:00
Jukka Rissanen e7107ba562 samples: net: can: Readme file was missing
The socket CAN application was missing a README.rst file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 15:57:48 -05:00
Jukka Rissanen e7ce08a2ac samples: net: can: Send and receive can_frame type of data
The CANBUS sockets require "struct can_frame" to be used in order to be
compatible with Linux code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Jukka Rissanen d2ce588441 samples: net: can: setsockopt() requires can_filter
The CANBUS sockets require can_filter to be used in order to be
compatible with Linux code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Paul Sokolovsky 7e81aca961 samples: sockets: echo: Better error checks
Check socket fd return results.

Fixes: #11086, #11087
Coverity-CID: 189519, 189520

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-13 05:38:10 -05:00
Tedd Ho-Jeong An 19ed83c723 samples: sockets: echo_async: Check return value of setsockopt
This patch checks the return values of setsockopt.

Fixes: #14392, #14402
Coverity-CID: 195897, 195848

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-13 05:37:28 -05:00
Ravi kumar Veeramally 718dd56d38 net: samples: Fix packet socket sample iface index
Patch (3206568e43) changed network
interface numbering starts from 1. The index 0 is reserved.
So use api to get default interface index for packet socket sample.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-03-11 20:56:11 -07: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
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
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
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
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 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
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
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
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
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
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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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 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
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
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
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
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
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
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
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
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
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
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