Commit graph

1640 commits

Author SHA1 Message Date
Kumar Gala 188cf2331b samples: lwm2m_client: Rework to not define generated macros
Rather than redefining a macro which might be generated we should create
a new define name that should get used in the code.  Replace redefining
DT_ALIAS_LED0_GPIOS_* and just use the LED_GPIO_* defines that already
exist.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 15:28:20 -05:00
Stephanos Ioannidis 460cb7880c samples: net: Rename local PORT definition
This commit renames all local definitions with the name `PORT` in the
net samples, in order to prevent name conflict with certain HALs
(notably, Atmel SAM E5x HAL).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-28 09:57:04 +03:00
Kumar Gala dbeb3ba32e drivers: spi: spi_sam: rework device tree support
Reworked spi_sam driver to utilize new DT_INST macros as part of
this rework we also now get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from dts_fixup.h and soc_pinmap.h and associated
Kconfig symbols that are no longer needed due to getting all that
information from devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:29:54 -05:00
Johann Fischer c15d27fb6d samples: wpan_serial: relax wait-for-dtr loop
Relax wait-for-dtr loop and give CPU resources to
low priority threads like logging.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-04-22 17:37:27 +02:00
Johann Fischer 8220f61eaf samples: wpan_serial: enable USB during sample initialization
Application is reponsible to enable USB.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-04-22 17:37:27 +02:00
Peter Bigot 45f126f871 coccinelle: re-run timeout conversion semantic patch
This fixes a variety of K_THREAD_DEFINE issues that were missed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-15 08:28:57 -05:00
Kumar Gala 5a149dfca6 drivers: serial: uart_mcux: Convert to DT_INST
Convert driver to use new DT_INST macros throughout.  Removed per
instance Kconfig symbols and replaced with DT_NODELABEL references where
needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-14 17:52:31 -05:00
Anas Nashif b90fafd6a0 kernel: remove unused offload workqueue option
Those are used only in tests, so remove them from kernel Kconfig and set
them in the tests that use them directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Robert Lubos 073ec8d4aa net: mqtt: Refactor because of timeout overhaul
Align MQTT with timeout API changes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-09 21:58:42 +03:00
Paul Sokolovsky 8eac618cba samples: big_http_download: Add automated-CI friendly sanitycheck config
This application was initially intended to be a manual, interactive
sample, run by a user. However, it's also a useful real-world
integration test, to be run in automated CI systems. So, provide
a config suitable for such a usage: use local host machine as a
server (to not depend on availability and characteristics of an
Internet connection), and have a concrete completion criteria
(by limiting number of iterations; given that performance of TCP
is not to be not too high, limit it to just 1 for now).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-09 18:40:03 +03:00
Paul Sokolovsky 761aa6c52b samples: big_http_download: Allow to configure number of iterations
Initially, this was intended to be a sample for manual "burnout"
testing, e.g. see if a device with it can run for 24hrs, or download
1GB of data, or similar.

It's however also useful for automated CI testing, but then we need
to have more specific completion criteria. So, allow to specify
number of download iterations via local Kconfig.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-09 18:40:03 +03:00
Paul Sokolovsky 2dd38a7e88 samples: big_http_download: Allow to configure URL via Kconfig
To streamline management of multiple test configurations (which
now can go into separate config/overlay files instead of patching
source).

Note that now that this option is introduced, it must be set to
a correct value for any Zephyr config, thus we set it in
overlay-tls.conf. But the sample also supports building under a
POSIX environment (using Makefile.posix), which doesn't use
Zephyr's config system, so suitable defaults still should be
present in the C source file.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-09 18:40:03 +03:00
Kumar Gala 35cad0884a dts: soc: atmel: sam: cleanup node labels to match SoC docs
Update dts files to use node labels that match Atmel SoC docs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-09 09:02:19 -05:00
Jukka Rissanen 88d1d43842 samples: net: zperf: Refactor because of timeout overhaul
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 92e8422a40 samples: net: big_http_download: Fix to use proper data type for sleep
Needed because of k_timeout_t conversion

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen a85d1e0e74 samples: net: syslog: Fix to use proper data type for sleep
Needed because of k_timeout_t conversion

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen da2488d96e samples: net: net_mgmt: Fix compile issues from timeout overhaul
Feed proper time delay parameter to K_THREAD_DEFINE()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 36b151c566 samples: net: echo_client: Fix compile issues from timeout overhaul
Use proper timeout value for poll()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen bfa3e80ca0 samples: net: echo_server: Fix compile issues from timeout overhaul
Feed proper time delay parameter to K_THREAD_DEFINE()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 8c67575a08 samples: net: coap: Fix the timeout data type
Converting timeout to k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 0a8991773b samples: net: dumb_http_server_mt: Fix K_THREAD_DEFINE() call
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 5cf75fe091 net: websocket: Refactor because of timeout overhaul
Mention in websocket API documentation that the timeout value
is in milliseconds. Check timeout values properly using K_TIMEOUT_EQ()
macro.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 1b04d44247 net: http: Refactor because of timeout overhaul
Use k_timeout_t internally, no change to user API.
Clarify the documentation of the timeout parameter that it is
in milliseconds.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 8a9153678a net: sntp: Refactor because of timeout overhaul
Use 64-bit time in order to avoid overlaps, and do not use K_MSEC()
as that will convert to k_timeout_t which we do not want in this
case.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen a49741ff66 net: dns: Refactor because of timeout overhaul
Use k_timeout_t internally, no change to user API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Carles Cufi 6656214af2 boards: nrf52_pca10040: Rename to nrf52dk_nrf52832
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832.  Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Andrzej Głąbek 97b07b943a drivers/serial/Kconfig.nrfx: Choose driver type basing on DT compatible
Remove prompts from Kconfig options `UART_x_NRF_UART*` that select
the type of nrfx driver (for UART or UARTE peripheral) to be used
for a given instance. This prevents the options from being modified
from configuration files.
Instead, make one of these options selected by default according to the
"compatible" property set for the corresponding UART node in devicetree.

This eliminates the need of changing both the "compatible" property in
devicetree and the Kconfig option selecting the driver type when a user
wants to switch between UART and UARTE for a given instance.

Since all `UART_x_NRF_UART*` options are made "hidden" by this commit,
all their occurrences in configuration files are removed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-04-03 14:47:32 +02:00
Robert Lubos 1fb418df4c net: ieee802154_radio: Allow to specify TX mode
Even though radio driver can report in its capabilities that it does
support CSMA CA, there's no way in the driver to select how the frame
should be transmitted (with CSMA or without). As layers above radio
driver (Thread, Zigbee) can expect that both TX modes are available, we
need to extend the API to allow either of these modes.

This commits extends the API `tx` function with an extra parameter,
`ieee802154_tx_mode`, which informs the driver how the packet should be
transmitted. Currently, the following modes are specified:
* direct (regular tx, no cca, just how it worked so far),
* CCA before transmission,
* CSMA CA before transmission,
* delayed TX,
* delayed TX with CCA

Assume that radios that reported CSMA CA capability transmit in CSMA CA
mode by default, all others will support direct mode.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-03 14:07:41 +03:00
Tomasz Bursztyka a497bfa455 samples/net: Enable power management statistics for frdm k64f
On echo server app only.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-04-02 11:07:45 +03:00
Johan Hedberg a03a54f00c net: samples: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() macro to pass a timeout to k_sleep().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-01 20:03:15 +03:00
Kumar Gala a027c94613 samples: net: wifi: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 0cd03a6ebe samples: net: gsm_modem: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Stephanos Ioannidis 14573bdb3a samples: net: gptp: Remove Kconfig MAC address for sam_e70_xplained
This commit removes the Kconfig MAC address configurations for the
`sam_e70_xplained` board, as these have been migrated to use the device
tree configurations.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-31 08:08:29 -05:00
Kumar Gala 3d2eb34e8e samples: lwm2m_client: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-30 16:40:01 -05:00
Gerson Fernando Budke 5f5919a900 lib: updatehub: Fix buffer sizes
The MAX_PAYLOAD_SIZE must reflect the size of COAP_BLOCK_x. This is
necessary becase BLOCK size represents max payload size. The current
value create inconsistencies for coap lib. The same way,
MAX_DOWNLOAD_DATA must allocate sufficient space for MAX_PAYLOAD_SIZE
plus all space for coap header etc.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2020-03-30 16:54:29 +03:00
Andrzej Głąbek 386e5ba81c samples: echo_server: Fix missed renaming of nrf52840_pca10056
This is a follow-up to commit 4253eae005.

The board known earlier as nrf52840_pca10056 is now named
nrf52840dk_nrf52840.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-30 13:27:37 +02:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Tomasz Bursztyka df368e8094 samples/net: Adding relevant parts to test PM on echo server
Just to get something to test for PM, via frdm_k64f board. So only this
board will get PM enabled.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Andrzej Głąbek 4253eae005 boards: nrf52840_pca10056: Rename board to nrf52840dk_nrf52840
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-27 09:14:08 +01:00
Patrik Flykt c99392f2d6 scripts: net: Add TLS test for mqtt_publisher
In addition to the existing plain TCP MQTT test, add the same test
with TLS applied. Robert Lubos provided the updated test_cert.h, which
contains the same certificate as in the echo samples.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-25 08:39:39 +02:00
Markus Becker 63e592f8f6 net: openthread: Add NCP sample
OpenThread NCP sample application.

Tested on FRDM-K64 with RF2XX connected via USB to a Linux machine
running wpantund.

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-03-25 08:37:16 +02:00
Ravi kumar Veeramally cd679452b2 samples: net: azure: Add support for subscribe
Cloud to device communication supported with simple
subscribe topic details. Details are added for how to send
messages from cloud.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-03-19 11:09:44 +02:00
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
Jukka Rissanen 7b8aca3de2 samples: net: cloud: Fix the mqtt_azure sample location
The path to the mqtt_azure sample was not correct.
Original patch by Benjamin Cabé.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-03-17 10:25:48 -04:00
Patrik Flykt 984e8ac6bc samples: net: mqtt_publisher: Add exit code and Kconfig options
Modify the mqtt_publisher sample app to return an exit code after
its tests have been run. Add Kconfig options to set the number of
test iterations per TCP connection as well as the number of TCP
connections to make to the server while keeping the default values
intact. Further add a config overlay file to lower the number of
TCP connections and test iterations used.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-17 13:14:41 +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
PK Chan ba8bb44661 samples: net: mqtt_publisher: demo for ping request and response
Once the MQTT ping response has been received from the server, the
application is then notified with the MQTT_EVT_PINGRESP event.

Signed-off-by: PK Chan <pak.kee.chan@nordicsemi.no>
2020-03-12 11:07:14 +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
Robert Lubos 2e80185b59 samples: lwm2m_client: Add support for queue mode
Add support for the queue mode in the lwm2m_client sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-03-10 14:57:29 +02:00
Jukka Rissanen 48a1a2ef81 samples: net: gsm_modem: Add README file
Add documentation to the GSM modem sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-18 18:52:43 +02:00
Robert Lubos da98c88cdb samples: net: telnet: Add BLE IPSP overlay config
Add `overlay-bt.conf` file to enable easy builds for boards supporting
BLE IPSP.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-02-12 10:22:49 +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
Jukka Rissanen ed7dd4412c sample: net: gsm_modem: Add sample.yaml file
sample.yaml is needed so that we can do some sanity checks
for the GSM modem code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-11 13:49:22 +02:00
Jukka Rissanen fe6ebd5b75 samples: net: modem: Add net and modem shells
Enabling modem and net shells which is useful for debugging
things.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-06 10:19:25 +02:00
Carles Cufi 07ecb817ff samples: net: google_iot: Fix logging warnings
Clean up the logging warnings due to invalid formatting.

Fixes #22510.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-06 10:00:49 +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
Johann Fischer 4046de5cae samples: wifi: add config to test winc1500 driver
Add reel board config to test winc1500 driver.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Tomasz Bursztyka a40e9d3762 drivers/wifi: Switch WINC1500 to new GPIO API
Use new API to configure and interact with GPIOs.  Move GPIO
initialization from sample into driver.  The existing physical/line
level control has been kept rather than converting to logical level
signals.

Also improve error messages.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi af21f80d33 samples: net: lwm2m_client: Convert to new GPIO API
Convert the sample to use the new API and its features.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01: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
Jukka Rissanen 529195e276 samples: net: modem: Remove extra DTS setting from cmake
The setting was commented anyway, so removing it for now.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +02:00
Jukka Rissanen 7b22f683d0 samples: net: modem: Fix the name of the app
The name of the application was wrong.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +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
Michael Scott 5476e0b365 samples: net: mqtt_publisher: add return value to wait()
In order to better handle incoming data, wait() should return
the # of sockets with data returned by poll().

Based on this new return value, we can call mqtt_input() in a
smarter way.

Signed-off-by: Michael Scott <mike@foundries.io>
2020-01-28 15:45:08 -05:00
Michael Scott 3e24eb8af1 samples: net: mqtt_publisher: handle EAGAIN from mqtt_live()
Now that mqtt_live() can send an EAGAIN message meaning: no ping
was generated, let's handle that in process_mqtt_and_sleep() by
skipping the call to mqtt_input() since no data will be expected.

Signed-off-by: Michael Scott <mike@foundries.io>
2020-01-28 15:45:08 -05: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
Patrik Flykt 10fb64f4dc samples: net: Create sample app for GSM modems
Sample app compiled with the GSM modem driver enabling PPP.

This sample was tested with a Reel Board UART_1 connected via the
external board/connector and a FONA 808 modem. Reel board specific
suppor is found in boards/.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-01-28 12:44:17 +02:00
Ulf Magnusson cf89ba33ea global: Fix up leading/trailing blank lines in files
To make the updated test in
https://github.com/zephyrproject-rtos/ci-tools/pull/121 clean, though it
only checks modified files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-27 17:41:55 -06:00
Peter Bigot 344c109f02 treewide: use full path to wifi/winc1500.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 02ae343100 treewide: use full path to uart.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 81ca8888db treewide: use full path to hwinfo.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Jukka Rissanen 16805018bb samples: net: dns: Small refactoring
Moving the code around and enhancing debug prints. No changes in
functionality.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-24 16:22:18 +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
Anas Nashif 91920268e0 net: remove sample implementing NATS
A sample implementing NATS protocol that is not part of the Zephyr
networking subsystem. The implementation is not maintained and only
served as a proof of concept.

Related to #20017

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-22 13:55:52 -05: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
Gerson Fernando Budke e393a26270 samples: wpan_serial: Update doc with build instructions
This add details how build and flash the application. This diferentiate
between SoC and transceivers to help understand what user need to do to
build and flash successfully.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-18 12:28:24 +02:00
Gerson Fernando Budke 38b5aed2ad samples: wpan_serial: Fix device binding error msg
This drop CC25xx reference on debug messages.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-18 12:28:24 +02:00
Gerson Fernando Budke 0618659a19 samples: wpan_serial: Add rf2xx transceiver overlay
Create overlay-rf2xx.conf overlay file to enable Atmel rf2xx
transceivers on this application.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-18 12:28:24 +02:00
Robert Lubos bb32e9e3fb samples: net: mqtt_publisher: Remove mqtt_input after mqtt_disconnect
This function call is no longer needed for a proper disconnect.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-16 21:02:28 -05: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
Gerson Fernando Budke 7e4216a6c9 samples: wpanusb: Add atsamr21_xpro board support
Define CONFIG_NET_CONFIG_IEEE802154_DEV_NAME value necessary to enable
atsamr21_xpro board on wpanusb sample.

The documentation was updated referencing the atsamr21_xpro board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-16 10:47:10 +02:00
Ulf Magnusson 7e0af9e0b8 kconfig: Remove redundant $ZEPHYR_BASE from 'source's
The $srctree environment variable is already set to point to the Zephyr
root, so no need to do

    source "$(ZEPHYR_BASE)/Kconfig.zephyr"

in samples. Just

    source "Kconfig.zephyr"

works.

(Things would break if $srctree was set to anything else, because every
'source' in the Kconfig files will be relative to it.)

Also add a 'mainmenu' title to the littlefs sample. It shows up at the
top of menuconfig/guiconfig. Source Kconfig.zephyr instead of Kconfig to
avoid overriding it.

As a sidenote, $(FOO) is better $FOO in Kconfig. $FOO is legacy syntax
that Kconfiglib only supports to be compatible with old Linux kernels.
$(FOO) uses the Kconfig preprocessor.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-06 09:48:53 -05: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