Commit graph

294 commits

Author SHA1 Message Date
Jukka Rissanen cf720f9882 samples: net: echo-server: Wait network interface before starting
No use starting the application if the network interface is down.
So start to listen connection management events and start the
TCP and UDP handlers only after network is up and ready.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-03-17 17:17:20 +02:00
Paul Sokolovsky bbb4355cf7 samples: sockets: big_http_download: Increase stack size by 128 bytes
Without it, the sample crashes for qemu_x86 with:

[00:00:03.080,000] <err> os: Page fault at address 0x7275632f
  (error code 0x10)
[00:00:03.080,000] <err> os: Linear address not present in page tables
[00:00:03.080,000] <err> os: PDPTE: Non-present
...

Increase by reasonable, but small amount, to keep watching stack usage
growth trends in Zephyr.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-03-16 18:23:57 +02:00
Oleg Zhurakivskyy d11c92b60b samples: echo_client: Add overlays for debugging
Add overlays that might be useful for debugging:

- overlay-log.conf
   Enable debug log for socket, context, connection, TCP/TCP2.
- overlay-debug.conf
   Disable optimization and compile with debug information.
- overlay-max-stacks.conf
   Overlay to quickly sort out insufficient stack problems.
- overlay-e1000.conf

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-11 16:24:52 +02:00
Oleg Zhurakivskyy 71a225d76f samples: echo_server: Add overlays for debugging
Add overlays that might be useful for debugging:

- overlay-log.conf
   Enable debug log for socket, context, connection, TCP/TCP2.
- overlay-debug.conf
   Disable optimization and compile with debug information.
- overlay-max-stacks.conf
   Overlay to quickly sort out insufficient stack problems.
- overlay-e1000.conf

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-11 16:24:52 +02:00
Oleg Zhurakivskyy e0c151b9cf samples: net: sockets: tcp: Add a TCP sample and instructions
In order to run the TTCN-3 based sanity check, add a TCP
sample app and instructions for running the sanity check.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-11 16:24:52 +02:00
Gerson Fernando Budke 19e6497d32 samples: net: sockets: echo_server: Update README.rst
Add information about how to build and test atsamr21_xpro board with
IEEE 802.15.4 RF2xx driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke cc91a734d9 samples: net: sockets: echo_server: Add sam_v71_xult config
Add necessary configuration to run demo on the sam_v71_xult board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 2d960aeeb7 samples: net: sockets: echo_server: Add sam4e_xpro config
Add necessary configuration to run demo on the sam4s_xpro board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 97f210bce0 samples: net: sockets: echo_server: Add atsamr21_xpro config
Add special configuration for SAMR21 SoC. Since it have only 32k SRAM,
all possible application buffers need to be shrinked.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 9d9b248965 samples: net: sockets: echo_client: Update README.rst
Add information about how to build and test atsamr21_xpro board with
IEEE 802.15.4 RF2xx driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 850a200b41 samples: net: sockets: echo_client: Add sam_v71_xult config
Add necessary configuration to run demo on the sam_v71_xult board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 3f6029dd80 samples: net: sockets: echo_client: Add sam4s_xplained config
Add necessary configuration to run demo on the sam4s_xplained board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke cfe1ce967c samples: net: sockets: echo_client: Add atsamr21_xpro config
Add special configuration for SAMR21 SoC. Since it have only 32k SRAM,
all possible application buffers need to be shrinked. This
configuration was tested with two boards for more than 2H with success.

[02:18:57.635,00] net_echo_server_sample: IPv6 UDP: Sent 333000 packets

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Michael Scott 2c7e420a8e samples: net: echo_client: handle net if mtu
UDP portion of the echo_client sends 1 packet with the sample data.
(TCP can send chunks of it depending on the response of the send()
function.)  Not every network interface can send a UDP packet large
enough to handle the size of the sample data.

Let's make sure to account for the network interface MTU when deciding
the amount of sample data to send.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/22447

Signed-off-by: Michael Scott <mike@foundries.io>
2020-02-05 15:54:57 +02:00
Vincent Wan 47a51d4698 samples: http_get: exclude cc32xx for sample.net.sockets.http_get.posix
Eliminates CI build warnings such as this which breaks the build:

  warning: NET_SOCKETS_POSIX_NAMES
  (defined at subsys/net/lib/sockets/Kconfig:13) was assigned the value
  'n' but got the value 'y'.

The testcase involves no offloading, which means it does not apply to
cc32xx.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 10:41:08 +02:00
Vincent Wan 801077f03e samples: http_get: fix build warnings on cc32xx
This PR eliminates the Kconfig warnings seen in build by setting the
options to the appropriate values for cc32xx platforms. They were
causing CI failures.

Fixes #22388

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 10:41:08 +02:00
Patrik Flykt dbd3439cf9 samples: net: echo_client: Add Kconfig option to run a number of times
Add Kconfig option NET_SAMPLE_SEND_ITERATIONS that sets the number of
times the Zephyr echo client sample sends its data. By default the
value is zero, which means indefinite, and demonstrates the same
behavior as before.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-02-03 09:04:12 -05:00
Anas Nashif e3acaa10e4 samples: net: set CONFIG_NET_BUF_RX_COUNT to 64
This count is assigned to CONFIG_BT_ACL_RX_COUNT which expects a number
in the range of 1-64, otherwise kconfig fails.

Fixes #22259

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-31 15:03:28 -05:00
Robert Lubos ece552c644 drivers: wifi: simplelink: Rework offloading mechanism
Switch to `NET_SOCKET_REGISTER` mechanism over the offloaded API
registration.

Including the following fixes from the review:

* The fd returned by the socket accept call needs to be finalized,
  similar to how it is done for socket creation.

* sl_RecvFrom() in TI SimpleLink Host driver does not support NULL
  pointers for 'from' address and address length, and sl_SendTo() does
  not ignore the destination address when in connection mode, so passing
  NULL would cause a failure. These issues have been reported to TI
  (CC3X20SDK-1970, CC3X20SDK-1971).

  Let's use sl_Recv and sl_Send to implement recvfrom/sendto in the case
  of NULL addresses.

* simplelink_poll() should not process negative file descriptors in the
  fds array after sl_Selecti() returns. A negative fd value indicates
  that the entry is invalid and should be ignored.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-31 11:36:02 -05:00
Magne Værnes e02eb4e511 samples: net: echo_client/_server: Fix bug in socket close
Fixed bug in udp.c in echo_client and echo_server samples.
The bug causes UDP sockets to not close if socket id is 0.

Signed-off-by: Magne Værnes <magne.varnes@nordicsemi.no>
2020-01-30 12:33:30 +02:00
Jukka Rissanen 1d324a1b20 samples: net: echo-server: Fix compile error for missing IP proto
Make sure that the echo-server compiles ok if IPv6 or IPv4 is
disabled when VLAN is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-30 09:42:07 +02:00
Jukka Rissanen 748eb99646 samples: net: websocket: Verify the received data properly
Make sure that we do not calculate terminating \n when comparing
the received data to sent data because the \n is not part of
the lorem_ipsum buffer.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-28 19:49:16 +02:00
Ravi kumar Veeramally 326302eda0 samples: net: echo_server: Do not bail out on Accept errors
Echo-server sample should not bail out on failed
accept() calls. This sample should close socket
in case of any errors and keep listening on socket
for further incoming connections.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-01-23 21:07:18 +02:00
Ravi kumar Veeramally d228dd0c85 samples: net: echo_server: Add signed certs and keys
Current sample certs and keys are not signed. Adding
signed certificates and keys. CA file also added.
This helps users to test with different kind of
configurations.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-01-23 21:07:18 +02:00
Ruslan Mstoi aa53024fdc net: tcp2: Double main stack size to fix QEMU crash
QEMU running TCP2 echo crashes upon start. This patch doubles main stack
size to fix the crash.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-01-20 10:01:08 +02:00
Robert Lubos 665d195f3a net: sockets: tls: Add missing symbols for a few options
`TLS_PEER_VERIFY` and `TLS_DTLS_ROLE` options accept specific values,
yet no symbols were defined for them. In result, magic numbers were used
in several places, making the code less readable.

Fix this issue, by adding the missing symbols to the `socket.h` header,
and using them in places where related socket options are set.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-20 09:58:23 +02:00
Robert Lubos b3a1ede830 net: openthread: Use settings subsystem
OpenThread settings implementation built on top of Zepyhr settings
submodule.

With this solution, OpenThread settings are identified with keys of
the following format: `ot/id/instance`, where `id` is assigned by
OpenThread stack, and `instance` is a 32-bit random number, both in
hex. The implementation makes use of `settings_load_subtree_direct`
function to iterate over settings instances. This allows the
OpenThread settings layer to be a fully transparent shim layer between
OpenThread/Zephyr APIs.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-16 17:12:47 -06:00
Paul Sokolovsky b3ef46ed63 samples: sockets: big_http_download: Increase stack size.
x86-mmu now crashes with default 1K, bump to 2K, which hopefully might
work even for 64-bit archs.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-01-04 09:19:16 -05:00
Oleg Zhurakivskyy f4ebf53cfb samples: sockets: echo: Include stdlib.h
Include stdlib.h to suppress a missing declaration
warning for exit() when compiled as a Linux target.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-01-02 13:07:19 -08:00
Paul Sokolovsky feac5c1c45 Revert "samples: sockets: Don't open the socket if the test protocol is enabled"
This reverts commit da0f3311ff. It was
clearly intended to be a debugging aid when developing TCP2, not
intended for mainline. This fixes building this sample on POSIX
systems with Makefile.posix.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-12-17 18:09:19 +02:00
Alberto Escolar Piedras 0b8678a2b0 samples & tests: Correct main() type
The application main() in Zephyr is defined as having a prototype:
void main(void), as expected by the kernel init (bg_thread_main).

So, correct the different samples and tests that were defined
otherwise.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-12-16 11:27:56 +01:00
Vincent Wan f1c0eb915b samples: http_get: connect without TLS by default on cc3220sf_launchxl
The example should work on the cc3220sf_launchxl by following the same
flow as on other boards, ie. by connecting with plain http by default
and use TLS only when an overlay is specified. We update the
configuration for cc3220_launchxl to not use TLS by default and the
README to point users to the right overlay file to use.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-12-12 10:53:26 -06:00
Ulf Magnusson 984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Kumar Gala 9415a114a0 include: Fix use of <json.h> -> <data/json.h>
Fix #include <json.h> as it has been deprecated and
should be #include <data/json.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Jukka Rissanen 3dcefbb316 samples: net: echo-server: Generate coverage report
Add "sample quit" shell command which can be used to stop the
sample application and allows the generation of coverage report.

Fixes #21099

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-09 16:34:18 -05:00
Robert Lubos 6b2a371272 samples: net: Remove redundant frdm_kw41z configs from echo samples
echo_client and echo_server configuration for 802.15.4 and OpenThread is
covered by overlay files and default board configuration. Board-specific
configuration for frdm_kw41z was redundant in this case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-09 12:47:45 -05:00
Erwan Gouriou fc65ab137e samples/net: civetweb: Remove SOC_SERIES_SAME70=y in prj.cnf
For some reasons SOC_SERIES_SAME70 was selected in civetweb sample,
which prevents build on other platforms.
This issue was silent since sample yaml file limits sample testing on
sam_e70_xplained.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-11-27 15:18:31 -05:00
Oleg Zhurakivskyy 516525fcd8 samples: net: echo-server: Increase the stack size for the coverage
echo_server crashes if the coverage is enabled due to the insufficient
stack size.

Use bigger stack size when the coverage is enabled.

Fixes #20797

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-11-27 10:14:20 +01:00
Ravi kumar Veeramally bb40f9b0cd samples: net: Fix WS client Coverity issue
Close the socket and return the error.

Fixes #20508
Coverity CID :205634

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-11-26 08:22:35 -05:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Jukka Rissanen 0f30bb23ab samples: net: echo-server: In case of socket error quit the app
Quit the accept loop if there is a socket related error as there
is no point of continuing in this case.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-28 13:58:59 +02:00
Torstein Grindvik b422e4a8ea samples: Add PSK support for echo client/server
PSK support is added to echo-client.c and echo-server.c.
If enabled, a header is included which contains the PSK.
If the default dummy PSK header is used, a warning is issued.
The header can be changed via Kconfig.

Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
2019-10-28 13:02:29 +02:00
Daniel Leung b7eb04b300 x86: consolidate x86_64 architecture, SoC and boards
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.

() Removes the x86_64:x32 architecture and SoC, and replaces
   them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
   qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-10-25 17:57:55 -04:00
Oleg Zhurakivskyy 807662bf52 samples: net: echo-server: Increase the stack size for TCP2
Executing on qemu_x86 leads to stack overflows.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-10-25 14:33:37 +03:00
Oleg Zhurakivskyy da0f3311ff samples: sockets: Don't open the socket if the test protocol is enabled
In order to be able to run the sanity check, don't open the socket
if the test protocol is enabled.

Also add a debug print at the recv().

This commit will be dropped:

- As soon as the sanity check site accomodates
- As soon as the integration is complete

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-10-25 14:33:37 +03:00
Oleg Zhurakivskyy 2435629f61 net: tcp2: Add an overlay to enable E1000 Ethernet
This overlay is for the validation purpose.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-10-25 14:33:37 +03:00
Oleg Zhurakivskyy c08ebf6726 net: tcp2: Add an overlay to set the debug log levels
This overlay is for the validation purpose.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-10-25 14:33:37 +03:00
Oleg Zhurakivskyy 3dbbafb1d5 net: tcp2: Add an overlay for TCP2
Add an overlay for TCP.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-10-25 14:33:37 +03:00
Jukka Rissanen 50f30919df samples: net: Add a multithreaded dumb HTTP server
This adds a multithreaded dumb HTTP server sample application similar
to dumb_http_server with following differences

* support both IPv4 and IPv6 simultaneously
* support multiple incoming connections
* support TLS connections
* ignore POSIX compatibility

This app can be used for testing. Note that the app will always
serve a same static HTML page to caller regardless of HTTP request
parameters.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-23 14:43:25 +03:00
Jukka Rissanen 25c8f60fc3 samples: net: dumb_http_server: Using code block when needed
The ab command example needs to be inside code-block.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-16 16:47:37 +03:00
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