Commit graph

1640 commits

Author SHA1 Message Date
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
Charles E. Youse ce46e0df4d cmake: samples/tests: update cmake_minimum_required() to 3.13.1
Some samples/tests are still referring to 3.8.x versions.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-27 23:09:24 -04: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
Johann Fischer 75b490efc2 sample: zperf: enable test for the shield link board ETH
Enable test for the shield link board ETH.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-12 11:30:19 +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 efecc28609 samples: net: dns: Do mDNS query always if mDNS is enabled
If mDNS is enabled, then do the mDNS query always. Earlier we did
the query after we had received response to the normal DNS query.
Also there is no need to print DNS id for mDNS queries as the id
is always 0.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-29 19:47:07 +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
Michael Scott 7492555f88 samples: net: lwm2m: bootstrap support changes:
When LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP is enabled:
- Mark the first server as a bootstrap server
- Create second server and security instances (used by bootstrap
  server)

This allows bootstrap support to be tested out of the box with
the following:
- setup Leshan bss-server-demo (bootstrap server) on port 5783
- setup Leshan server-demo (lwm2m server) on port 5683
- add an entry into the bootstrap server:
  LWM2M Server=coap://[2001:db8::2]:5683
- build the sample like so:
  west build -t run -b qemu_x86 \
    -s zephyr/samples/net/lwm2m_client/ -- \
    -DCONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP=y \
    -DCONFIG_LWM2M_PEER_PORT=5783

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-24 11:04:25 +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
Jan Van Winkel 440aae75c7 samples: Corrected typos in updatehub sample
Corrected typo in board name in updatehub sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-08-15 23:11:53 +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
Jukka Rissanen 1c65789d85 samples: net: zperf: Use proper value in k_busy_wait()
The wait time value should be in microseconds.

Fixes #18059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-07 12:24:23 +02:00
Ravi kumar Veeramally fa7a5db12e samples: net: Modify mqtt_publisher to use set proxy
Modify mqtt_publisher sample to use mqtt_client_set_proxy().
Removed CONFIG_MQTT_LIB_SOCKS based setup.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-08-05 13:26:11 +03:00
Michael Scott efa1679806 samples: net: lwm2m_client: support for compiling in new objects
Let's add support for recently added LwM2M objects:
- Connectitiy Monitoring
- Location
- IPSO Accelerometer
- IPSO Buzzer
- IPSO On/Off Switch
- IPSO Push Button

Currently, this is limited to compile enabled and manual creation
of objects via LwM2M server.  Objects will respond to read/write
operations, but not have real HW backing.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-02 12:00:35 +03:00
Michael Scott 8817d930a8 net: lwm2m: rework resource instance storage / access methods
LwM2M allows for multiple instance resources such the power source
resources in the device object.  These types of resources have
always been very hard to work with, and frankly were poorly
implemented.

This led to other issues where it was very hard to have
non-sequential resource instances, and each resource of this type
needed special getter / setter methods such as:
lwm2m_device_add_pwrsrc()
lwm2m_device_set_pwrsrc_voltage_mv()

Going forward, as more LwM2M objects are implemented this just
doesn't scale well.

To fix this:
- split the resource instance data out from the resource data.
  This includes the data pointer information and resource
  instance id.
- add resource id and resource instance id to the event callback
  functions so user's can see in more detail what resources and
  resource instances are being handled.
- allow generic functions like lwm2m_engine_get_*() and
  lwm2m_engine_set_*() to access resource instance data.
- adjust object resource initialization  macros to map resource
  instances to resources at the time of object instance
  creation.
- fix up the lwm2m_client as a reflection of all of these changes.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-02 12:00:35 +03:00
Michael Scott 3217129f5d samples: net: lwm2m_client: send temp value back to engine
By sending the temp value back to the LwM2M engine, it allows all of
the min/max values to be updated over time.

Fixes an issue where min/max values were not being updated.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-02 12:00:35 +03:00
Michael Scott 7ac1cbfe21 samples: net: lwm2m_client: set LWM2M_COAP_BLOCK_SIZE to 512
The native Zephyr LwM2M client enables the JSON formatter which
can use more of the packet buffers than the default 256 with
TLV formatting.  Let's set the default to 512 in order to avoid
cutting off the output of larger READ operations.

In the future, we should establish block transfer buffers to
handler longer READ ops.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-02 12:00:35 +03:00
Michael Scott 9534bbd991 net: lwm2m: add missing application type to IPSO Light Control
Per IPSO Light Control definition from the OMA LwM2M registry:
http://www.openmobilealliance.org/tech/profiles/lwm2m/3311.xml

There is an optional "Application Type" string resource (5750) in the
Light Control object.  This was missed in the initial implementation.

NOTE: sample will assign reference if needed.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-02 12:00:35 +03:00
Michael Scott a33a6f7754 net: lwm2m: remove data storage for IPSO Timer application type
We are pre-allocating a storage variable for the application type
resource in the IPSO Timer object.  This is an optional resource
which won't always be set by samples.

Let's leave out the pre-allocated variable and let the sample set
this reference if needed (it's optional).

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-02 12:00:35 +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
Anas Nashif ffaba63b10 boards: remove arduino 101 and related boards
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
Peter A. Bigot 0626c8f1d3 samples: add board customization for native_posix_64
Sample applications for display functions do not work on native_posix_64
due to missing overrides.  Clone the native_posix_64 Kconfig override
for all samples that have a native_posix Kconfig override.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-17 15:29:42 -07: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
Anas Nashif 66b081d24a samples: quark_se_c1000_devboard does not have Wifi
Remove custom configuration that does not support Wifi natively.

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
Nicolas Pitre 0aa796cbaa print format: adjust specifiers to be compatible with a 64-bit build
The size_t type is either compatible with an int on 32-bit target, or
a long on 64-bit targets. It could even be a long even on some 32-bit
targets. Let's use the z qualifier in the printf format to be compatible
with whatever flavor in use.

In case of pointers, let's just use %p with pointers directly and
avoid casts altogether.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-11 20:12:26 -07: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
Michael Scott 13086ccda8 net: lwm2m: dont select MBEDTLS or set MBEDTLS options in subsys
If a sample wants to use the Zephyr implementation of mbedtls, it
enables CONFIG_MBEDTLS and sets any needed Zephyr-specific mbedtls
options.

Currently, the LwM2M subsystem selects MBEDTLS automatically when
LWM2M_DTLS_SUPPORT is enabled.  Let's remove this and let the
LwM2M client sample enable mbedtls and it's options.

This mimics the behavior of several other network-related samples
and removes conflicts when selecting alternate implementations of
MBEDTLS.

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

Signed-off-by: Michael Scott <mike@foundries.io>
2019-07-09 21:08:47 +03: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
Kumar Gala db167c606d dts: Rename LED._GPIO_* -> DT_ALIAS_LED._GPIOS_*
We use the following commands to rename any
LED._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_LED._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l LED._GPIO_CONTROLLER | xargs sed -i 's/LED\(.\)_GPIO_CONTROLLER/DT_ALIAS_LED\1_GPIOS_CONTROLLER/g'
git grep -l LED._GPIO_PIN | xargs sed -i 's/LED\(.\)_GPIO_PIN/DT_ALIAS_LED\1_GPIOS_PIN/g'
git grep -l LED._GPIO_FLAGS | xargs sed -i 's/LED\(.\)_GPIO_FLAGS/DT_ALIAS_LED\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-02 08:26:37 -04:00
Daniel Egger 08d10e1793 samples: net: lwm2m_client: If hwinfo interface is enabled, use it
Previously we always used the board identifier (via CONFIG_BOARD) as
identifier, however this causes troubles in case of tests with multiple
boards of the same kind on the same server. The device_id addresses that
problem nicely if enabled and supported by the architecture.

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2019-07-02 11:36:26 +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 a2fd7d70ec cleanup: include/: move misc/util.h to sys/util.h
move misc/util.h to sys/util.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 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
Anas Nashif d1b2718687 cleanup: include/: move uart.h to drivers/uart.h
move uart.h to drivers/uart.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 8c1f89fa99 cleanup: include/: move sensor.h to drivers/sensor.h
move sensor.h to drivers/sensor.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 6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.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 969f8f1c68 cleanup: include/: move entropy.h to drivers/entropy.h
move entropy.h to drivers/entropy.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 4be2e9ebb6 cleanup: include/: move zephyr/jwt.h to data/jwt.h
move zephyr/jwt.h to data/jwt.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 0abdacf3a4 cleanup: include/: move json.h to data/json.h
move json.h to data/json.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
Johann Fischer abaeaed2af usb: sort usb config data by section
USBD_CFG_DATA_DEFINE macro has not consider that a class
could have more than one set of usb_cfg_data struct.
If a class has more than one set of usb_cfg_data
then they should be sorted the same way like by
USBD_DEVICE_DESCR_DEFINE macro.

Fixes: #16240

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-27 12:18:05 +02:00
David B. Kinder 6b2cd29223 doc: fix misspellings in documentation
Fix misspellings and doc issues missed during regular reviews (including
some files without a trailing newline)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-18 15:08:19 -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
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Anas Nashif efb47ace39 doc: samples: cleanup board reference and layout
Cleanup references to boards in some of the example and use the same
boards through the examples. Other minot cleanups and make the text more
generic and not specific to certain boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04: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
Anas Nashif 2fb19fcbdd style: samples/tests: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Christian Tavares 543de09357 lib: updatehub: add support ipv6
This extends the UpdateHub library code to allow the
use of IPV6 for communication.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
2019-06-05 00:20:37 +02:00
Christian Tavares c5d74eccda lib: updatehub: add suport a CoAPS/DTLS
This extends the UpdateHub library code to allow the
use of CoAPS/DTLS for communication.

Refs: #13039.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
2019-06-05 00:20:37 +02:00
Christian Tavares 297ac3765f lib: updatehub: Add UpdateHub.io support
UpdateHub is an enterprise-grade solution which makes simple to
remotely update all your embedded devices in the field. It
handles all aspects related to sending Firmware Over-the-Air(FOTA)
updates with maximum security and efficiency, while you focus in
adding value to your product.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-06-05 00:20:37 +02:00
Daniel Egger 280daa3941 samples: net: lwm2m: use real temperature values instead of dummy
This changes the use of a static and fixed temperature value to using a
read_callback which will either return the previous dummy value or
gather real temperature data from a supported sensor (for now only
FXOS8700 which is available e.g. on a FRDM-K64F).

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2019-05-28 21:11:05 -04:00
Andrei Emeltchenko 953728b241 samples: usb: wpanusb: Refactor sample using new API
Refactor wpanusb sample using new descriptor API, use endpoint index
instead of hardcoded endpoint address.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04: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
Aurelien Jarno 819e749ccd usb: move the request handler buffer to the USB device code
In order to unify the legacy and composite code, move the class and
vendor request handler buffer into the USB device code, just like in
composite mode. The option is renamed from USB_COMPOSITE_BUFFER_SIZE
into USB_REQUEST_BUFFER_SIZE and also replaces the USB_DFU_MAX_XFER_SIZE
and USB_HID_MAX_PAYLOAD_SIZE options.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Jukka Rissanen 4bd654d8c1 samples: net: gptp: Fix compilation instructions
As the prj_base.conf was renamed to prj.conf by commit
4e5300ba7f, the documentation
needs some fixing too.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-23 22:13:11 +03:00
Michael Scott 3fce0f214e samples: lwm2m_client: re-add sanity check for WNC-M14A2A build
Instead of using the now removed overlay files, use the SHIELD=
command-line option for testing the WNC-M14A2A modem.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-05-21 08:17:20 -04:00
Michael Scott 21e9b0f510 samples: lwm2m_client: cleanup shield overlay files
Let's remove the sample-specific overlay files dealing with the
WNC-M14A2A modem.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-05-21 08:17:20 -04:00
Paul Sokolovsky 6f6b46971a samples: google_iot_mqtt: Explicitly cast socklen_t to int in printf
Otherwise, it can lead to warning like:

main.c:80:10: warning: format '%d' expects argument of type 'int',
but argument 2 has type 'socklen_t' {aka 'long unsigned int'}
[-Wformat=]

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
Paul Sokolovsky 220fba3b5d samples: google_iot_mqtt: 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
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
Andrei Emeltchenko 995b568b14 samples: cdc_acm: Update CDC ACM Device name
Update device name for USB CDC ACM.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Benjamin Valentin 7c09695344 net/icmpv6: Allow for arbitrary payload data in ICMP echo
Allow for including arbitrary data in net_icmpv6_send_echo_request()
that will be echoed verbatim by the receiver.

This allows to use ICMP echo for diagnostic use cases, e.g. by testing
packet framentation (large payload) or measuring round-trip-time.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-04-26 09:05:14 +03:00
Bub Wei 57e7ddb7b0 samples: net: zperf: Remove unnecessary main
main function is not necessary.
And without main here, it is possible to import these
samples zperf files in another project.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-04-25 16:18:49 +03: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
Bub Wei ee442c2b66 samples: net: zperf: Add __packed for zperf_udp_datagram
UDP packet from net is not 4-byte aligned.
So we have to add __packed for zperf_udp_datagram.

Fixes #15605.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-04-23 13:14:35 +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
Johann Fischer c13e201b18 usb: replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS
Replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-04-11 13:35:24 -04: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
Andrew Boie 7b1ee5cf13 tests: CONFIG_TEST_USERSPACE now off by default
Unlike CONFIG_HW_STACK_PROTECTION, which greatly helps
expose stack overflows in test code, activating
userspace without putting threads in user mode is of
very limited value.

Now CONFIG_TEST_USERSPACE is off by default. Any test
which puts threads in user mode will need to set
CONFIG_TEST_USERSPACE.

This should greatly increase sanitycheck build times
as there is non-trivial build time overhead to
enabling this feature. This also allows some tests
which failed the build on RAM-constrained platforms
to compile properly.

tests/drivers/build_all is a special case; it doesn't
put threads in user mode, but we want to ensure all
the syscall handlers compile properly.

Fixes: #15103 (and probably others)

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-06 14:30:42 -04:00
Ravi kumar Veeramally 06159d3bcf net: samples: ipv4_autoconf: Need more buffers for same_70
More buffers are need to build for sam_e70_xplained board
to work out of the box. Added board specific conf file.

Fixes #15096

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-04-05 16:11:37 -04:00
Andrei Emeltchenko 0f03730882 usb: wpanusb: Simplify and cleanup sample
Remove old unused code blocks and simplify initialization.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Andrei Emeltchenko ed97cb7601 usb: wpanusb: Use usb_transfer mechanism
Refactor wpanusb to use usb_transfer().

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Andrei Emeltchenko 08da6b261a usb: wpanusb: Fix crash in the sample
Patch 8af3df3519 changed logic and did not take into account 2 extra
bytes.

...
  Precise data bus error
  BFAR Address: 0x766e4900
***** Hardware exception *****
Current thread ID = 0x200004e8
Faulting instruction address = 0xddf4
Fatal fault in thread 0x200004e8! Aborting.
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Andrei Emeltchenko 721f3d1cd0 usb: Refactor USB status callback
Merge cb_usb_status_composite and cb_usb_status and use common
forward_status_cb for both composite and normal devices.

Fixes #14882

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Jacob Siverskog 50c2a735e2 doc: Fix typos in MQTT sample documentation
Fix typos and file reference.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-04-01 18:38:42 -04:00
Robert Lubos 16d2b11041 samples: net: Update TELNET sample to use shell TELNET backend
telnet_console driver is not compatible with new shell module, hence is
not working. Switch the telnet sample to use new TELNET shell backend.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-04-01 10:26:13 -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
Ulf Magnusson d5b0bd14e3 scripts: Remove unused imports in all Python scripts
Discovered with pylint3.

Upstream open-amp PR: https://github.com/OpenAMP/open-amp/pull/168

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:06:20 -05:00
Ulf Magnusson 7ccc7889fa logging: Remove SYS_LOG implementation
Replaced by the new CONFIG_LOG system.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 09:30:29 -04:00
David B. Kinder 5d8e367efe doc: fix misspelling in docs and API comments
Fix misspellings missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-27 15:59:09 -04:00
Tedd Ho-Jeong An b43ef2f4d9 samples: net: nats: Check null before dereferrencing the variable
This patch checks null before deferencing the variable.

Fix Bug: #14815
Coverity CID: 196641

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-26 14:13:24 -05:00
Vincent Wan 11739f72df samples: net: mqtt_publisher: Add section on connecting with TLS
Adding a section to the sample's documentation to give some specific
instructions on how to try it with TLS enabled. This should be helpful
for users who are not knowledgeable with regards to creating/setting up
TLS certificates.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-26 14:22:57 -04:00
Ulf Magnusson d83141535c scripts: Remove accidental semicolons in Python scripts
Making a clean slate for some pylint CI tests. Only enabling relatively
uncontroversial stuff.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-26 07:57:52 -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
Jukka Rissanen 059a14e166 samples: net: zperf: Update the README file
Clarify what iPerf version was used when testing this sample
application. It was iPerf 2.0.9 which worked ok, for example
iPerf 2.0.13 did not work properly with UDP uploader (client)
mode.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04:00
Jukka Rissanen 24de2f7e01 samples: net: zperf: Fix TCP uploader
Try to construct a proper iperf client header to the payload
as the server expects that. It is not sure if this is needed
or correct as there is no proper documentation for the iPerf2
protocol.

Fixes #14665

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04:00
Jukka Rissanen cbeeb510c0 samples: net: zperf: Fix UDP uploader
Try to construct a proper iperf client header to the payload
as the server expects that. It is not sure if this is proper
way to do the iperf header as there is no documentation about
iPerf protocol anyway (except the iPerf source code).

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04: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
Jukka Rissanen cda61d2a63 samples: net: dhcpv4: Add net-shell and e1000 driver support
The dhcpv4-client is more usable if it has net-shell. For testing
with qemu_x86, the e1000 overlay config is very useful.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-21 09:03:26 -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
Tomasz Bursztyka 03bfc5dd0f net/context: Remove token parameter from net_context_send/sendto
And also to the relevant callbacks.

That parameter is not used anywhere so it is useless.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka d6d52ce9e5 net/pkt: Remove _new suffix to net_pkt_write functions
Suffix is now useless, as these functions are now the only ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka a25f054cbd net/pkt: Remove _new suffix to net_pkt_read functions
Suffix is now useless, as these functions are now the only ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka f8a091104e net/pkt: Remove _new suffix to net_pkt_get_data_new function
Now that legacy - and unrelated - function named net_pkt_get_data has
been removed, we can rename net_pkt_get_data_new relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka 172fe5a87b net/context: Remove _new suffix on net_context_send/sendto functions
Now that legacy functions are removew, let's rename the new functions by
removing the _new suffix.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -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
Jukka Rissanen ebce5601c0 samples: net: promisc: Fix compile error
The sample was bitrotted because sample.yaml was missing and no
build checks were done, so we missed the case when TCP header
API function was removed. This is now fixed by using still available
UDP header API (to get the port numbers). Also fixing debug print
as it were giving compile warnings.

Fixes #14608

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-18 11:31:01 -05:00
Jukka Rissanen c5d3cfa93a samples: net: promisc: Add sample.yaml file for build time checks
The sanitychecker needs sample.yaml in order to compile test
the promiscuous mode sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-18 11:31:01 -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
Tomasz Bursztyka fa58d1e6ce samples/net: Switch zperf sample to new net_context API
No need to build the net_pkt, just send the buffer directly.

Let's reuse already parsed ip/proto headers as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka 4ab0e5a3b7 samples/net: Switch lldp sample to new net_pkt API
Use new net_pkt r/w API functions.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka b517247835 samples/net: Switch wpan_serial to new net_pkt API
Minor changes, as wpan is low level and make use of the bare minimum
API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka 8af3df3519 samples/net: Switch wpanusb sample to new net_pkt API
Minor changes, as wpan is low level and make use of the bare minimum
API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka 3b1c91732d samples/net: Switch nats samples to new net_pkt/net_context API
Using new net_pkt r/w API and so on.

This sample would still need to be using socket API instead.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +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
Jukka Rissanen 6368ed4edf samples: net: zperf: Fix the readme file
As there is no shell submodules any more, the "zperf" command
needs to be written in every command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Jukka Rissanen b9f6bdfe08 samples: net: zperf: Fix TCP download command
The TCP download command was not handling TCP session and
connection closing properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Jukka Rissanen 0cd9b3e267 samples: net: zperf: Make client work in native_posix
As the clock does not run same way in native_posix, do some
tricks here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01: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
Tomasz Gorochowik 9115386e4d samples: net: mqtt: update readme with SOCKS5 info
This commits adds an overlay file with the SOCKS5 symbol that is needed
to run MQTT with a proxy, and extends README with instructions on how to
use it with the default and custom settings.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-03-11 20:36:39 -07:00
Andrei Emeltchenko c2dbbf77c1 samples: net: lldp: Set optional TLV system_name
Add optional TLV to LLDP DU.

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

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

Fix: #13859
Coverity-CID: 190956

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

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

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

Remove them again.

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

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

Fixes: #13885
Coverity-CID: 190928

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

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

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

Fixes: #13852
Coverity-CID: 190966

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

Coverity-CID: 190969
Fixes: #13850

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

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

Coverity-CID: 191003
Fixes #13824

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

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

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

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

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

Fixes: #13701

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #13005

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

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

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

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

Fixes #13300 #13481

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

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

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

All files that use these macros have been updated.

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

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

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

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

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

Please refer to the README for more information.

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

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

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

The default settings can be changed in the configuration header.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-31 13:56:05 -05:00
Vincent Wan db022a966c samples: net: add TLS offload support to mqtt_publisher
This commit adds support in the sample to deal with the case when TLS
is offloaded and mbedtls is not necessary.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-01-31 06:36:08 -05:00
Vincent Wan fec0445ebb samples: net: Add support for cc3220sf_launchxl in mqtt_publisher
This commit adds the necessary changes to allow the mqtt_publisher
sample to run on cc3220sf_launchxl.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-01-31 06:36:08 -05:00
Aurelien Jarno 4394601524 net: sntp: get rid of the callback function
The original SNTP client library was designed for the net-app API, for
which it makes sense to have a callback function, which is called
asynchronously when an answer is received.

For the socket based interface, the callback is called just before
sntp_request() returns. It gets the status and the epoch_time in
parameter, however the status is already returned by sntp_request(). It
therefore make sense to replace the callback function by a pointer to
epoch_time.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-31 10:14:12 +02:00
Paul Sokolovsky d6ffca36f3 samples: sockets: Clean up headers included
Don't include net_app.h and net_buf.h, the first is deprecated, the
latter is low-level header, both shouldn't be used for socket apps.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-30 21:05:11 -05:00
Michael Scott b0de8b88dd samples: lwm2m_client: enable HW flow control for WNC-M14A2A modem
The WNC-M14A2A modem is supposed to use HW flow control on the UART
connected to the MCU.  In the past, we were able to bypass this
requirement by using only the LTE-M firmware which supported pulling
the CTS line high via "send-ok" gpio.

This does NOT work for the LTE firmware.

Now that MCUX UART driver supports hw-flow-control setting, let's use
it in the modem overlay so that regardless of modem firmware
(LTE vs. LTE-M) the sample will "just work".

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-30 02:53:12 -06:00
Michael Scott 0ee0773abd net: lwm2m: remove unused CONFIG_NET_CONTEXT_NET_PKT_POOL config
CONFIG_NET_CONTEXT_NET_PKT_POOL is used by Zephyr's TCP stack as
a way of keeping the original packet data when compression and
other l2 specific actions make the data unusable for retries.

LwM2M uses UDP and this option was never used.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-30 10:35:54 +02:00
Kumar Gala 3e8fc3c0c1 modem: wncm14a2a: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert wncm14a2a driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 14:21:56 -06:00
Ravi kumar Veeramally a9acc6d4d7 net: samples: Add socket based SNTP client application
SNTP client sample requests time sync on IPv4 and IPv6 addresses
using socket based SNTP client library.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-01-29 12:25:01 -05:00
Ravi kumar Veeramally f51cebeea2 net: sntp: Rework SNTP client library to use sockets
As networking libraries and protocols are moving to socket
based implementation, reworked SNTP client library to use sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-01-29 12:25:01 -05:00
Kumar Gala e0cd0c2b67 wifi: winc1500: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert winc1500 driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-28 10:39:59 -06:00
Jukka Rissanen 4043909d69 net: http: Remove HTTP client and server APIs
The old legacy APIs use net-app library and as that is being
removed, then the dependencies need to be removed also.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-25 11:21:20 -05:00
Jukka Rissanen 1cba0161ed net: websocket: Remove the websocket as HTTP APIs are removed
Remove the experimental websocket code as it uses HTTP APIs
which are being removed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-25 11:21:20 -05:00
Paul Sokolovsky fe7043d7ca samples: net: sockets: Set explicit min_flash on some samples
Fixes build issues with lpcxpresso54114_m0 which set to have 32K RAM,
and only 64K Flash.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Paul Sokolovsky 8c50ce934b samples: net: socket: Add "socket" tag to sample.yaml's
So it was easy to run all socket tests without remembering
the exact path(s).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Paul Sokolovsky df95a423b2 samples: echo_async_select: Add select()-based async echo sample
A copy of poll()-based echo_async, converted to use select().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-24 17:14:43 +02:00
Paul Sokolovsky e779f91e0c samples: echo_server: Test overlays for eth_e1000 and eth_stellaris
By adding relevant test config to sample.yaml.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-21 09:09:45 +02:00
Paul Sokolovsky 7117b73562 samples: echo_server: Test overlay-smsc911x.conf via sanitycheck
By adding relevant test config to sample.yaml.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Paul Sokolovsky c3aa195940 samples: sockets: Add eth_smsc911x overlays
Add overlays for commonly used socket samples: big_http_download and
dumb_http_server. Can be used with:

make BOARD=mps2_an385 CONF_FILE="prj.conf overlay-smsc911x.conf"

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Paul Sokolovsky 56cb35a7e8 samples: net: echo_server: Add overlay for eth_smsc911x
As can be used for example with BOARD=mps2_an385.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Robert Lubos 97aa3ac519 samples: openthread: Increase shell stack size
OpenThread commissioner shell command caused stack overflow on shell
thread, hence increase it for OpenThread samples.

Fixes #12455

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-18 15:24:16 +02:00
Jakub Rzeszutko fd0b7f7767 shell: removing legacy shell
Legacy shell removed in order to avoid maintaining two shells
systems.

All examples and tests have been migrated to the new shell.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-01-16 21:35:36 -05:00
Andrei Gansari 4118b8843f drivers: eth_enc28j60: moved to dts
Driver for networking device Microchip ENC28J60 is used as SPI slave,
moved to DTS type definition. Samples echo_client and echo_server use
this device on Arduino 101 board.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 21:28:23 -05:00
Adithya Baglody 25572f3b85 tests: Dont run coverage for select test cases.
Disabled the CONFIG_COVERAGE for benchmarks and other tests.
This is needed because it interferes with normal behavior of the
test case.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-16 06:12:33 -05:00
Paul Sokolovsky fbcc43393c samples: big_http_download: Set min_flash to 128K.
Previously there was just "min_ram: 32", which took care about
suitable flash size implicitly. But now we have interesting boards
(e.g. lpcxpresso54114_m0) which tout RAM of 32K and Flash of 64K.
So, become more explicit about Flash requirement for the sample.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-15 17:22:39 -05:00
Jukka Rissanen a7afdc3512 net: rpl: Remove the deprecated code
The RPL was deprecated earlier so remove it by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-13 09:40:36 -05:00
Andy Ross f033d542ad tests: samples: Disable newlib tests on x86_64
This builds with a host compiler, not one from the SDK, and so no
newlib library is available.  There is work to enable newlib detection
at and above the cmake level.  This patch can be reverted when that
lands.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-11 15:18:52 -05:00
Paul Sokolovsky f3dce8a6e4 drivers: eth: stellaris: Enable automatic Ethernet support in QEMU
When used suitable config overlay, qemu_cortex_m3 with Ethernet
support can be started with just usual "make run".

An example of such overlay is included with samples/net/echo_server,
can be built and run with:

make BOARD=qemu_cortex_m3 \
    CONF_FILE="prj.conf overlay-qemu_cortex_m3_eth.conf" run

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-11 09:48:27 +02:00
Martin Schwan c5de716af4 net: mqtt: Fix typo "seg_tag_list"
Fix a typo in the mqtt_sec_config struct where it was "seg_tag_list"
instead of "sec_tag_list".

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
2019-01-10 11:30:33 +02:00
Andrei Gansari c8d3b3f768 samples: minor documentation fixes
DHCPv4 client typo: '/etc/dhcpd/dhcp.conf'
gPTP Sample -DCONF_FILE=prj.conf (filename changed)

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-01-09 07:57:18 -06:00
Tomasz Bursztyka fc3f090ab8 samples/sockets: Enable 802.15.4 properly for echo apps
These were still running through Ethernet using generic
overlay-802154.conf thus creating a dedicated one.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-08 11:25:33 +02:00
Andy Ross 442e7306bf samples/net/echo: Mark OpenThread test cases as "slow"
The current OpenThread integration wants to download (from github) and
configure the OpenThread source tree every time the app is build.  We
don't want to be doing this in quadruplicate every time sanitycheck is
run.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Andy Ross 5ea39b8c2d samples/net/echo: Remove duplicate test case
These tests were defining a "test_kw41z" case, but that platform is
already whitelisted in the main ("test") case, and this one defines no
different behavior.  It's just a dupe.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
David B. Kinder 06d78354ae doc: regular misspelling scan
Fix misspellings in documentation (.rst, Kconfig help text, and .h
doxygen API comments), missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-26 13:27:14 -05:00
Robert Lubos 167486f4a4 samples: sockets: Update OT overlays for echo samples
Increase rx stack size for OpenThread overlay, as updated revision of
OpenThread requires more stack to operate.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-21 10:27:33 +01:00
Martin Turon 6410a16adb openthread: Update openthread version to latest upstream/master.
Update zephyr integration of openthread to latest api as of 2018-12-17:

2a75d30684

Both echo_server and echo_client compile and are operational.

Signed-off-by: Martin Turon <mturon@google.com>
2018-12-20 12:24:51 +01:00
Tomasz Bursztyka e97a543e9b net/pkt: Remove parameters to "reserve" some headroom
Such parameter is not used anymore, it was defaulted to 0 previously.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Tomasz Bursztyka c77d864841 tests/net: Get rid of the ll reserve
As it is unused now, let's default to 0.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Tomasz Bursztyka d0c1611da3 samples/net: Let's remove the use of ll reserve
This is now useless.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Paul Sokolovsky 4bbdf8b59d samples: sockets: echo_async: Check results of fcntl() calls
Check result of fcntl() to catch any regressions in fcntl() handling
in Zephyr. To facilitate this, also merge block() and nonblock()
functions into single setblocking().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-14 13:21:31 +02:00
Robert Lubos 417cfdd833 samples: sockets: Tweak echo_client/server sample parameters for DTLS
Current application data size in echo_client sample does not fit into a
single datagram with DTLS enbled for default IPv6 MTU (1280 bytes). This
caused abrupt failure of the sample with DTLS enabled over 802.15.4 L2.
Decreasing the application data size allows it to fit into a single UDP
datagram after encapsulating it into DTLS record.

Additionally, finetune DTLS timeout on echo_server to match UDP
application timeout on echo_client (so that a single datagram loss
does not cauase DTLS session to end).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-13 21:13:52 +02:00
Paul Sokolovsky 5ea1e23202 samples: sockets: echo_async: Don't include <sys/fcntl.h>
POSIX doesn't mandate such a header, only <fcntl.h>. <sys/fnctl.h>
is just an internal implementation detail of Newlib on which we should
not rely.

This makes it possible to build this sample against minimal libc.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-13 14:21:34 +02:00
Bub Wei c356b5786f samples: net: zperf: Support existing IP
Considering that IP can be set dynamically by DHCP
or statically before test previously, we could have
alternative way by supporting both setting IP and
existing IP.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-13 14:20:25 +02:00
Andrei Emeltchenko 14f2805c05 wpanusb: Add sanity check configurations
Add sanity check configurations for overlays.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-12-13 12:49:20 +02:00
Andrei Emeltchenko 891356027e wpanusb: Correct configuration for frdm + mcr20a
Make buildable configuration

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-12-13 12:49:20 +02:00
Carles Cufi b51b7becf4 doc: samples: Update samples to point to active boards
Since the Arduino 101 and the Quark SE C1000 are not actively developed
boards, default to other boards that are maintained and used.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-12-12 23:06:16 +01:00
Jukka Rissanen eb9f13e3e2 samples: net: gptp: Update AVnu/gptp build instructions
The OpenAVNU gPTP daemon repository has changed so the compile
instructions were not working.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-12 11:09:40 +02:00
Jukka Rissanen c790290468 samples: net: gptp: Add instructions for native_posix
Remove QEMU instructions as those do not work. Add native_posix
board instructions for running gPTP with linuxptp daemon.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 18:20:54 +02:00
Adithya Baglody a65df22525 samples: rpl_border_router: Fixed headers files.
This sample was creating objects from header file in the bss.
Fixed it by moving the objects to appropriate object files.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-12-07 10:32:41 -05:00
Jukka Rissanen cd4eb946c4 samples: net: Convert to use generic logging macros
Use generic logging macros LOG_*() instead of NET_*() as the
latter are mostly meant for internal networking stack use.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00