Commit graph

1640 commits

Author SHA1 Message Date
Vincent Wan 0d2f5a788a samples: sockets: echo_async: add IPv6 support for TI CC32xx
On TI CC32xx, the same port number cannot be bound to different
sockets. Instead, when an IPv6 socket is bound it can handle both IPv4
and IPv6 connections.

Signed-off-by: Vincent Wan <vwan@ti.com>
2020-07-21 15:08:56 +02:00
Piotr Szkotak a6b0a3a263 net: openthread: make diag compile
Fix compilation error when the DIAG module is enabled.
All core functionalities are provided.

Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
2020-07-20 14:40:29 +03:00
Gerson Fernando Budke 0dbef20149 boards: shields: esp_8266: Add std headers overlay
The current shield version shows different configuration, including
disabling default ethernet and wifi interfaces.  To allow easy
connection from standard headers, this add two new shield designations.
The existing boards overlays and defconfig were updated.

The documentation was update to reflect changes. A new supported
variations section helps to understand what shield variation user need
select to build their own system.

This changes requires changes on esp32 offload tests to reflect new
esp_8266 shield designations. Sam4e_xpro was keeped as the only one
with dedicated overlay and both frdm_k64f and disco_l475_iot1 were
moved to use standard arduino r3 header using extra args.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-17 11:38:28 +02:00
Gerson Fernando Budke 7b4bdf3bc7 samples: net: echo_server: Enable atmel_rf2xx tests
Add atmel_rf2xx shield on test list.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke a9780f34a3 samples: net: echo_client: Enable atmel_rf2xx tests
Add atmel_rf2xx shield on test list.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke ebd1d5478b samples: net: echo_client: Update samr21_xpro configs
After Zephyr 2.3.0 release system uses more RAM.  This update
samr21_xpro configuration to allow echo_client be equal to
echo_server configs and remove unnecessary definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke 3f5eb6f0e6 samples: net: echo_server: Update samr21_xpro configs
After Zephyr 2.3.0 release system uses more RAM.  This update
samr21_xpro configuration to allow echo_server run again and
remove unnecessary definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke d167205916 samples: net: echo_server: Rem unnecessary configs
The sam4e_xpro and sam_v71_xult configs are unnecessary.  Now
atmel_rf2xx shield will complement all necessary configuration.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke 4f107a7705 samples: net: echo_client: Rem unnecessary configs
The sam4s_xplained and sam_v71_xult configs are unnecessary.  Now
atmel_rf2xx shield will complement all necessary configuration.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Alexander Kozhinov 830f72b91c samples: net: sockets: big_http_download: Extend progress metrics
extended download progress metrics to Bytes, KiB and MiB
separate number of download iterations for INF and numeric case

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-07-11 14:56:13 +04:00
Peter Bigot 9dc7640ede spi-device: set CS gpio flags for all devices that had none
The generic SPI GPIO chip select support now respects devicetree flags
for signal active level.  Update all cs-gpios properties to specify
active low.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Flavio Ceolin c4f7faea10 random: Include header where it is used
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-07-08 21:05:36 -04:00
Alexey Markevich 2d8e71ba0c samples: net: google_iot_mqtt: fix CONFIG_CLOUD_CLIENT_ID value
According to
https://cloud.google.com/iot/docs/how-tos/mqtt-bridge#configuring_mqtt_clients
MQTT client ID format.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-07-07 16:26:51 -04:00
Marek Porwisz 311dd73517 samples: openthread: remove redundant configuration options
Some of the settings are no longer needed in the sample as OpenThread
configuration manages it by itself.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-06-30 07:48:08 -04:00
Jukka Rissanen db9dca059e samples: net: echo-server: Add userspace support
Allow echo-server to start TCP/UDP threads in user mode for
testing purposes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-23 18:17:15 +03:00
Alexey Markevich 7b2b957cbd samples: net: google_iot_mqtt: remove unused definition
Remove unused definition.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-23 00:32:57 +03:00
Alexey Markevich 079f158451 samples: net: google_iot_mqtt: use sntp_simple
Simplify overall scenario using sntp_simple to keep main MQTT logic more
clear. Also, remove related code which was used only by the old SNTP
code, e.g. show_addrinfo().

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-23 00:32:57 +03:00
Alexey Markevich bf9aaa4b34 samples: net: google_iot_mqtt: fix subscription qos initialization
Callback used mqtt_publish_qos1_ack but mqtt_subscribe called with
default 0 value (MQTT_QOS_0_AT_MOST_ONCE)

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-17 13:03:51 +03:00
Markus Becker df38b0911c net: openthread: Add config for NRF52840 DK OpenThread NCP
New config file to build an OpenThread NCP for the NRF52840-DK
via CDC-ACM USB on the connector J3 (labelled 'nRF USB').

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-06-17 08:57:55 +03:00
Jukka Rissanen 6cec40e8cf samples: net: mqtt: Add userspace support to mqtt_publisher
Allow mqtt_publisher sample application to be run in user mode.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-17 08:56:27 +03:00
Oleg Zhurakivskyy f419a655bb samples: net: sockets: tcp: Enable CONFIG_THREAD_NAME
In order to follow threads by name, enable CONFIG_THREAD_NAME
in the configuration.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-06-15 16:38:38 +03:00
Michael Hope 69b76d7305 samples: zperf: fix an unaligned access in the UDP uploader
zperf takes a potentially unaligned netowrk packet, casts it to a
struct, and then dereferences the fields.  This causes a crash on
cores that don't support unaligned access such as the Cortex-M0+.

Use the UNALIGNED_GET helper instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-15 10:30:35 +03:00
Gerson Fernando Budke ce26bb5365 samples: coap_server: Refactor to use coap_get_option_int
Small clean-up to use coap_get_option_int.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-06-09 21:25:11 +03:00
Reto Schneider 0b4b3ae4dd cmake, 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 multiple projects
"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, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
Alexey Markevich b9f6e33afb samples: net: google_iot_mqtt: fix log typo
Wrong port number logged.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Alexey Markevich d6d5ae170a samples: net: google_iot_mqtt: log actual error
Error logging was using the wrong variable.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Kumar Gala d00d0f1266 samples/tests: Convert use of %ll{u,d} to PRI{u,d}64
Move to using PRIu64/PRId64 instead of %llu/%lld since on
native_posix_64 the uint64_t/int64_t type is defined in terms of 'long
int' and not 'long long int'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Christopher Friedt fb9f6a482f samples: sockets: socketpair: mitigate negative index
Fixes #25780
Coverity-CID: 210612

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Christopher Friedt 9cc82a036a samples: sockets: socketpair: check return of pthread_create
Fixes #25737
Coverity-CID: 210585

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Christopher Friedt fb21b2f0b7 samples: sockets: socketpair: check return value of send
Fixes #25736
Coverity-CID: 210583

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Johann Fischer 3ce80c4d7a samples: wpanusb: assign next free sample PID
Assign next free sample PID to wpanusb sample.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-05-27 14:15:52 +02:00
Christopher Friedt 2710c188ad samples: sockets: socketpair: sample application and docs
Support for the socketpair(2) system call was recently
added for 2.3.0 .

This change adds a sample application that demonstrates
how it can be used.

Fixes #25527

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-05-27 14:14:04 +02:00
Paul Sokolovsky 8af7187255 samples: net: echo_async_select: Use read()/write() if possible
If build with full POSIX API, use read()/write() instead of
recv()/send() calls for sockets.

We have read()/write() support for a while, but no samples/tests
actually performed at least a build test for it (so it will be
done now).

Fixes: #25407
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-20 15:37:23 +02:00
Gerson Fernando Budke ac117c8d63 samples: net: updatehub: Add sample.yaml file
Add missing sample.yaml file to enable CI build tests. Local tests can
be executed executing sanitycheck:

./scripts/sanitycheck -l --testcase-root samples/net/updatehub

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-05-18 11:12:31 +02:00
Gerson Fernando Budke dc84dd5db5 samples: net: wifi: Enable esp32 offload tests
The esp32 offload driver is used by shield esp_8266. This shield
doesn't have tests enabled to ensures that dependencies are ok.
This enables wifi sample to validate shield esp_8266 on CI and
consequently esp32 offload driver.

Fixes: #25386

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-05-16 19:56:06 +02:00
Martí Bolívar 8970e13f63 samples: lwm2m_client: cleanups
Make this code access the common led0 sample alias in the usual way.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Jukka Rissanen 5c62afdaaa samples: net: lldp: Check VLAN and LLDP support for interface
Make sure that we have proper network interface which support
VLAN and LLDP in this sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-11 17:11:23 +02:00
Kumar Gala db725c0ec9 drivers: Replace GPIO_CS Kconfig with devicetree detection
Use DT_INST_SPI_DEV_HAS_CS_GPIOS() in drivers to determine if we should
utilize CS_GPIO base SPI chipselect handling.  This allows us to remove
Kconfig option for this feature.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-09 13:07:05 +02:00
David Brown a7d35b7984 samples: net: google_iot: Clarify key type docs
Clarify in the docs the importance of generating a key type that matches
the configuration used to sign JWT tokens.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
David Brown fb137098c9 samples: net: google_iot: Add config template to prj.conf
Add the template config values to the prj.conf.  These will need to be
changed according to the instructions in the README.rts.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
David Brown 961e7e707e samples: net: google_iot: Fix unclear documentation
The instructions on setting the necessary Kconfig values is unclear.
Add a description based on values that can be found in the Google IoT
Core console.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
Jukka Rissanen ae7da57cf4 samples: net: cloud: google: Convert to allow new timeouts
Fix timeout handling in the code so that we do not need to
enable legacy timeout.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-08 15:10:42 +02:00
Paul Sokolovsky 44e2a0343d samples: sockets: echo_async_select: Add CONFIG_POSIX_API config
Build a sample variant with CONFIG_POSIX_API enabled, to check that
we have select() call available to applications.

Also, bump stack size, as the app crashes now with the default size.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-08 11:16:31 +03:00
Robert Lubos fc7b142961 net: openthread: Use newlib in samples
OpenThread throws a warning when minimal libc is used, as some of its
new files use stdlib functions not available in the minimal
implementation. It's not critical failure, as those new functions are
not linked anyway in default configuration, but the warnings do not
look well. Therefore, use newlib by default in the sample to prevent
warnings.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-05-07 23:27:49 -05:00
Alexander Wachter 464f135ce6 canbus: Convert canbus driver and subsys to new timeout API
Convert all canbus related API/samples/tests/subsys
to the new timeout API with k_timeout_t.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-05-06 10:19:13 +02:00
Jukka Rissanen 65a1bebe85 net: Replace NET_WAIT_FOREVER by SYS_FOREVER_MS
As we now have SYS_FOREVER_MS, use that instead of network
specific NET_WAIT_FOREVER.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-05 16:29:23 +03:00
Ravi kumar Veeramally b78c9dca52 samples: net: cloud: Fix polling incoming messages
Topic subscribe() will allow cloud to send messages to
device. There will be a bit of network delay. But mqtt_input
was called only after publish() which will trigger every
10-15 seconds. Which is causing more delay to read published
messages from cloud even though messages are already available
at socket level.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-05-05 14:10:44 +03:00
Kumar Gala 4e93b77552 samples: Convert DT_ALIAS_* to new DT_ALIAS() macro
Convert DT_ALIAS_* defines to use DT_ALIAS() plus other macros from
include/devicetree.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 15:28:20 -05:00