Commit graph

1640 commits

Author SHA1 Message Date
Michał Kruszewski
77824a548d samples: net: Add documentation to prj_qemu_cortex_m3.conf file.
Add information that IP addresses in prj_qemu_cortex_m3.conf file for
echo_client are set that qemu<->qemu communication could be tested.

Signed-off-by: Michał Kruszewski <michal.kruszewski@nordicsemi.no>
2017-09-21 09:36:44 +03:00
Michał Kruszewski
e25ee2c3fb samples: net: Fix wrong error logging information in echo client.
When TCP connection over IPv4 could not be established there was
an error about TCP connection over IPv6.

Signed-off-by: Michał Kruszewski <michal.kruszewski@nordicsemi.no>
2017-09-20 15:44:32 -04:00
Paul Sokolovsky
4a771bad37 samples: net: sockets: Add HTTP GET example
This example shows usage of client connection and getaddrinfo().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-09-19 17:39:44 +03:00
Michael Scott
33c79033d0 net: lwm2m: move library internals to net_app APIs
This is the final stage of moving the LwM2M library internals to
the net_app APIs.  This means we can support DTLS and other
built-in features in the future.  All of the logic for
establishing the network connection is removed from the sample
app.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-18 10:26:41 +03:00
Michael Scott
82c2b70cb5 samples: lwm2m: initialize lwm2m_ctx prior to use
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-18 10:26:41 +03:00
Michael Scott
728ab4229a net: lwm2m: introduce lwm2m context structure
The LwM2M library does not use net_app APIs internally.  To help
this effort let's establish a user facing structure "lwm2m_ctx"
(similar to http_client_ctx and mqtt_ctx) and start it off by
wrappering the net_context structure.

Future patches will add user setup options to this structure and
eventually remove the net_context structure in favor of a net_app_ctx.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-18 10:26:41 +03:00
Jukka Rissanen
af63ae28ec samples: net: dns: Add mDNS client support to DNS resolver sample
The DNS resolver example enables mDNS client support and then
queries zephyr.local hostname. The net-tools project has example
avahi-daemon script that will response these .local queries and
can be used in testing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-17 18:02:18 -04:00
Michael Scott
f3454769db samples: lwm2m: remove unused NET_L2_BT settings
Currently, we don't have a .conf which enabled BT.  This will be
re-enabled at some future date after migrating to the full net_app
APIs by setting CONFIG_NET_APP_BT_NODE=y.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-12 20:37:48 +03:00
Michael Scott
e54d750e37 samples: lwm2m: remove extra .conf settings
NET_APP and NET_APP_CLIENT are now set automatically.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-12 20:37:48 +03:00
Jukka Rissanen
e71a31e22f net: Wrong networking defines used in the code
There were bunch of config options in tests/net, net-shell and
wpan_serial sample, and those options had wrong name so they
were ignored by the code.

Fixes #1428

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-12 08:37:53 -04:00
Jukka Rissanen
4fea5b18ab net: app: Add IP header to packets received by TLS/DTLS tunnel
The IP header was stripped by _net_app_ssl_mux() when it received
IP packet. This is fine but if the application expects the get
the IP header, then there is a problem. Fix this by saving IP
header to ssl_context and then putting it back in front of the
packet when the data is passed to application.
Note that this IP header is not used by net_app when the packet
is sent because TLS/DTLS creates a tunnel for transferring packets
and user can only sent packets via this tunnel.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-30 08:12:10 -04:00
Ravi kumar Veeramally
487359e861 net: samples: Fix unchecked return value in zoap_server
Coverity-CID: 174411

Jira : ZEP-2525

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-08-30 08:07:56 -04:00
Jukka Rissanen
f608c2fcfc samples: net: zoap: Increase IPv6 multicast addresses
The default IPv6 multicast address count was too small,
increasing addresses to 5.

Jira: ZEP-2560

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-25 22:17:38 -04:00
Jukka Rissanen
e3f6fae846 samples: net: Fix compile error in echo-server when using TLS
The echo-server sample was using removed net_app_server_tls_disable()
function, the correct one is called net_app_server_disable()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-25 15:50:41 -04:00
Leandro Pereira
47364bcf08 samples: leds_demo: Fix null pointer dereference when adding IP address
Jira: ZEP-2549
Coverity-ID: 157607
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-22 16:32:35 -04:00
Jukka Rissanen
87adcd5ff4 samples: net: mqtt: Define the stack properly
The stack name was incorrectly specified in mqtt_publisher sample
application, this cause compilation error when certain Kconfig
options were specified.

Jira: ZEP-2566

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-22 16:29:51 -04:00
Jukka Rissanen
c200de1b53 net: app: Introduce missing enable/disable functions for server
The server needs global enable/disable status instead of only being
able to enable or disable just the TLS server part.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-22 13:33:33 -04:00
Leandro Pereira
adc95678ba samples: nats: Fix NULL pointer dereference when publishing
Also ensure that payload is sent when publishing a message.

Coverity-ID: 174408
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-22 08:19:54 -04:00
Paul Sokolovsky
756e729c00 samples: net: echo_async: Add IPv6 support
The main reason is allowing to run on 6LoWPAN devices, though also to
demonstrate IPv6 support with BSD Sockets in general.

Tested on 96b_carbon.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-21 08:40:46 -04:00
Michael Scott
7fdd86aa09 samples: net: add sample documentation for lwm2m-client
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-21 08:37:15 -04:00
Paul Sokolovsky
dcb80f7ab8 net: struct sockaddr should have field "sa_family"
POSIX requires struct sockaddr's field to be named "sa_family"
(not just "family"):
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html

This change allows to port POSIX apps easier (including writing
portable apps using BSD Sockets compatible API).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-18 16:34:51 -04:00
Ricardo Salveti
3d4700c5c5 samples: lwm2m: add IPSO light object to LWM2M client
Uses LED0_GPIO_PORT and LED0_GPIO_PIN if available.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-08-18 10:53:25 +03:00
Tomasz Bursztyka
0cefc6947c samples/zoap_server: Fix unchecked return value
Coverity-CID: 174413

Jira: ZEP-2523

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 14:10:01 -04:00
Paul Sokolovsky
d9af77bfd6 net: sockets: Consistently use "BSD Sockets compatible API" moniker
This is how it's called in the main docs, so use this same phrase in
Kconfig and samples too.

Also, added some articles to docs.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-17 12:02:55 -05:00
Luiz Augusto von Dentz
3625d7c851 net: common: Don't build ipss.c
ipss.c is not longer needed when using NET_APP since that has it
built-in.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-17 10:24:05 -04:00
Paul Sokolovsky
e314de5d53 samples: net: sockets: Add READMEs for echo/echo_async samples
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-16 16:09:05 -04:00
Jukka Rissanen
7886336593 net: app: Fix for net_app_get_net_buf()
The documentation says that the API will automatically append the
net_buf fragment to the end of network packet fragment chain.
This was not the case and current only user for this API in
echo-server sample appended the fragment itself. The fix is to
automatically append the fragment to the end of fragment chain.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-14 10:04:03 +03:00
Jukka Rissanen
55b8edc88e net: Fix LLVM compiler warnings
Jira: ZEP-2488
Jira: ZEP-2486
Jira: ZEP-2485
Jira: ZEP-2482
Jira: ZEP-2480

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-09 12:50:50 -04:00
Robert Chou
cd56290dbe net: lwm2m: rename CONFIG_NET_L2_BLUETOOTH to CONFIG_NET_L2_BT
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-08-09 16:03:02 +03:00
Jukka Rissanen
ce80c9e42d samples: net: ieee802154: Fix compile error
The path to ieee802154_settings.c was wrong so the hw sample
did not compile properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-09 14:21:02 +03:00
Johan Hedberg
2975ca0754 Bluetooth: Kconfig: Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.

Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-09 11:14:19 +03:00
Michael Scott
29c7c70a86 samples: lwm2m: add IPSO temperature object to LWM2M client
This commit adds IPSO temperature support to the LwM2M client sample.

NOTE: A dummy value of 25C is set during initialization and does not
change.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-09 10:55:53 +03:00
Michael Scott
b8ac539e51 samples: lwm2m: initial sample for LWM2M client
This sample utilizes the new LwM2M library by setting up default
values for LwM2M device and firmware objects and then establisting
a connection to a LwM2M server (for example Leshan Demo Server) via
the registration interface.

To use QEMU for this purpose please see:
doc/subsystems/networking/qemu_setup.rst

NOTE: This sample currently does not demonstrate DTLS/bootstrap as
neither of these is supported by the LwM2M library.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-09 10:55:53 +03:00
Jukka Rissanen
b300aa58a9 samples: net: zoap_server: Check IPv6 address add return value
When unicast IPv6 address is added to network interface, it is
possible that the return value is NULL (if all the address slots
are already occupied).

Coverity-CID: 157607

Jira: ZEP-2467

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-08 12:31:08 -04:00
Jukka Rissanen
0c243dfe8c samples: net: Remove IEEE 802.15.4 sample setup
The IEEE 802.15.4 settings are applied automatically by
net_app_init() function is is enabled by default.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-07 21:52:51 -04:00
Jukka Rissanen
19b7213f36 samples: net: Some apps were missing IPv6 address settings
Make sure that by default we have at least IPv6 address specified
in the application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-07 21:52:51 -04:00
Anas Nashif
f461ee4df5 samples: fixed tc syntax
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-07 21:43:51 -04:00
Paul Sokolovsky
5245a686fc samples: net: sockets: Switch to net_app auto-init
Don't call net configuration explicitly, instead rely on net_app
auto init service.

Thus, the only difference between POSIX and Zephyr versions of these
samples are different include files. The application code is 100%
the same.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-07 10:13:47 +03:00
Luiz Augusto von Dentz
7d9e0184d9 net: led_demo: Remove dependency on ipss sample service
The led demo does not even enable Bluetooth by default, and in case a
custom enables it shall use CONFIG_NET_APP_BLUETOOTH_NODE.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
5383d47b3b net: zoap_server: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
4c9ebb9d9c net: zperf: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
b9c7f2ac33 net: zoap_client: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
71929d2d5c net: mqtt_publisher: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
f78b13c059 net: http_clients: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
a0f547d3d1 net: http_client: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
4ce629d128 net: echo_client: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
e71d7f5dc9 net: http_server: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
a1d694bc6d net: echo_server: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Anas Nashif
3ac7b3a229 doc: qemu target was deprecated, use 'run'
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-03 11:48:55 -04:00
David B. Kinder
e9a3411651 doc: spelling fixes in docs
regular scan through docs and KConfig files for spelling issues
and UTF-8 characters

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-08-02 15:14:13 -04:00
Anas Nashif
7c6cecde14 samples: mbedTLS server: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
48b351e34c samples: socket: echo_async unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
6ca686cc51 samples: socket: echo: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
ce6bc346b9 samples: http_server: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
69d8a9dd3a samples: telnet_server: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
103c3bb99a samples: coaps_client: unify prj.conf and cleanup docs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
b92733d47a samples: dns_resolve: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
f69d9b9951 samples: https_client: unify prj.conf
Disable qemu_cortex_m3 due to SRAM limitation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
6bb24976f9 samples: coaps_server: unify prj.conf and cleanup docs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
b8e4464958 samples: http_client: unify prj.conf
tested on frdm_k64f

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
32f41964fb samples: nats: unify prj.conf and add sample.yaml
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
db34c58d1f samples: irc_bot: unify prj.conf
tested on frdm_k64f

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
05e24ea373 samples: mbedtls_dtlsclient: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
562da39f9b samples: dhcpv4_client: unify prj.conf
tested on frdm_k64f.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Jukka Rissanen
4349895c5d samples: net: echo-client: Add DTLS support
Convert echo-client to use DTLS for UDP connections if DTLS
is enabled by prj.conf file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-01 21:09:59 +03:00
Jukka Rissanen
72ac166429 samples: net: echo-server: Add DTLS support
Convert echo-server to use DTLS for UDP connections if DTLS
is enabled by prj.conf file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-01 21:09:59 +03:00
Jukka Rissanen
cee4a624f3 samples: net: irc-bot: Fix Kconfig warning
Duplicate CONFIG_SYS_LOG_NET_LEVEL variable was defined in
config files so removing extras.

.config:58:warning: override: reassigning to symbol SYS_LOG_NET_LEVEL

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 20:55:26 +03:00
Jukka Rissanen
9fee74cdbb samples: net: Remove extra startup thread
Couple of network samples had extra startup thread which is not
needed currently. This was an artifact before moving to using
unified kernel.

Jira: ZEP-2236

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 20:55:26 +03:00
Jukka Rissanen
607f4fffdd samples: net: http: Enable compile tests with Bluetooth config
Run http_server, http_client and https_client compile tests with
Bluetooth config. For http client tests we only use qemu_x86 as
the qemu_cortex_m3 tests failed because of too little memory.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
0134abe368 samples: net: http: client: Enable Bluetooth if configured
If Bluetooth IPSP is enabled, then set the http client to use it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
47be0f4989 samples: net: http: client: Set QEMU flags for Bluetooth connection
Bluetooth needs different QEMU_EXTRA_FLAGS than SLIP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
c724a5730c samples: net: http: client: Use net_buf context pool for TX
If CONFIG_NET_CONTEXT_NET_PKT_POOL is defined, which is the
default for Bluetooth, then create the pool and use it when
sending network packets. This is needed when trying to send
TCP packets using Bluetooth IPSP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
a4cfee8fe6 samples: net: http_server: Set QEMU flags for Bluetooth connection
Bluetooth needs different QEMU_EXTRA_FLAGS than SLIP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
1a16b9decf samples: net: http_server: Remove QEMU memory setting
There is plenty of memory for QEMU currently so no need to
manually set the amount of memory.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
0cdb31136c samples: net: http_server: Use net_buf context pool for TX
If CONFIG_NET_CONTEXT_NET_PKT_POOL is defined, which is the
default for Bluetooth, then create the pool and use it when
sending network packets. This is needed when trying to send
TCP packets using Bluetooth IPSP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Aska Wu
c0b5e55e6d net/mqtt: Enable TLS support
CONFIG_MQTT_LIB_TLS is introduced to enable TLS support.

Also, prj_frdm_k64f_tls.conf is added to demostrate the whole idea.

jira:ZEP-2261

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-07-28 11:25:43 +03:00
Aska Wu
fb79837862 net/mqtt: Convert mqtt lib to use net app API
Use net app API since we want to enable MQTT with TLS.
mqtt_connect() and mqtt_close() are added to build and close the
connection to the broker. The caller doesn't need to deal with
the net context anymore and the most of network setup code in
mqtt_publisher is removed.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-07-28 11:25:43 +03:00
Inaky Perez-Gonzalez
3d498dd10c build: workaround build bug in tests
When an app uses a construct such as:

obj-y = main.o ../../../../samples/bluetooth/gatt/hrs.o

in its makefile, it causes said object module to be built in the
source tree, not in the object tree.

When building massively parallel, this usually resuls on the files
getting corrupted, leading to bugs such as:

https://jira.zephyrproject.org/browse/ZEP-2316
https://jira.zephyrproject.org/browse/ZEP-2317

src/../../../../samples/bluetooth/gatt/.gap.o.cmd:3: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:4: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:5: *** missing separator.  Stop.

as multiple build are trying to touch the same file in the source tree
and of course, race and causes a build bug.

We have known about this issue for a long time, but it requires
modifications in the build system that there is no time to tackle.

A suggested workaround is to include the source files into a local .c
file, so this is what this patch does, to remove the random noise.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-07-27 14:09:40 -04:00
Wojciech Bober
ac9a8804b9 net: http_server: Enable Bluetooth stack if configured
This PR enables Bluetooth stack if Bluetooth L2 is
compiled in.

Change-Id: I8f8127031140f0603615af44e0809d203db32f48
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-07-27 16:51:55 +03:00
Anas Nashif
ca0ad13a61 net: enable SLIP only on QEMU targets
In many networking tests we had to configure SLIP in the prj.conf
leaving those configurations Qemu specific. This change enables SLIP for
QEMU targets automatically and allows reuse of prj.conf for multiple
boards.

Additionally, the TUN options is removed. This option was not used
anywhere.

To enable self-contained networking tests that do not depend on SLIP, we
introduce the new option NET_TEST which disables TAP and allows testing
in QEMU without the need for a host interface.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-26 10:57:48 -04:00
Andrew Boie
010498da62 samples: net: fix stack definitions
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-26 05:53:14 -04:00
Michael Scott
c58be92208 samples: net: irc_bot: fix stack declarations
kernel APIs have changed to using K_THREAD_STACK_DEFINE to declare stack
memory as well as K_THREAD_STACK_SIZEOF to calculate it's size.

Adjust irc_bot sample to reflect those changes.

This fixes stack related page faults when running irc_bot with
CONFIG_X86_STACK_PROTECTION enabled (which it is by default for qemu).

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-07-25 18:01:32 -04:00
Paul Sokolovsky
0e5c365f9a samples: net: sockets: Move socket sample(s) under a subdir
It's expected that there will be few socket-based samples, so move
tehm under samples/sockets/ to not clutter the main dir.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-18 21:46:56 +03:00
Paul Sokolovsky
00e8309f03 samples: sockets: Add async echo server example
Implements asynchronous TCP echo server using non-blocking sockets
and poll, with concurrent connections support.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-18 21:46:06 +03:00
Jukka Rissanen
8f9249cf5c samples: net: coaps_server: Increase mcast addresses
The coaps server sample application did not start because
number of IPv6 multicast addresses was too low. Increased
the address count from 2 to 5.

Jira: ZEP-2359

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-18 09:33:46 +03:00
Robert Chou
33c54ee6fd net: zoap: advance block context by checking M bit from block option
According to RFC7959 page 30, "The end of a block-wise transfer is
governed by the M bits in the Block options, _not_ by exhausting the
size estimates exchanges."

Therefore, we should check the M bit instead of total size (which
is not always available, too)

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-07-14 11:06:54 +03:00
Erwin Rol
507add28c9 samples: net: http_server: Add olimex_stm32_e407 project config file
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2017-07-12 12:53:51 +03:00
David B. Kinder
eeed8ce179 doc: fix wiki board references in non .rst files
Some README files referenced wiki articles that have been
moved to the doc area on the website.

Fixes #668

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-07-11 12:45:35 -05:00
Paul Sokolovsky
52f8cde07b samples: net: socket_echo: Add sample.yaml, update for net_app refactor
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-11 10:32:29 +03:00
Andrew Boie
65a9d2a94a kernel: make K_.*_INITIALIZER private to kernel
Upcoming memory protection features will be placing some additional
constraints on kernel objects:

- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.

Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.

It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.

There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.

k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Geoff Gustafson
1405627c37 net: context: Use K_NO_WAIT instead of 0 for timeout
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
2017-07-10 10:59:28 +03:00
Kumar Gala
5920acef8a samples: mark samples that require usb_device support
Add depends_on usb_device for those samples that need it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-07 09:01:01 -05:00
Jukka Rissanen
6ce9d8e882 samples: net: zperf: Add net tag
This sample app should be tested whenever net tag is specified.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Jukka Rissanen
3604c391e6 net: udp: Remove NET_UDP_HDR() macro and direct access to net_buf
Remove NET_UDP_HDR() macro as we cannot safely access UDP header
via it if the network packet header spans over multiple net_buf
fragments.

Fixed also the UDP unit tests so that they pass correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Bogdan Davidoaia
e90064f317 samples: net: ieee802154: add KW40Z prj conf file
The config file for KW40Z has the shell disabled, as available
SRAM memory is limitted to 16kB.

Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-07-06 14:20:32 -05:00
Bogdan Davidoaia
8909be81f9 samples: net: ieee802154: kw41z: reduce log level
Reduce log level to show only error messages.

Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-07-06 14:20:32 -05:00
Anas Nashif
d7154d50df samples: wpanusb: add testcases
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-06 10:34:41 -05:00
Jukka Rissanen
7a31d4b8cb net: app: Fix dual IPv4 and IPv6 support
It was not possible to send IPv4 packets if IPv6 was also
enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-06 14:32:37 +03:00
Anas Nashif
68d7a207ae ethernet: fix Kconfig option for ETHERNET
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif
c01c074b5b net: fix wrong Kconfig
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT should be used instead of
CONFIG_NET_IFACE_UNICAST_IPV6_ADDR_COUNT.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif
8aac831e3c samples: mqtt_publisher: fixed typo
Also fix console syntax adding prompt: $

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-04 16:52:40 -04:00
Jukka Rissanen
439ceb99c1 samples: net: https: Increase the RAM for client and server
Next two commits will increase the mbedtls ram usage a bit and
https client and server sample test will fail.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
5f9d79f290 samples: net: http: Remove net_app_init() calls
As the net app API is automatically initialized, there is no
need to call net_app_init() by the http client and server sample
applications.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
d14d167188 samples: net: wpan: No need to define IP addresses
Removing CONFIG_NET_APP_SETTINGS from prj.conf file as the
sample does not use or need any IP addresses.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
76e6e32cad net: samples: Convert echo-client to use network app API
This commit will convert echo-client to use the net app API
when creating the connection to peer. Most of the network
setup code will be removed from echo-client by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
2e7c3519a4 net: samples: Convert echo-server to use network app API
This commit will convert echo-server to use the net app API
when creating the listening service. Most of the network
setup code will be removed from echo-server by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
a1be6a8ba9 net: app: Create support for network application API
The network application API is a higher level API for creating
client and server type applications. Instead of applications
dealing with low level details, the network application API
provides services that most of the applications can use directly.

This commit removes the internal net_sample_*() API and converts
the existing users of it to use the new net_app API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
John Andersen
913e2cdb24 samples: net Documented QEMU_INSTANCE usage
Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
John Andersen
06b92c6611 samples: net: Multiple instances of QEMU
Makefiles which start QEMU (make run) have been changed to operate
off of the QEMU_INSTANCE variable. QEMU_INSTANCE is simply appended
to the pid and sock file names. This makes us able to run multiple
QEMU Zephyr instances of the same sample.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
Johann Fischer
08df5961b3 arch: intel_quark: use DW device driver when USB is selected
This patch allows more generic USB configuration in the samples
and removes platform dependent driver configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-28 15:14:15 -04:00
Paul Sokolovsky
d950ec2981 samples: net: Add socket-based echo server example
The example source code is POSIX-compatible (modulo include files),
i.e. can be built and behaves the same way for Zephyr and a POSIX
system (e.g. Linux). Makefile.posix is available for the latter.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-06-28 16:07:55 +03:00
Johann Fischer
3dd51d52a2 drivers: usb: use generic option name for log level
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-28 09:02:27 -04:00
Jukka Rissanen
cd19a57811 samples: net: mbedtls: Fix server compilation
The code has missing proper conversion from net_buf to net_pkt
that was implemented in commit db11fcd "net/net_pkt: Fully
separate struct net_pkt from struct net_buf"

The sample.yaml had incorrect whitelist string so this is also
fixed here.

Fixes #596

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-27 19:20:53 -04:00
Anas Nashif
6ff291a174 tests: do not exclude quark_d2000_crb
quark_d2000_crb does not build net/bluetooth tests by default now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Anas Nashif
3c50f7aa12 tests: samples: remove duplicate filtering
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Jukka Rissanen
92fa7ac6ce net: http: Remove mbedtls heap setting from http library
The global mbedtls heap is set automatically now so no need to
set it individually in the http library.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-27 16:42:59 +03:00
Kumar Gala
514a07a9e2 samples: coaps_server: Fix platforms to build coap_server test on
We incorrectly had an arch_whitelist constraint set to 'qemu_x86' that
should have been a platform_whitelist, so fix that and add arduino_101
frdm_k64f to the platform_whitelist as targets that we can test this on.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-23 16:03:21 -04:00
Johann Fischer
aea4c31722 samples: wpanusb: remove unnecessary condition for ccflags
The condition in src/Makefile is not necessary since the
net_private.h is always included from wpanusb.c and is not
dependent on the transceiver.

Change-Id: I07a0bf599f328bacb8c5677f20eb221a05f30866
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-22 07:09:07 -04:00
Anas Nashif
470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif
cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif
397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05:00
Aska.Wu
2970e8beae samples: coaps_server: add prj_frdm_k64f.conf
Be able to test coaps server on frdm k64f board.

Jira: ZEP-1878
Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-06-14 09:51:34 +03:00
David B. Kinder
d1bdb3e092 doc: fix board/sample broken links
Some files have moved from their original location, or are no longer
available.  For the mbedtls samples, tweak the link to point to a page
where links for current and previous downloads can be found.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-13 20:49:13 -04:00
Leandro Pereira
cf05b11924 samples: net: Do not assume TCP connection was successful
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-13 10:33:41 +03:00
David B. Kinder
342bdda760 doc: spelling fixes in samples/ and boards/
regular spelling check on .rst files

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-12 18:28:08 -04:00
Jukka Rissanen
57df515028 samples: net: echo-client: Fix compile error
This commit fixes compile error caused by commit 39962dc9
"samples: use k_thread_create()"

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-12 18:01:50 -04:00
Andrew Boie
e87eacacfa samples: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Jukka Rissanen
e90f4e1486 sample: net: Add https-client sample application
This https-client sample starts to send HTTP GET/HEAD/POST
requests same way as http-client, to https server that can
be found in net-tools repository.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-09 09:56:21 +03:00
Jukka Rissanen
393ab90785 samples: net: Fix README.rst file documentation
Various network samples contained QEMU slip setup instructions
or those instructions were missing. A reference doc in
doc/subsystems/networking/qemu_setup.rst file already has the
setup instructions for QEMU. So add a reference to that file
in samples/net/*/README.rst files and remove unnecessary slip
setup instructions in relevant files.

Fix various typos in readme files at the same time.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-09 09:55:37 +03:00
Leandro Pereira
cb0f81f25f samples: dns_resolve: Clarify documentation about DNS configuration
Add clarification that the DNS server configuration must be edited in
the respective prj.conf file.

JIRA: ZEP-2040
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-03 15:02:14 -04:00
Jukka Rissanen
3616ec145b samples: net: http_client: Increase the number of buffers
The number of RX and TX buffers is increased to 64 as the
earlier limit can cause memory exhaust in some cases.

Jira: ZEP-2223

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-02 12:43:52 +03:00
Jukka Rissanen
bad6e28827 samples: net: dtls_client: Fix Coverity warning
This fix is basically a no-op as the rx_buf pointer cannot be null
in practice, but in order to avoid Coverity complaining about
it add some null pointer checks to the UDP handling code.

Coverity-CID: 170124
Jira: ZEP-2235

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-02 12:34:50 +03:00
Jukka Rissanen
7d13261bd9 samples: net: zperf: Fix llvm compiler warnings
Jira: ZEP-1884

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-01 10:30:21 -04:00
Leandro Pereira
7a972c0229 samples: mqtt_publisher: Try connecting a few times before giving up
Waiting for an NET_EVENT_IF_UP before trying to connect isn't sufficient
in some cases; for instance, on devices using the MCUX HAL, such as the
FRDM-K64F, the interface will have the NET_IF_UP flag set even though
the link negotiation didn't yet complete.

Executing this sample on such board will produce the following output.
Notice the "Enabled 100M..." message right after trying to connect.

    [dev/eth_mcux] [DBG] eth_0_init: MAC 00:04:9f:6f:91:da
    net_context_connect error Is the server (broker) up and running?
    [publisher:247] network_setup: -60 <ERROR>

    Bye!  [dev/eth_mcux] [INF] eth_mcux_phy_event: Enabled 100M
    full-duplex mode.

Even though the returned error is ETIMEDOUT, increasing
net_context_connect()'s timeout parameter to several seconds isn't
sufficient; other steps performed by network_setup() after the link has
been fully established are necessary.  As a stopgap measure, try
connecting a few times before giving up (more than one connection
attempt should be made by application in most cases, anyway.)

It might be the case that we need events to monitor ethernet link
(re)negotation in addition to the NET_IF_UP bit.

Jira: ZEP-2036
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-31 17:16:28 -04:00
Jukka Rissanen
35ef580389 samples: net: coaps_client: Fix testcase.ini
The platform list was incorrectly set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 17:35:20 -04:00
Jukka Rissanen
5a0b4976d9 samples: net: coaps_client: Fix compile issues
The coaps_client was bit rotted and did not compile
correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 17:35:20 -04:00
Jukka Rissanen
e7c52a492f samples: net: mbedtls_dtlsclient: Fix testcase.ini
The platform list was incorrectly set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:51:35 +03:00
Jukka Rissanen
27990f77e1 samples: net: mbedtls_dtlsclient: Fix compile issues
Some net_pkt API changes were not done for this sample.

Jira: ZEP-2072

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:51:35 +03:00
Jukka Rissanen
eeaa29666b net: http: Handle HTTPS connection closing gracefully
If the HTTPS connection is closed, then properly handle call to
HTTP parser init in case of error and also remove any pending
data that belong to old connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:50:33 +03:00
John Andersen
7985e917c9 samples: net: mqtt_publisher: fixed formatting
README.rst had formatting which was making things disappear in the
online documentation.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-05-25 18:48:49 +03:00
Jukka Rissanen
11aee50eef sample: net: http: Add Basic auth support to server sample
Basic auth support was missing from HTTP server sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-23 18:01:04 +03:00
Jukka Rissanen
63ca45b222 samples: net: http: Remove Arduino-101 config from server
There is not enough memory to run the HTTP server sample
application in Arduino-101 so remove the config file.

Jira: ZEP-2157

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-19 16:05:38 +03:00
Anas Nashif
6aa77e9f3e Revert "net: zoap_server: Unify Makefile and add prj file"
This reverts commit 350d5d4d60.

This change break with many boards and leaves prj.conf unused.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 15:09:15 +03:00
Jukka Rissanen
c9d21ef831 samples: net: http: Remove obsolete files from server sample
There was some left overs from earlier version of http_server
sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-18 15:07:02 +03:00
Wu Jiequan
350d5d4d60 net: zoap_server: Unify Makefile and add prj file
Modify the Makefile to unify with other sample apps and
add the arduino 101 configuration file.

Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-05-17 09:37:40 +03:00
Jukka Rissanen
a174d2eba7 net: http: Add HTTP server library support
This commit creates a HTTP server library. So instead of creating
a complex HTTP server application for serving HTTP requests, the
developer can use the HTTP server API to create HTTP server
insteances. This commit also adds support for creating HTTPS servers.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Jukka Rissanen
19868313fc net: samples: Fix the BT compilation in sample API
The CFLAGS and object path were set incorrectly for Bluetooth.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Jukka Rissanen
d4c5cc10e4 net: samples: Add support to wait both IPv4 and IPv6
The net_sample_app_init() is now able to wait that both IPv4
and IPv6 addresses are setup before continuing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Andrew Boie
39962dc92c samples: use k_thread_create()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 20:24:22 -04:00
David B. Kinder
2f41cb8329 doc: misspelling and UTF-8 fixes
More general spelling fixes, and cleaning up stray UTF-8 characters
such as curly-quotes, em- and en-dashes.  Use replacement strings
for |reg| and |trade|.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-05-09 20:15:49 -04:00
Jukka Rissanen
dc0fc57917 net: samples: Common application init API
This creates a common API for network sample applications for
setting up IP addresses etc. The HTTP client application is modified
to use this API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-04 15:58:45 -04:00
Jukka Rissanen
70f334d9f2 http: client: Create a HTTP library
Instead of separate sample application that does everything
related to HTTP client connectivity, create a HTTP client library
that hides nasty details that are related to sending HTTP methods.
After this the sample HTTP client application is very simple and
only shows how to use the client HTTP API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-04 15:58:45 -04:00
David B. Kinder
1d36cfba90 doc: change gerrit references to github
We're moving the project code to GitHub folks, so change references
in the documentation from gerrit over to GitHub:
https://github.com/zephyrproject-rtos/zephyr

Change-Id: Ic491a62ed43fc799eb5698e92435cb6eb4d89394
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-28 21:21:06 +00:00
Paul Sokolovsky
ddf23f3167 samples: net: dns_resolve: Clarify that DNS queries aren't immediate
The sample in its default configuration waits for DNS server
configuration via IPv4 or IPv6 specific means. Until this
information is receives, DNS querying won't even start. Make
diagnostic messages explicit of this fact, because if user
doesn't have required services available in the network, the
sample will appear to just hang.

Jira: ZEP-2061

Change-Id: I56a5b7354a2d1239a35d8334ed95a15ebd19254f
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:12 +03:00
Ravi kumar Veeramally
e4d8900cc6 net: samples: Use correct API to get net pkt length
net_pkt_get_len() is the correct API to get network packet
length.

Jira: ZEP-2076

Change-Id: Ifff6f3d5df28b3684cc8bb3758f9e8bccd5d4534
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-04-28 15:01:11 +03:00
Bogdan Davidoaia
efc3ba6b98 samples: net: ieee802154: add KW41Z config file
Add config file to be used for testing KW41Z's IEEE 802.15.4 driver.

Jira: ZEP-2026
Change-Id: I7042c57ad33ff72b35d24fbf28085b99b2301726
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-04-28 15:01:10 +03:00
Jukka Rissanen
f7d291ea90 samples/dns: Add config file for Arduino-101 and FRDM-K64F
The dns_resolve sample application did not had project file for
two boards that the README file is talking about, so adding them here.

Jira: ZEP-2040

Change-Id: I68e825854a171b09d56df91ab80ce5d9349733f6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-28 15:01:09 +03:00
Paul Sokolovsky
25307d5331 net: net_pkt_append: Refactor to return length of data actually added
For stream-based protocols (TCP), adding less data than requested
("short write") is generally not a problem - the rest of data can
be sent in the next packet. So, make net_pkt_append() return length
of written data instead of just bool flag, which makes it closer
to the behavior of POSIX send()/write() calls.

There're many users of older net_pkt_append() in the codebase
however, so net_pkt_append_all() convenience function is added which
keeps returning a boolean flag. All current users were converted to
this function, except for two:

samples/net/http_server/src/ssl_utils.c
samples/net/mbedtls_sslclient/src/tcp.c

Both are related to TLS and implement mbedTLS "tx callback", which
follows POSIX short-write semantics. Both cases also had a code to
workaround previous boolean-only behavior of net_pkt_append() - after
calling it, they measured length of the actual data added (but only
in case of successful return of net_pkt_append(), so that didn't
really help). So, these 2 cases are already improved.

Jira: ZEP-1984

Change-Id: Ibaf7c029b15e91b516d73dab3612eed190ee982b
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:09 +03:00
Piotr Mienkowski
f9a85815c2 samples: net: remove redundant Kconfig options for sam_e70_xplained
- Manual MAC address settings
- Default ETH driver initialization priority

Change-Id: I6294e2f66623087dfdc131344a94d0e9f2edc6b4
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-28 15:01:09 +03:00
Kumar Gala
a509441210 net: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I4ec03eb2183d59ef86ea2c20d956e5d272656837
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:30:38 -05:00
Tomasz Bursztyka
e5896906f6 net: Rename all *_BUF() macros to *_HDR()
Most of these macros are not exactly exposing a buffer, but a specific
header pointer (ipv6, ivp4, ethernet and so on), so it relevant to
rename them accordingly.

Change-Id: I66e32f7c3f2bc75994befb28d823e24299a53f5c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:51 +03:00
Tomasz Bursztyka
db11fcd174 net/net_pkt: Fully separate struct net_pkt from struct net_buf
- net_pkt becomes a stand-alone structure with network packet meta
  information.
- network packet data is still managed through net_buf, mostly named
  'frag'.
- net_pkt memory management is done through k_mem_slab
- function got introduced or relevantly renamed to target eithe net_pkt
  or net_buf fragments.
- net_buf's sent_list ends up in net_pkt now, and thus helps to save
  memory when TCP is enabled.

Change-Id: Ibd5c17df4f75891dec79db723a4c9fc704eb843d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Tomasz Bursztyka
bf964cdd4c net: Renaming net nbuf API to net pkt API
There have been long lasting confusion between net_buf and net_nbuf.
While the first is actually a buffer, the second one is not. It's a
network buffer descriptor. More precisely it provides meta data about a
network packet, and holds the chain of buffer fragments made of net_buf.

Thus renaming net_nbuf to net_pkt and all names around it as well
(function, Kconfig option, ..).

Though net_pkt if the new name, it still inherit its logic from net_buf.
'
This patch is the first of a serie that will separate completely net_pkt
from net_buf.

Change-Id: Iecb32d2a0d8f4647692e5328e54b5c35454194cd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Kumar Gala
789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Tomasz Bursztyka
3a3636ff7f net/ieee802154/samples: Add a Kconfig option to tweak the TX power
This can be useful to override the default value, for testing.

Change-Id: I23b559152c71955ff5aa6fd3643f1f40f5594194
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:46 +03:00
Jukka Rissanen
611ccaaf88 net: dns: Remove dns_client API and sample application
DNS resolving is better done with DNS resolve API so remove
the DNS client API which is quite hard to use.

Change-Id: Ide4973a5be674414ea6e04a35c938195cce40b6a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Jukka Rissanen
abb24bb46b samples: net: irc-bot: Use DNS resolve API
Modify the code to use DNS resolve API instead of DNS client API
as the latter is being phased out.

Change-Id: I6a7618d770621fee1f502d2bc277a162c589108a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Wu Jiequan
432c750d36 net: coaps_server: add prj_arduino_101.conf file
In order to test the coaps_server sample app on
Arduino 101 board.

Change-Id: I7b393dac03a8020b7bd515c3b5b2fd961940bc21
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:44 +03:00
Wu Jiequan
c84eff0be4 samples: net: http_server: Add bt test and arduino 101 support
Added bt test code in the http_server sample app and in order
to test on Arduino 101 board, added prj_arduino_101.conf file.

Change-Id: Ie68a81ee809e8618f70b5fab6fdbd66692401014
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:43 +03:00
Luiz Augusto von Dentz
4d1115ab35 net: Enable context buffer pool in case TCP and 6LO are enabled
The context buffer pool was introduced to deal with TCP holding buffers
when 6LO may modify them, therefore it makes sense to have it enabled
by default when TCP and 6LO are enabled given that the code can deal
with NULL pool in case the application don't implement one.

Change-Id: I600ca31ab40c96ee27937c2e885e332b0cee4995
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-07 18:32:18 +03:00
Piotr Mienkowski
afdb0e0a70 drivers: eth_sam_gmac: Fix initialization order
Atmel SAM family GMAC Ethernet driver is implementing zero-copy
networking. As a result it has to reserve a defined amount of RX
data net buffers before bringing up the interface. Since net buffer
pool is initialized by the network stack and this driver was bringing
the interface up in its initialization function the driver initialization
was performed, as a workaround, after network stack initialization. It
is not a clean solution. This patch fixes this by bringing the
interface up in interface initialization function. The driver itself
can now be initialized before the network stack is.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I65886fd6db6f27a10628e393cfabd8e5f78c08ff
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-07 12:35:51 +03:00
Leandro Pereira
bb4a2eef7f samples: net/nats: Fix parsing of MSG messages
This addresses the issues found by QA in ZEP-1012 and clarify the
documentated behavior as described in ZEP-1859.

Change-Id: I602e5749db7f6f44cf5be449b8e6f0d2ba66b69b
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-04-05 18:24:45 +00:00
David B. Kinder
7bc4890202 doc: add labels to net sample docs for linking
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I46cd75d714449de806a85dde08756c8e190488dc
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:52:06 +00:00
Tomasz Bursztyka
e027645c88 net/samples/ieee802154: Making hw sample simpler
- Let's use samples settings
- Enable both net and 15.4 shell modules
- Change prj_*.conf accordingly

Change-Id: If7e32a42c8dc7026d0580b1e94e819e1eda82e5b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:28 +02:00
Tomasz Bursztyka
d2f8a5a27f net/samples: Add 802.15.4 link-layer security settings for the samples
And use them accordingly in the common code part.

Change-Id: Id91b76e5baea607c0d68eebcde6f84e4e35ca44c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka
7b8af87fdf samples/net: Remove the need for IEEE 802.15.4 stack in wpan serial
It can uses CONFIG_NET_APP_IEEE802154_* options instead.

Change-Id: I2501ca2015cfc1e68c6c384cb32c21084d2cb30d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka
26a4df620f samples/net: Uses CONFIG_NET_APP_IEEE802154_* options relevantly
In order to simplify when 802.15.4 is selected on these samples, let's
setup the device through a common code.

For this to work, RFD is now the default.

Change-Id: I46590864442f77d83f681cc0e854c94344648856
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka
0f18ce44f9 net: Rename Kconfig.samples and its main option for future changes
s/SAMPLES/APP for name shortening. Applying the change where relevant.

Not only IP addresse will be available as samples settings there but
also IEEE 802.15.4 channel, pan_id, and more for instance.

Change-Id: I05dd24989bd0c804d9588092d67044a3e063bc88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:26 +02:00
Jukka Rissanen
c6cad93d8c samples: net: DNS resolving sample application
Change-Id: I4a0283efde4d0dd8ccd0933071acb277431d4a32
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka
3b0769889b net/samples: Add static ipv4 addresses for arduino 101 echo apps config
Jira: ZEP-1444

Change-Id: I689ae6b4b5316e36cdacdf20acbf6e335a10c9e5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka
d7145b3556 drivers/ieee802154: Remove very old CC2520 left-over from µIP stack
Change-Id: Ief7ef008905e81cedcfc1b7ea2f21702cb68a4ce
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:41 +02:00
Jukka Rissanen
4fcf04dde8 samples: net: Remove multicast address setting in echo-client
The echo-server no longer uses multicast addresses itself,
so the multicast address setting can be removed from echo-client.

Change-Id: Ieab069849ced8a850ada6e6618d625695819be8e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:41 +02:00
Jukka Rissanen
35352130b5 samples: net: Remove multicast address setting in echo-server
The multicast address setting in echo-server was not really
used for anything so removing it from the app.

Change-Id: I8069c670388702fc46ae2f31506c982caa28212d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:41 +02:00
Andrei Emeltchenko
2801389a14 wpanusb: Fix using incorrect nbuf in fragment_get()
Fixes using buf instead of pkt.

Change-Id: I21fd84b68a3967bfc701887f01a7b403d04a4504
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Andrei Emeltchenko
0d168bff77 drivers: cc2520: Correct configuration options
At the moment CC2520 configuration options are selected inside "TI
CC2520 Driver RAW channe" submenu like:

           [*] TI CC2520 Driver support  ----

           [ ] TI CC2520 Driver RAW channel  --->

Make RAW channel depends on TI CC2520.

Change-Id: I92879b7f4391f1842c012b6c03c78956e90b9441
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Andrei Emeltchenko
33c2480c09 wpan_serial: Correct system logging domain
Correct logging domain to wpan_serial.

Change-Id: Ic5e99d2fc31ba68c7b211acbf372ee26ab93a62f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Inaky Perez-Gonzalez
933366631c samples/net/echo_client: add SAM e70 and FRDM k64f ethernet configurations
These are copied verbatim from the echo_server sample.

Change-Id: I56d1386144967177f889e12d4a173bfb6628f18b
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-03-24 17:31:40 +02:00
Jukka Rissanen
3a1a4d3105 samples: net: coaps_client: Fix the parameters when setting callbacks
The RX callback and timeout parameters were reversed in call to
mbedtls_ssl_set_bio().

Change-Id: I285694e57a024ac3ce735e496daad690f94737ac
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:45 +02:00
Michael Scott
081246737c net/http: let HTTP_SERVER, HTTP_CLIENT and HTTP_PARSER select HTTP
Due to commit 8308b9bd2d ("net/http: Add the HTTP/1.1 API")
every user of CONFIG_HTTP_PARSER would need to add CONFIG_HTTP to
their .conf files.  Which is fine for intree samples/tests as they
have been adjusted, but the rest of world working on Zephyr apps
will need to make this changes as well.

Instead, we should have each of the following select HTTP instead of
depend on it, which will make future use of these configs and their
dependencies more intuitive:
HTTP_SERVER
HTTP_CLIENT
HTTP_PARSER

NOTE: As cleanup, this commit also removes the CONFIG_HTTP added to
samples and test .conf files.

Change-Id: I81cfaa19e37333b1bf98778f8147814780e7f77c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-03-17 10:34:45 +02:00
Piotr Mienkowski
c54b3c7e8f drivers: Update Atmel SAM family GMAC Ethernet driver
Networking stack has split one global DATA pool to RX and TX DATA pools
and also added net_buf pool support to each context. Update the driver
to support this new design. Since the GMAC TX descriptor list has a fixed
size but the number of TX DATA buffers is no longer limited updating the
TX descriptor list has to be guarded by a semaphore.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I181e1cdd183e173b85d5d1711b6e78cd5165666d
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-03-17 10:34:44 +02:00
Ravi kumar Veeramally
bd1f30a3b9 net: samples: leds_demo: Fix memory leak
Unref the buffer if net_contect_send_to() fails to send.

Change-Id: I182125e64aabd171cd86f42fd9e1de036dd68544
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-17 10:34:42 +02:00
Jukka Rissanen
fdccd1caf9 samples: net: zperf: Fix compiler warnings
LLVM/icx compiler gives some warnings for signed vs unsigned
pointers.

Jira: ZEP-1884

Change-Id: Ide57be898ebd1bff49c8a27aac392fa58dcae726
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:41 +02:00
Flavio Santes
876e341570 samples/net/http: Add the HTTP Basic Authentication routine
This patch adds the HTTP Basic Authentication routine "http_auth".
Authentication parameters are defined in the config.h file.

The README file is also updated by this patch.

Jira: ZEP-1543

Change-Id: I2d531966290e87a68c54fc1ac834491ac937df22
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:40 +02:00
Flavio Santes
e1b46bfe29 samples/http: Match header field ctr with Kconfig variable
Set a local define with the value previously defined at the Kconfig
file.

Change-Id: I3ee424c4a1102ca00c0059cb9d0a86498806486f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:39 +02:00
Sergio Rodriguez
ff5178fd22 samples: mbedTLS coap: Cleaning prj.conf for QEMU
Removing unneeded configuration

Change-Id: I72e3714358366de715cb6f47d690a1b0e8f032f5
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-17 10:34:39 +02:00
Sergio Rodriguez
1b48f9fbc3 samples: mbedtls coap: Fixing entropy source
Using a more efficent entropy call and proper output data

Jira: ZEP-1878

Change-Id: Ife738b84c1e56d58784b4fbc61ec0843579c4453
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-17 10:34:39 +02:00
Juan Manuel Cruz Alcaraz
172c031ec9 sample: net: mbedtls ssl: SSL client sample is adapted to TCP API
Jira: ZEP-1798

Change-Id: I790cd49cb7cc5ed207141ca6634999d77d6a19bb
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
695cfff535 samples: net: dtls_client: Fix memory leak in RX path
If we have not yet handled the previous RX buf, then we need
to drop the latest received one, otherwise the earlier net_buf
is leaked.

Change-Id: I1b69e07e8b3a3b87c76d923c847dc8316c128e76
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
3a2bd9a162 samples: net: dtls_client: Fix mem leak in error path
We need to unref the net_buf in error path in RX and TX.

Change-Id: Icb6d43cb6b7411a5135ea09c6ae96742566fafc4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
dc8a019823 samples: net: dtls_client: RX buf count too low
The mbedtls_dtlsclient needs more RX buffers.

Jira: ZEP-1855

Change-Id: I80732c511dfade8fa9139e3bd26e21de73a68acd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
b1aadd0b3a samples: net: http_server: Disable mbedtls
Sanitycheck cannot link the result qemu binary because it is too
large. As a workaround, disable mbedtls to get the linking pass.

.../real-ld: zephyr.elf section `noinit' will not fit in region `RAM'
.../real-ld: region `RAM' overflowed by 192 bytes
collect2: error: ld returned 1 exit status

Change-Id: I543571505ab9412db7eac101848c6032d1550d79
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Juan Manuel Cruz Alcaraz
6828412f27 samples: dtls client: DTLS client sample configuration file
The configuration file for Arduino 101 for the DTLS client
sample needs to define IPv4 and IPv6 addresses.

Jira: ZEP-1169

Change-Id: Iabfd5f067d39faaf8796aac84642b630b11ef7f6
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
87bc931826 samples/net: Add the HTTP API to the HTTP client sample application
This patch replaces some routines found at the HTTP client sample
application by the ones defined at the HTTP API.

Jira: ZEP-1824

Change-Id: Id19e3e346c09716ac95b0c488ff6e6949a5fbabe
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
848966be43 samples/net: Add the HTTP API to the HTTP server sample application
This patch removes some routines from the HTTP server sample
application and replaces them by the ones defined at the HTTP API.

Jira: ZEP-1824

Change-Id: Ia5db424d62997e01896294e12224aa65a58db432
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
8308b9bd2d net/http: Add the HTTP/1.1 API
This patch adds the HTTP/1.1 API for Zephyr. This API consists of client
and server context structures enabled via Kconfig variables.
HTTP parser support is enabled via the CONFIG_HTTP_PARSER configuration
variable.

Currently, this API only includes support for writing HTTP requests
(client mode) and HTTP responses (server mode). TLS support is not
considered in this iteration.

Supported HTTP methods:
	GET, HEAD, OPTIONS and POST.

Supported HTTP responses:
	400, 403 404. The http_response routine may be used to write
	any HTTP status code, for example 200 OK.

Jira: ZEP-1701

Change-Id: Ic9ccd4d4578d6d0f3a439976ea332b031644ca7d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
e29202593d samples/net: Add the QEMU x86 prj file to the HTTP client sample app
Add the QEMU x86 project configuration file to the HTTP client sample app.

Change-Id: Ice6ae3f3559680e1d182506671984fd5f946f1d8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
f6d40023b4 samples/net: Fix format warning in the HTTP client sample app
Fix a printk format warning found at the HTTP client sample app.

Change-Id: I9665e3e59595b383d6e809af51fe4cf3cd8f8bd8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
a561f5e1c7 samples/net/http_client: Cast size_t to int to avoid compiler warnings
Cast size_t to int in the http_client_cb code.

Change-Id: I36133da953669ec133421b5e7fb21bec9807fd06
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Marcus Shawcroft
7e6656eb9e samples: net: echo-server: Fix conditional around net_if_ipv4_addr_add()
The invocation of net_if_ipv4_addr_add() should be included within the
conditional code that sets up the address added.

Change-Id: I9b4e76a6b4922b3455bc6b383431b4124d40a49e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:47 +02:00
Vinicius Costa Gomes
43ae27fd9b samples/coaps_server: Don't error if the packet doesn't have payload
GET and DEL requests may not have payloads, so it's not correct to
return with an error in those cases.

This was only noticed now that zoap_packet_get_payload() returns the
correct value for all situations.

Jira: ZEP-1754

Change-Id: Ie533041aa7a66855582ff4c5c937d943304bad84
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-03-09 20:33:47 +02:00
Luiz Augusto von Dentz
4db2c941be net: samples: Enable CONFIG_NET_CONTEXT_NBUF_POOL in prj_bt.conf
Bluetooth consumes buffer when transmitting them therefore any protocol
that need to retain them, like TCP, needs to have its own pool to copy
the buffers as they may need to be resent in case they are not acked.

Change-Id: I483c5a3eb4d54fae6b5b2902c69b67e8c2e0be5e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-03-09 20:33:46 +02:00
Leandro Pereira
141c0a5f1a samples: net: NATS protocol sample
NATS is a publisher/subscriber protocol implemented on top of TCP. It
is specified in [1], and this is a sample implementation for Zephyr
using the new IP stack.  The API is loosely based off of [2].

With this sample, it's possible to subscribe/unsubscribe to a given
subject, and be notified of changes asynchronously.  In order to
conserve resources, the implementation does not keep its own track of
subscribed subjects; that must be performed by the application itself,
so it ignore unknown/undesired subjects.

TLS is not supported yet, although basic auth is.  The client will
indicate if it supports username/password if a certain callback is set
in the struct nats.  This callback will then be called, and the user
must copy the username/password to the supplied user/pass buffers.

Content might be also published for a given subject.

The sample application lets one observe the subject "led0", and turn it
"on", "off", or "toggle" its value.  Changing the value will, if
supported, act on a status LED on the development board.  The new
status will be published.

Also worth noting is that most of the networking and GPIO boilerplate
has been shamelessly copied from the IRC bot example.  (Curiously, both
protocols are similar.)

[1] http://nats.io/documentation/internals/nats-protocol/
[2] https://github.com/nats-io/go-nats

Jira: ZEP-1012

Change-Id: I204adc61c4c533661eacfb8c28c1c08870debd91
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-09 20:33:45 +02:00
Flavio Santes
760c1f1214 samples/net: Fix error handling issues in IRC bot
Fix the following error:

Calling "transmit(irc->conn, pong, ret)" without checking return value.
It wraps a library function that may fail and return an error code.

Coverity-CID: 163115

Change-Id: I525e1059e6a2ae3896f68760f1a8a6c68ecfc074
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:45 +02:00
Flavio Santes
c406be6360 samples/net: Fix uninitialized variable error
Fix "Uninitialized variables (UNINIT)" error found at the
HTTP client sample app.

Coverity-CID: 163117

Change-Id: I3d350fdc0e49a7bb7bea9d7af04494f6e918d603
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:45 +02:00
Jukka Rissanen
aeb08874af net: samples: echo-client: Allow UDP and TCP run at the same time
Run both TCP and UDP to run at the same time. This requires two
extra threads in echo-client sample application.

Change-Id: I450a26d7ab1472150ea8f1309a43897a30bd4d90
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:44 +02:00
Jukka Rissanen
f8c60de061 net: nbuf: Create net_nbuf_frag_del() for tracking allocations
Create net_nbuf_frag_del() so that we can track net_buf frees.
If CONFIG_NET_DEBUG_NET_BUF is not defined, then this new function
will call net_buf_frag_del() directly, and if not, then it will
track memory usage.

Change-Id: I5f382436cebc71fdaf12baf7bf964fb63bee7aca
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:44 +02:00
Jukka Rissanen
5197266768 net: nbuf: Use net_nbuf_get_frag() to allocate a fragment
The code used net_nbuf_get_reserve_{rx|tx}_data() function to
allocate a fragment. Instead of that low level function, use
net_nbuf_get_frag() instead. There are few places this is not
possible or is too big change like in few test programs.

Change-Id: Ied7e2b7db352de998b200ffa6ff82471bfa5ebe3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen
d32503f57e net: nbuf: Split one global DATA pool to RX and TX DATA pools
If we receive lot of packets, it might happen that we exhaust
all the DATA buffers in the system. This would prevent from
us sending anything to the network.
Change this by splitting the DATA buffer pool into RX and TX
parts. This way RX flooding cannot consume all DATA buffers
that needs to be sent.

Change-Id: I8e8934c6d5fdd47b579ffa6268721b5eb3d64b6d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen
ee0cff9ac7 samples: net: Use context specific net_buf pools in echo_*
Use context specific net_buf pool in echo-server and echo-client.
This will prevent application from allocating all available network
buffers in the system and thus preventing the core IP stack
functionality.

Change-Id: I3dbc64dd81c8a1165241426287a3530d00cbc7bf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:42 +02:00
Sergio Rodriguez
ee8bfe586b samples: mbedtls: Fixing entropy source
Using a more efficent entropy call and proper output data

Change-Id: I2ce71f63b6f22e5ceda79babd2eac802fa4bdf53
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-09 20:33:40 +02:00
Flavio Santes
c318967c56 samples/net/mqtt: Don't break lines after the "static" keyword
Fix some style issues found at the src/main.c file.

Change-Id: I2023deb5ac4f31b2cf5d14d8313bbcfc03647898
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes
9b381058f5 samples/net/mqtt: Move conf parameters to config.h
Move the client id define to config.h. Update the README file.

Change-Id: I1900c5e4f8c449e14279660d425501e86e07d409
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes
4979accb9f samples/net/mqtt: Improve inline doc
Remove the brief keyword for the mqtt_client_ctx structure's
inline documentation.

Change-Id: Ia3999bbb7e3246495fd1cab0ca828d95f5896835
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes
31f014a56d samples/net/mqtt: Simplify MQTT publisher
Remove the global bluemix flag and use a #define to set the
MQTT publisher topic and its parameters at compile time.

This change will save a few bytes and speed up computations.

Change-Id: I27bfc6b38c73d32c6105f1d506e147e9a5583097
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Vinicius Costa Gomes
270673e112 samples/zoap_client: Fix using the wrong timeout for retransmissions
It was assumed that the unit was microseconds, it is in miliseconds,
the same unit that is stored in the timeout field of the pending
transmission.

Change-Id: Ia99f363c7de4ec76a7ed229cb94a9964bcf609aa
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:55 +02:00
Vinicius Costa Gomes
2f574c7db5 samples/zoap_server: Add retransmissions for CON messages
This adds retransmission support for confirmable responses sent by the
server.

Jira: ZEP-1732

Change-Id: I77c0c6375fa666e4cfdda4016ad1e0e90caf4ac9
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
8e304ef2e6 iot/zoap: Fix requiring that the buffer is unchanged for retransmit
It is possible that the buffer waiting for retransmission is modified
after it is sent, for example, it can be compacted by 6lo, and our
assumption of where is the message ID is located in the buffer is no
longer valid.

As the message ID is the only information that is necessary for
keeping track of retransmissions, we keep a copy of it in the pending
struct, as well as the destination address of the retransmission.

Change-Id: Id33d54353404628673541225a1a05e27ee08765f
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
346edff2ca samples/zoap_server: Adds example for the link-format feature
This implements the /.well-known/core resouce and two children
resources (/core1 and /core2) so the link-format feature is better
explained.

Change-Id: I9dd8c69040c952c5d12a9987c1966a71b0257ef2
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
ddb9cf90a7 samples/zoap_server: Add a test case for the observer feature
This adds the resource necessary for the TD_COAP_OBS group of tests.

Change-Id: I33bd09910f74db90ad0d713e4479ab2e3ec343a5
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
8ce3d4ec82 samples/zoap_server: Add more validation tests for block-wise
Add the resource for the TD_COAP_BLOCK_04 ETSI testcase.

Change-Id: Ied901db34ce79d3e1f7f8c7fd55bc398b1f88640
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
da4580dc32 samples/zoap_server: Remove useless return statements
The functions that retrieve net_buf will wait forever until a buffer
is available.

Change-Id: I03ddd1239f50fe4467e86e31c8fbfc9b05c8b190
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Tomasz Bursztyka
2b5a343a0f samples/ieee802154: Update qemu based samples
- Let's build it with the various shell modules
- Make use of Kconfig.samples options

Thus: adding prj_server.conf and prj_client.conf to differentiate 2
instances of the app by their IPv6.

Then let's use samples/net/common/Makefile.ipstack

In the end, it is possible to build 2 times the samples this way:
make PCAP=154.pcap CONF_FILE=prj_server.conf server
and
make pristine
make CONF_FILE=prj_client.conf client

On client, or server, or both, shell commands can be used to ping each
other, check the statistics etc...

Once done, the given pcap file (154.pcap for instance) will have
recorded the traffic which can be parsed through:

wireshard 154.pcap

(Note: the "Malformed packet" warnings are not relevant, as the 15.4
frame FCS is a dummy one, it seems to make wireshark a bit lost)

Jira: ZEP-1774

Change-Id: I5590971660ecbfaac75af709124d59e1f98206fe
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-27 10:28:53 +02:00
Jukka Rissanen
1ca310fc93 samples: net: Fix the 802.15.4 monitor pcap saving
By default the net-tools package is expected to be located in
${ZEPHYR_BASE}/../net-tools directory. User can also specify
the directory using NET_TOOLS variable when running the make.

The net-tools package is located in this repository
https://gerrit.zephyrproject.org/r/net-tools

Change-Id: Ibccd7cabd567a630020fb9efbe1ec9e27b653b46
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-27 10:28:53 +02:00
Wojciech Bober
f8c2b2e099 samples/net/ieee802154: Update example with nrf5 802.15.4
This commit updates the 802.15.4 example to work with the
nrf5 802.15.4 radio driver.

Change-Id: I8a4c80a21ebe29ce2616836b764c454979ebb2e9
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Wojciech Bober
4be677fa45 samples/net: ieee802154: Add configuration for nrf5
This commit addes new configuration for examples which use
nrf5 802.15.4 radio.

Change-Id: I0c57334d071fb58bc2282feb3f4e6b949ce5d472
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Anas Nashif
fe118c4e95 license: replace APL2.0 license with SPDX
Some files made it through review process with full license header.

Change-Id: I2722b127c40b4b19500042c12e4fde85a165bae9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-20 16:59:46 +00:00
Jukka Rissanen
14034ac515 samples: net: Add README.rst to echo apps
Add a README.rst file to both echo-server and echo-client
sample applications.

Jira: ZEP-1539

Change-Id: I1ee1d02a3de0295697117f448d8e13f5b161e11b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Jorge Ramirez-Ortiz
c1c5e25bbc net/mqtt: Add support for IBM BlueMix Watson topic format
Change-Id: I044180d9f76a307c1cf4423a9b1d3ee6c540cbc7
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-15 12:20:08 +02:00
Flavio Santes
057f31e7e9 net/mqtt: Remove length computations for some msg fields
Currently, for the following MQTT msg fields:

- client_id
- will_topic
- user_name
- topic

their length is computed inside the routine that receives the MQTT msg.

Although this simplifies development, also imposes one restriction:
data must be null-terminated. Sometimes, data is received from other
sources and not generated by the application, so the null-terminated
constraint may be considered problematic for the user.

This patch removes the assumption that string fields are null-terminated.
Current data structures are already prepared to handle this case, so no
API change is required.

Change-Id: I5a147a5b21e0da49541cbe62baac363c8737cd3e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-15 12:20:08 +02:00
Flavio Santes
540505757f net/mqtt: Add support for QEMU x86
Add the QEMU x86 prj file to the MQTT publisher application.

Change-Id: I1ba8c3a3bf818d8f6dee7ea94021a83ba5277e5f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-15 12:20:08 +02:00
Jukka Rissanen
7608fcdb75 samples: net: Remove the README file
This README file is no longer needed as we have separate
README files in various sub-directories.

Change-Id: I38d1c4208e373aa7aa23373149ef1b89fbcda094
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Jukka Rissanen
9bfa9ca058 samples: net: Remove obsolete prj_slip.conf from echo-*
This config file is not needed.

Change-Id: Ib601605805d6c5c0173424b2e282a50a6a1076d6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Sergio Rodriguez
de60e4c8cd samples/net/http: Add HTTP over TLS sample application
Add the HTTPS (HTTP over TLS) server sample application on top
of the current HTTP Parser Library and mbedTLS. This code uses
TLS to stablish a secure connection and HTTP parser to identify
the request and the proper response.

Jira: ZEP-799

Change-Id: Ifbbcd0347bec47d12158440e50a82dc2966334d3
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:35 +02:00
Jorge Ramirez-Ortiz
f994efa8c1 net/mqtt: Add BT support to MQTT publisher sample
Change-Id: I56d54c3550a530bf250210e939840e7c7e89c5d9
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-14 08:30:35 +02:00
Richard Peters
d502c24a5d samples: net: Add .conf file for qemu_cortex_m3 in echo_*
Added conf files for qemu_cortex_m3, until a better solution
than CONF_FILE=prj_$(BOARD).conf exists in the makefile.

Change-Id: I1edc4f37bb3c49ecb65abf7c93b3c9f4608d601e
Signed-off-by: Richard Peters <mail@richardpeters.de>
2017-02-14 08:30:34 +02:00
Flavio Santes
f40bdd67ac net/http: Improve network configuration routines
Modify the network setup routine to accept the following parameters:
- network context
- accept callback
- server IP address
- server port

This change will allow us to reuse this routine for TLS.

Change-Id: I1fdbaa908783c69f87863cbc597b42f39358762c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes
79a064fae8 net/http: Add QEMU support to the HTTP server sample app
This patch adds the QEMU prj file for the HTTP server sample
app.

Change-Id: I0b910b5ec9970a7ffe9621e19d9544d899c22132
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes
449cbbd874 net/dns: Update QEMU prj file
Update the IPv4 addresses to 192.0.2.x.

Change-Id: I0eafccfaf691cfd2ffb896e18d3fdcf091837edc
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Vinicius Costa Gomes
62a6c9c6d0 samples/zoap-server: Update docs with information about libcoap
Add information about how to run libcoap's[1] implementation of the
ETSI testcases against zoap-server.

Jira: ZEP-1538

[1] https://github.com/obgm/libcoap (branch develop)

Change-Id: I6aa5989575cc15630371aa0761bee98fb6fe1b80
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Anas Nashif
d4c9a7d80c net: remove obsolete CONFIG_NET_YAIP
Change-Id: Ie8ef79e7d7a6f229af3771b7786af3db89c5e458
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-14 08:30:33 +02:00
Anas Nashif
3557d04eb5 tests: net: whitelist boards for telnet server
Change-Id: I141cb9e680584b9b26926eae288ae7a2a85633f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:00:39 +00:00
Marcus Shawcroft
7421928ae5 samples/dhcpv4_client: Switch from private net_sprint_ipv4_addr to public net_addr_ntop
Change-Id: I894c22548aeea4dcb42e457266e7e140acdace0f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:09 +00:00
Marcus Shawcroft
7a903ede9f samples/dhcpv4_client: Increase number of DATA buffers.
Change-Id: I0116613cb63070d08c4cb6ad7a5864d09a014c68
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:09 +00:00
Marcus Shawcroft
571bdbb7c3 samples/dhcpv4_client: Reduce default debug to dhcpv4
Turn down the default logging verbosity on the dhcpv4 frdm_k64f config
to focus on the dhcpv4 implementation.

Change-Id: Ifb450181add653951517a7b128b11657ec2bab62
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:08 +00:00
Marcus Shawcroft
15a151a0a0 samples/mbedtls_dtls_client: Fix wild write in entropy_source
The example entropy_source implementation should write entropy to the
output buffer rather than to the context pointer which in this example
happens to be NULL.

Take the opportunity to reorganize the entropy_source to use all of
the entropy provided by a call to sys_rand32_get() rather than just
1/4 of it.

The entropy_source() callback from mbedtls is given a maximum amount
of entropy to return, rather than a minimum amount.  Hence it makes
more sense to deliver exactly one chunk (32 bits) of entropy from the
call to sys_rand32_get() per call and let the mbedtls entropy handler
worry about how much entropy we actually need to collect (ie the threshold).

Change-Id: I57ed438de5cb1223619fde0fb8039d6eca284646
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:58 +00:00
Marcus Shawcroft
8a612c3a44 samples/mbedtls_dtls_server: Use k_uptime_get_32()
The kernel provides an API call to get the least signficant 32 bits of
system time, use it rather than	reaching under the hood.

Change-Id: I98fabdcadfd0a4fe5ae10226dabf4e6d31e88df6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:57 +00:00
Marcus Shawcroft
e2e43774d2 samples/mbedtls_dtls_client: Use k_uptime_get_32()
The kernel provides an API call to get the least signficant 32 bits of
system time, use it rather than reaching under the hood.

Change-Id: I9c303ef949f7670f2a2d9691c342e496873e96e6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:57 +00:00
Ravi kumar Veeramally
f6916acbee net: samples: Unref the buf if app data length is zero
Core stack is not removing the network buffer if app data length
is zero. So memory leak happening here.

Change-Id: I3d354b5e7008396ca7cb977631036871998165b4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-09 12:29:29 +02:00
Ravi kumar Veeramally
083e112197 net: samples: Unref net_buf using net_nbuf_unref
Using net_buf_unref() technically works but debugging the network buffer
allocations is more difficult if done like that.

Change-Id: Ib8e3f8b412c2f8388315c2f63cae4392f814ea2f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-09 12:29:29 +02:00
Juan Manuel Cruz
5225daad94 mbedtls: add arduino 101 configuration to ssl client sample
Jira: ZEP-748

Change-Id: Ied8c521f80b8f1d4b22497a059ee5c948449613f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2017-02-08 10:12:36 +02:00
Michael Scott
76551f469e samples: net: irc_bot: add testcase.ini
Change-Id: I61b6373572254cbb63a8170eb2dfd8381a0973a2
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott
92042b25c2 samples: net: irc_bot: fix size_t related build warnings
size_t has different types depending on the arch selected for
building.  Correct format identifier is %zu in this case.

Change-Id: I4388fcd8c5eb8bcd5997bb921bd80b4c2175b24c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott
6a3b3f0e46 samples: net: irc_bot: fix build break
Fix build break introduced in commit 6b013c4721c5
("net: nbuf: Add timeout to net_buf getters")

Change-Id: Iaa521c6a49ae740eaee5276936442ab8aa4c47ba
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Jukka Rissanen
bd3908b2a9 net: nbuf: Add timeout to net_buf getters
This commit changes the net_buf getter functions in nbuf.h
by adding a timeout parameter. These function prototypes
are changed to accept a timeout parameter.
	net_nbuf_get_rx()
	net_nbuf_get_tx()
	net_nbuf_get_data()
	net_nbuf_get_reserve_rx()
	net_nbuf_get_reserve_tx()
	net_nbuf_get_reserve_data()
	net_nbuf_copy()
	net_nbuf_copy_all()
	net_nbuf_push()
	net_nbuf_append()
	net_nbuf_write()
	net_nbuf_insert()

Following convinience functions have not been changed
	net_nbuf_append_u8
	net_nbuf_append_be16
	net_nbuf_append_be32
	net_nbuf_insert_u8
	net_nbuf_insert_be16
	net_nbuf_insert_be32
	net_nbuf_write_u8
	net_nbuf_write_be16
	net_nbuf_write_be32
so they call the base function using K_FOREVER. Use the
base function if you want to have a timeout when net_buf
is allocated.

Change-Id: I20bb602ffb73069e5a02668fce60575141586c0f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Wojciech Bober
573774a9bf drivers/net/ieee802154: Change configuration prefix
This commit changes Kconfig prefix for ieee802154 drivers to
IEEE802154_*. This is done for consistency with config prefixes
used in other subsystems.

Change-Id: Ibbb4d96d2b748f4f13135bde85304ec34c5a90a6
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
b9ac440d02 samples: net: Fix invalid memory access for TCP
Set protocol family value only after the buf is verified
to be non-null.

Change-Id: I0ce7bab3539087d0f522b4bb3024f46a7eb3c15f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:34 +02:00
Flavio Santes
c2c32d24e3 samples/net/http: Add the HTTP client sample application
This patch adds a basic HTTP client sample application.
The following HTTP 1.1 methods are supported: GET, HEAD,
OPTIONS and POST.

This sample application does not define an API for HTTP,
for more information see ZEP-346.

Jira: ZEP-827

Change-Id: Iee63a53f2ef424964f040eba20326d648249fc24
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-08 10:12:34 +02:00
Jukka Rissanen
2612b04d80 samples: net: zperf: Set the proper UDP payload
Use a static buffer for sending UDP payload instead of reading
values from memory.

Change-Id: I037db5cd9b8784966d481c36e8cbe92d19760475
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen
517fb19586 samples: net: zperf: Fix compiler warnings
Compiler was giving "Unused variables" warnings if IPv6 was
enabled and IPv4 was not, and vice versa.

Change-Id: I3b17534bb8bdef207512ea5b618e138edb420871
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen
47685ef71f samples: net: zperf: Fix udp.upload command
The IP address and port number were incorrectly parsed if
user used udp.upload command.

Change-Id: Ib37d481012af5e186a1e342c92d10ddef9fe35b1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen
1ec6038c48 samples: net: zperf: Initialize address family properly
The IP address family was not set correctly when setting up
the connection. This lead to connectivity error in udp.upload
command.

Change-Id: I598ff2675f97e10e2033763a497f7583c94f3840
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Flavio Santes
53e9245b33 samples/net/http: Add the HTTP server sample application
Add the HTTP server sample application on top of the
HTTP Parser Library.

This sample application is based on TCP and HTTP chunk
transfer code found at:

https://gerrit.zephyrproject.org/r/#/c/9977/

A README file with sample output and a detailed
description of this application is also provided.

Jira: ZEP-820
Jira: ZEP-1542
Jira: ZEP-1556

Change-Id: I649104a256190577000bbac118136d5bc21f83bf
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:20 +02:00
Luiz Augusto von Dentz
e89aebc4d5 net: samples: Add CONFIG_NET_L2_BLUETOOTH_ZEP1656
This enables these samples to interoperate with Linux 6LoWPAN over
Bluetooth implementation while that is being fixed, in the long term
we might remove it from the samples once Linux is fixed.

Jira: ZEP-1656

Change-Id: I8ca9fe5a27f43cebc75b6fe5a436a5e8fcee26d5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-03 15:59:20 +02:00
Flavio Santes
20bf36601b samples/net/dns: Update README file
The DNS client sample application was updated to use IP addresses
from the prj_*.conf files. This patch updates the README file to
reflect those changes.

Change-Id: Ic72510be8da208aef19fb188560221e1c2386457
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:19 +02:00
Anas Nashif
9051e1ab1d doc: net: use Qemu setup section in current documentation
Fix references to Qemu section and references to boards.

Change-Id: Ib2174ff698d57d3272073eecc71209e047961aaa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-03 15:59:19 +02:00
Anas Nashif
f75462984f doc: update networking with Qemu section
Copy the documentation from the Wiki over here, the cross linking
between online documentation and Wiki and duplication of information was
inconsistent and confusing. Put everything in one place.

Change-Id: Ia3aaec1b431477e2ec54dbec2ccaa655870b0ee3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-03 15:59:19 +02:00
Vinicius Costa Gomes
88405fcd17 samples/zoap_server: Fix errors for GET requests without payloads
It doesn't really make sense for GET requests to have payloads, we
shouldn't even be checking if they have any payloads.

Change-Id: I4bb8cccd6c733a5825c2ca5067a990937c7045a6
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:19 +02:00
Flavio Santes
76785f0bcd samples/net/dns: Improve network configuration
- Reorganize some CONF variables and add the CONFIG_NET_SAMPLES_xxx
  variables to the DNS sample application.
- Remove all the numeric IP addresses
- Use the CONFIG_NET_SAMPLES_xxx variables to define the IP addresses

Change-Id: Ib294d338f163f03ea1b47143b489d916578c532d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes
3a05189284 samples/net/dns: Move conf variables to config.h and delete unused defines
- Move the MAX_ADDRESSES macro to config.h.
  Document the meaning and usage of this macro

- Delete unused defines

Change-Id: I035feb605611e564db15cba77d6a3dce8409ca18
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes
660b0324e0 samples/net/dns: Add the FRDM_K64F board to the testcase.ini file
Add the FRDM_K64F board to the DNS sample app testcase.ini

Change-Id: Iea8f7d09ed0d793711a5807f4bb67ed35ebf52c1
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes
59b1384885 net/mqtt: Add the MQTT Publisher sample application
This commit adds the MQTT Publisher sample application for Zephyr.

The following MQTT API routines are exercised in this sample:

- mqtt_init
- mqtt_tx_connect
- mqtt_tx_pingreq
- mqtt_tx_publish
- mqtt_tx_disconnect

The following MQTT API data structures are used in this application:

- struct mqtt_ctx
- struct mqtt_connect_msg
- struct mqtt_publish_msg

This sample application exemplifies how to send MQTT PUBLISH messages
with different QoS values.

A README file is also included in this patch.

Change-Id: I2b41b276d5178a2cd1b07b031c38bff481885fff
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Jukka Rissanen
cc9ec3488f samples: zperf: Enable TCP for zperf configuration
Change-Id: I0154c6d890a3bff5be2cad5ea621660bf46a158d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:17 +02:00
Jukka Rissanen
48b9b96d3f samples: zperf: Use native IP stack for TCP support
Enable zperf code to support TCP using the native IP stack
when testing the network throughput.

Change-Id: I3e58754cfff65525ad15e63adf57f1ea22e4559d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:17 +02:00
Michael Scott
1a21a36b7e samples: net: irc_bot: add DHCPv4 support
When CONFIG_NET_DHCPV4 is selected, ignore the CONFIG_NET_SAMPLES_MY_IPV4_ADDR
setting and instead used DHCPv4.

NOTE: This commit also adds a placeholder for DHCPv6 behavior which is not
yet functional.

Change-Id: Id31fcb99be46e966babf18f94b5dec151920dedc
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott
fab087e9ba samples: net: irc_bot: add DNS support
When CONFIG_DNS_RESOLVER is active, the PEER config will be ignored and
instead a DNS query for DEFAULT_SERVER will be used.

Change-Id: If2c699944027f3c6a8ae9654f9cda0d7dca387c8
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott
2f10b31431 samples: net: irc_bot: add IPv4 support
NOTE: You must set CONFIG_NET_IPV6=n in the project .conf file for
the CONFIG_NET_IPV4 setting to take effect.

Only 1 IP connection is active at a time.  And when both are active
CONFIG_NET_IPV6 takes precedence.

Change-Id: I34a75f8d44db986810648d82a65d2ed29fc9a940
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott
8a7e30609a samples: net: irc_bot: add FRDM K64F project .conf
Change-Id: Id16d379629bba2f4663355021c7510170cd42cba
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
2618fcfb3c samples: net: irc_bot: add Linaro copyright
Change-Id: Ic16902e6ce28765ffd8d9cb2f1699a33af19d1ae
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
103c1aff9b samples: net: irc_bot: handle messages across multiple fragments
Often IRC messages are split across multiple netbuf fragments.
Let's fix the message processing to account for this.

Change-Id: I3835af6adf337d27c28a0beeb72848dcc838772c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
50a93d906d samples: net: irc_bot: create semi-unique IRC user names
IRC won't allow 2 users to use the same user name, so let's add
a random number to the end of "zephyrbot" to make it semi-unique.

Change-Id: I56349de21823d8fd2c52646656615b42fc12de5e
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
fc9443209f samples: net: irc_bot: modify disco check in on_context_recv()
Currently, status can be 0 when a NULL buffer is sent to
on_context_recv() so let's not include status in our check.

And in the future, status parameter may be a non-zero value indicating
an error condition.  So modify check to include positive values as well.

NOTE: Also make sure to use NET_ERR in these cases and not NET_INFO.

Change-Id: I8eac9a86d22b3b5624cd7a4e9d99e57afcac035f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
7f90bc7244 samples: net: irc_bot: dont hardcode NET_SYS_LOG_LEVEL
Instead let this be set via the project .conf file

Change-Id: Id8d7b46cc0888b83593b6f82dae619fb42c6ae3f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
65abcd4580 samples: net: irc_bot: use irc parameter's connection
chan->irc won't be set after the "JOIN" transmit succeeds.

Change-Id: I935b0a44c94ec3d2c91b73db92bfd2005c27bb7f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
f6255a78ae samples: net: irc_bot: fix null pointer deref
samples/net/irc_bot/src/irc-bot.c:368:36:
warning: 'c' may be used uninitialized in this function
[-Wmaybe-uninitialized]
  for (cc = &chan->irc->chans, c = c->irc->chans;
                                   ^
As suggested by Leandro Pereira <leandro.pereira@intel.com>
adjusted to:
  for (cc = &chan->irc->chans, c = chan->irc->chans;

Change-Id: Icd490059e0b97f95408dd7bad3f1783a215c5edb
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
359ef02bdf samples: net: irc_bot: expand some char buffers
Making a bit more room in these buffers.  Some were not big enough
in certain cases, while others needed more room in general.

Change-Id: I47a4bb8c6635305f55dee323f7293b2e4cbed55a
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
267cbd9469 samples: net: irc_bot: simplify connect path
K_FOREVER timeout in net_context_connect() will wait until
SYNACK has been received and we're ready to proceed with socket
communication.

To make the code as clear as possible, let's remove 2 callback
functions and relocate that code inside zirc_connect().

Change-Id: I6c64852ad5f48b24e1e6a58a741981e7d07bfd40
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
36b551edeb samples: net: irc_bot: make some functions more accessible
Due to code restructuring we should move the following
functions higher in the code (above zirc_connect):
zirc_nick_set()
zirc_user_set()
zirc_chan_join()

Also relocate the function declaration for on_msg_rcvd()
to the top of the code.

Change-Id: I3936fb645b709dcbcfcc4212c127db819974c046
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
f75c1fdabf samples: net: irc_bot: use #defines for server and port
Users can locate and edit these easier when they are at the
top as a #define.

Change-Id: Iecb53999cef1e70a80a28c7be5664ccde0fe7acf
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
81640ab197 samples: net: irc_bot: make panic() more accessible
By moving panic() function up to the top, other functions can be moved
later and still be able to call it.

Change-Id: I4290d1509cc64fc3f5fc5ec109cc19058090e6dd
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
a1d630398f samples: net: irc_bot: remove sockaddr globals
Instead use helper function where necessary.

Change-Id: Idcb47d02966731d7ef18588d1dccc8031a38d9d0
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
dbe4635368 samples: net: irc_bot: add helper function in_addr_set()
The aim of this helper function is to remove duplicate code for setting
the parameters of in_addr structures.

Change-Id: Id882a5947c47a9b6f92924ce8fb04023540fbb8d
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
01e3c3380f samples: net: irc_bot: remove unneeded typecasts and extra var
From function: zirc_connect

Change-Id: Ie0abc919c62b12995af7605bd080eafa48b48841
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
79dc068bea samples: net: irc_bot: release net_context reference upon error
Change-Id: I69451b3035d09c0de8ae0f448c80b780a09e72bd
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
14a6306069 samples: net: irc_bot: establish privmsg callback typedef
Change-Id: I005fc4d33da7b2c81e2add5e73f11f6c5bd2c42c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
ed7ea99244 samples: net: irc_bot: run sample process as a thread
This allows for a set app stack and threaded functions to be used later.

Change-Id: I647a3defdf6eb4cca2a4a21192b20641f5bf8d4a
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Leandro Pereira
2bcd700462 samples: net: Add IRC bot example
This is a sample IRC bot program, written using the new IP stack API.
All it does is join an IRC channel, wait for some commands, and react
to them:
	!hello will greet whoever sent the command
	!random will generate a pseudo-random number and send it back
	!led_toggle will toggle an LED in the board [1]
	!led_on will turn the LED on regardless of its current state
	!led_off will turn the LED off
	!rejoin will part the current channel and join again
	!disconnect will quit from the IRC server

As far as the IRC protocol goes, it doesn't do much more than this, but
it should be straightforward to add support for other things (such as
notices, CTCP, DCC, etc) if someone is inclined to do so.  However,
that's way beyond the scope of this sample, which is to show how to use
the network API to write a TCP client.

Some things are still missing as an example of how to use the APIs,
namely DNS resolution, automatically setting up the network with DHCP,
maybe saving settings on EEPROM.  These are good candidates to be added
in the future.

[1] The LED code has been shamelessly stolen from the CoAP sample code.

Change-Id: I7152e97c0726f3559db545579ae8ae8d07bf04cd
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Tomasz Bursztyka
bc406fab08 samples/net: Add a simple telnet sample
It will setup IPv4/IPv6 addresses. Telnet is ran in the background,
along with net and kernel shell modules.

See the README.rst for more information how to start and use this
sample.

Change-Id: I3e935014c79b534aab43a6fa8256792b23abb38e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes
d689c5ee97 samples/zoap_server: Add a 802.15.4 case to the test suite
Allow build-testing zoap-server with support for the CC2520 radio.

Change-Id: I986afd7b15208d477bd79f42a52dd45b217214cb
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes
0ef657904d samples/zoap_server: Allow overriding the BOARD variable
In case the user wants to use BOARD make variable to conveniently use
another board with this sample.

Change-Id: I6dd0656da223218d116dd498c1336c890563b212
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:14 +02:00
Ravi kumar Veeramally
b13f44bcdd net: utils: Add net_addr_ntop() helper function
net_addr_ntop() will convert IPv4|6 address to string form.
Renamed existing net_sprint_ip_addr_buf() to net_addr_ntop()
and adjusted parameters as per API.

Jira: ZEP-1638

Change-Id: Ia497be6bf876ca63b120529acbadcfd9162a96e3
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-03 15:59:14 +02:00
Tomasz Bursztyka
227bf97f60 samples/net: Fix a tiny mistake in dhcpv4_client README.rst
Change-Id: I7ce6e9a762f13d3db5d2769301719f17b798a4fe
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-03 15:59:14 +02:00
Paul Sokolovsky
63e6b60969 net: echo_server: Enable TCP for frdm_k64f
To match qemu_x86.

Change-Id: I04806d8a8850a76c984f3cda1efaa065bcf4596e
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes
f0f8a99257 samples/zoap_server: Enable support for 802.15.4
This configuration file allows using the device 802.15.4 radio for
IPv6 networks.

Change-Id: I9b3ee9a64acb71e97e4e8f7aae3e619196ad0462
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:13 +02:00
Michael Scott
ca6a686495 net: correct in*_addr parameter of net_addr_pton()
Currently, the function accepts a struct sockaddr * but the code
immediately type casts this to either in_addr or in6_addr.  This is
incorrect behavior as the first field in a sockaddr is sa_family_t
and not address data.

So without special knowledge, a developer will use a sockaddr structure
as the parameter and then wonder why the address information isn't being
set correctly.

Let's change this parameter to void * which makes this function similar
to inet_pton().

Jira: ZEP-1616

Change-Id: I1fc9368da999d90feb07c03fac55dcc749d4eba6
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:13 +02:00
Piotr Mienkowski
f5b3e2a09b samples: net: echo_server .conf for Atmel SMART SAM E70 Xplained board
Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-1492
Change-Id: If6acbaabf0857425684e0ab2d4db513e5bbc7b77
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-02-01 21:01:20 +00:00
David B. Kinder
f3bc4c018d doc: fix .rst headings in new sample docs
Change-Id: I14230acb0fff64936c890478d5bf9bb81dcf9985
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-30 14:54:22 -08:00
Kumar Gala
c9a4335ad3 samples: zperf: cleanup types for constant arrays
There are a few arrays we use with print_number and parse_number.  These
functions expect a const uint32_t so lets have the arrays for TIME_US,
KBPS, and K match.

Change-Id: I6347b06af2374d702144084bb6b538a478fb8fac
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-30 12:01:48 +00:00
Jukka Rissanen
7ad52b94cf net: echo-client: Add TCP support
This commit enables echo-client application to start to
send data over TCP connection.

Change-Id: I9acdaae7f1e8411952c30caeedc9c1fb07cdd448
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-27 15:06:06 +02:00
Andrei Emeltchenko
6043dddd4a net: Remove unused CONFIG_NET_IPV6_NO_DAD option
Option CONFIG_NET_IPV6_NO_DAD is not used anymore, clean project
configuration files.

Change-Id: I368e076d2f79f1d4bc86edee11ff5befe37362c8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:54 +02:00
Tomasz Bursztyka
83ed3a29be net/ieee802154: Modify radio TX function signature
The cause for this change is TCP. Until now, the radio strategy driver
(ALOHA or CSMA) was providing the actual nbuf, and not the buffer
fragment, counting on the fact that the loop was using
net_buf_frag_del() which made so, iteration after iteration, buffer
framgent to be always buf->frags. The problem with this logic is loosing
the fragments that might be still referenced by TCP, in case the whole
buffer did not make it so TCP can retry later and so on.

Instead, TX now takes the nbuf and the actual frag to send. It could
have been working with just a pointer on the data, and the whole length
of the frame. But it has been avoided due to possible future devices,
that will be smarter and run CSMA directly in the hw, thus it will
require to access the whole buffer list through the nbuf.

Change-Id: I8d77b1e13b648c0ec3645cb2d55d1910d00381ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Andrei Emeltchenko
5794d80c10 net: Remove CONFIG_NET_IPV6_NO_ND config option
The option is no longer used so it can be removed.
Use CONFIG_NET_IPV6_ND option instead.

Change-Id: Ibaa3d3deb52b8b176e85f8b9e1d8c80c1026aea1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:53 +02:00
Sergio Rodriguez
98d7ff0013 samples/coaps_client CoAP over DTLS client example app using mbedTLS
Jira: ZEP-941

Change-Id: Ia49087b75b33bcedb1b77b6a062368281c41e479
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 12:35:53 +02:00
Sergio Rodriguez
3818af4a7b samples/coaps_server CoAP over DTLS server example app using mbedTLS
Jira: ZEP-942

Change-Id: I810fccfed912d9de62073a9a4e943b7924aa6392
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
507fa88734 samples/net: Add telnet console support on echo_server with qemu
This is meant to test telnet console easily, as echo_server already
enables net shell module etc.

Change-Id: I045340ae5d6e179ea5ce1416cd7d67c6956bd973
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Johann Fischer
ed6712fa23 samples: net: add configs for MCR20A
Add configs for MCR20A device to echo_server and echo_client.

Change-Id: Ic0e310c0eb2eefe6ce5752a20b0c079b7ea8757c
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Johann F
12306df1ad samples: ieee802154: add MCR20A
Add MCR20A to 802154 driver test application.

Change-Id: I18d4178668542c1da197d5a2b3b0b502c9b128c1
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
5e5b187371 net: samples: Fix config option
Only CONFIG_NET_SLIP_TAP will select SLIP, UART_PIPE,
UART_INTERRUPT_DRIVEN and SLIP_TAP. Otherwise apps will crash on
qemu.

Jira: ZEP-1617

Change-Id: Ibefbe708deb05e28b43ed4225211a5af655cec8d
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
5cf134f45a net: samples: Use lighter printk() instead of printf()
Use printk(), snprintk() instead of printf() and snprintf().
CONFIG_STDOUT_CONSOLE is anyway disabled by default so printf()
will not output anything without it.

Change-Id: Ide24e4d669e9821289189ed28e30a596120d9611
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
395ad208b1 samples: net: Add DHCPv4 sample application README file
Instructions to verify DHCPv4 client functionality in QEMU and
FRDM_K64F.

Change-Id: I623128186387c0c3237c8e759b949a3d0fde0993
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:50 +02:00
Andrei Emeltchenko
9e092b02e2 wpan_serial: Queue only full packet to RX queue
After queueing full packet to RX queue we set pkt_curr to NULL, if we
get right after that SLIP_END we shall check for pkt_curr to avoid
NULL pointer assignment.

Coverity-CID: 157574

Change-Id: I2be40a652867e73b4a1994f529dc21980ecb35b4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:50 +02:00
Vinicius Costa Gomes
3a666c54ce samples/zoap_server: Also listen on the unicast address
Some applications are not prepared for using multicast address and
specifying the interface, so it may be convenient for the user to be
able to use a unicast address when communicating with the
samples. This aligns this sample with most of the networking samples.

Change-Id: Ic97ea5a346a650751b6e2cbfefad25a3e700278c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-27 12:35:50 +02:00
Vinicius Costa Gomes
c36c3c2883 samples/zoap: Update zoap samples documentation
Samples instructions are to follow the rst format so they are
consistent with the rest of the documentation.

Change-Id: I37f06139484a4632e5b9c720ce1317feab68358b
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-27 12:35:50 +02:00
David B. Kinder
a24de43f3d doc: fix broken link to board doc
Change hard url into :ref: to board documentation

Change-Id: I9d8a585bb0e7274cf3233eadac2e303cc98ef86a
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-26 19:37:43 +00:00
Maureen Helm
4279bf1c03 samples: net: Increase spi log level
Change-Id: Ic067a93c1e24c12c7e531b1df590be252cd2531b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
David B. Kinder
2cb045420c doc: fix .rst files canonical heading order
The headings on some .rst files were not following the expected
heading order of using # for h1, * for h2, = for h3, and - for h4
This patch fixes that, and the doc/templates/*.tmpl files created
for folks to use as templates for creating board and sample docs.

Change-Id: I0263b005648558d5ea41a681ceaa4798c9594dd9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-20 16:06:36 -08:00
Jukka Rissanen
007e231ff5 net: echo-server: Discard 0 byte received packets
If we receive 0 byte packets from the network, we need to
ignore those as otherwise it is possible to leak network
buffers.

Change-Id: Id4b5b0d03c0b6d1e16634ff2d1960ea4728c8aa1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:21 +02:00
Jukka Rissanen
011b22d64e net: echo-server: Use net_buf_frag_del() return parameter
Because net_buf_frag_del() returns the next fragment in the list,
we can use the return value which makes the code nicer looking.

Change-Id: Ic3d0155417b52a34bfbaa918570ff9af95aee468
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:21 +02:00
Andrei Emeltchenko
4a24192529 wpan_serial: Fix possible NULL pointer dereference
Return and clean buffer when fragment can not be allocated.

Coverity-CID: 157590

Change-Id: Ic8844609da4049623a6cf0c2ae037b2b777542e9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-20 16:23:21 +02:00
Ravi kumar Veeramally
724aa3ffbd net: samples: Print assigned address from DHCPv4 server
Print assigned address and other information if client receives
anything from server. E.g. subnet, lease time and router.

Change-Id: I759d59522930401766452eb1fb3d57d1a8295a67
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-20 16:23:21 +02:00
Ravi kumar Veeramally
9b68f18ffb net: samples: Add ENC28J60 pin numbers to documentation
ENC28J60 has numbers on the board. Documentation has information about
signals only. Wiring will be easy with pin numbers.

Change-Id: I0afd6058a9417b679ef6358304737bf256aa3522
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-20 16:23:20 +02:00
Luiz Augusto von Dentz
0918a903b1 net: zperf: Add bluetooth support
Change-Id: I56f2000cef929d5d0ddae0d67bc222d20db06480
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-20 16:23:20 +02:00
Luiz Augusto von Dentz
862b8dcfc6 net: zoap-client: Add bluetooth support
Change-Id: I9bef7f176deca6476e20d97d547b8d91ffc62c83
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-20 16:23:20 +02:00
Tomasz Bursztyka
d9b30d3029 samples: net: Enable buffer warning and errors in echo apps on qemu
These logs are mandatory to spot buffer leaks. Unfortunately, they are
still not detailed enough to spot the actual place where the leak
happen.

Change-Id: If36dfa7a54aa1546fb268301f369b5ecd046e276
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-20 16:23:19 +02:00
Tomasz Bursztyka
c2ed1c1aee samples: net: Fix a format issues in echo_client
To avoid a build warning.

Change-Id: Ic6349c6867f04f5827923a070e8e615ca3bead94
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
ec7d09eccc samples/zoap_server: Do not error if there's no payload or queries
In case of a GET request do not error if there's no payload or queries
parameters.

Change-Id: I29b2225700c83a8a2dad166146288dd55bd8f3de
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
bc70a39ac6 samples/zoap-server: Add support for the "location-query" resource
This resource verify the capability of the server to send a response to
a POST including a Location-Query option.

Change-Id: I4b663e813eb713d7e93a3c2f8cfd58c335b24cde
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
6f57867654 samples/zoap_server: Include a path for the "created" resource
The CoAP test suite expects a specific path included in the
Location-Path option in the response.

Change-Id: Ib7616f9ad318fa93dc862f686429edb5084306e3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
e44dfffba2 samples/zoap_server: Add Content-Format options to GET responses
The Californium tests expects that all GET responses include the
Content-Format information of the response. In our case, all responses
are of type plain-text.

Change-Id: I08844825f31ed8f4c54020a41b9172cef5da6d70
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
0eaeaf2481 samples/zoap_server: Add support for messages with token
So the sample zoap server application is more conformant, include the
token from the request, if any, in the response.

Change-Id: I5aacc1a3f81ebeaf473d327163c952b829489b01
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
db049395f1 samples/zoap_server: Fix responding messages with the wrong type
The Californium test suite considers an error responding a NON_CON
request with a ACK response, even if the spec says it is valid, so add
support for using the correct type of response according to the
request.

Change-Id: I211c8a135b8db83af442a1d645b7ea0826dbbdec
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
0e7b9adc5f samples/zoap_server: Add resouce for TD_COAP_BLOCK_03
This allows to verify that the CoAP server is able to handle a
blockwise PUT request.

Change-Id: I801e353a27b10a5266748591d023bcb607db6bb4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:18 +02:00
Vinicius Costa Gomes
6429b1bf2b samples/zoap_server: Add support for blockwise GET tests
This adds support for TD_COAP_BLOCK_01 and TD_COAP_BLOCK_02 tests,
which test that the CoAP server is able to handle GET requests with
blockwise tranfers.

Change-Id: Id0d1703adcf5d4e76dd1bc489c8bcc94a3fd90bc
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:18 +02:00
Vinicius Costa Gomes
bcc8f819e1 samples/zoap_server: Add support for the '/separate' resource
This resource is used to verify that the CoAP server is able to send
responses in two steps: 1. only acknowledge that the request was
received and is going to be handled; 2. The actual response, with the
payload.

Change-Id: Ia77cc0ee9805e6cc120c57f4598c68ad364882a0
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:18 +02:00
Ravi kumar Veeramally
0f6990ac4d samples: net: Fix DHCPv4 config options and run on its own thread
DHCPv4 sample was running on main stack. Updated to run on its own
thread. Update config options (removed unnecessary ones and separated
few options for easy readability).

Change-Id: I3be38ca4cd4bcfa62e2613b90b104679cff2517e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-20 16:23:17 +02:00
Flavio Santes
4d93ebf9ec samples/net: Remove legacy configuation variables
This patch removes legacy configuation variables found at the
prj_arduino_101.conf file of the DNS sample application.

Change-Id: I74e370a7be177f809d805525cc18f594a59e38c0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-20 16:23:17 +02:00
Flavio Santes
1c21029237 drivers/ethernet: Update default GPIO pin for the ENC28J60 module
All sample applicatons in Zephyr, using the ENC28J60 driver, set
the ETH_ENC28J60_0_GPIO_PIN Kconfig variable to 19.
However, in the Kconfig.enc28j60 file this variable is set to 24.
That default value, 24, was used only during the first iterations
of this driver and never used again.

In this patch, we set the Kconfig variable to 19 and simplify
project configuration files by removing one line.

Change-Id: I3d5fd9da04a3f10845d2a409de56f5b9c235e995
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-20 16:23:17 +02:00
Flavio Santes
06286f93aa samples/net: Remove redundant configuration variable
Remove CONFIG_GPIO=y for the Arduino 101 board. This configuration
is now set by default in the board configuration file.

See commit 8f96628064.

Change-Id: I6fa73a5785d78c51f03a0af48fc2aa8cc7636c7d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-20 16:23:17 +02:00
David B. Kinder
ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Marcus Shawcroft
033b5e9a7d echo_server: Remove unnecessary config from prf_frdm_k64f.conf
The k64f has a random driver the TEST_RANDOM_GENERATOR config is not
necessary.

Change-Id: I73bc4076cac459388d9dd9bf3eb89c8cb5ba7db7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-17 21:47:32 +00:00
Anas Nashif
ae7df93a77 net: zoap_client: fix usage of legacy APIs
Change-Id: Ic3df2fb50897bd07c47ef987698c7fcaadcb6575
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:35 +00:00
Anas Nashif
6b65dcefd2 legacy: Move TICKS_UNLIMITED -> K_FOREVER
Change-Id: Ic1e73959a3444bc6e015e341899c75b1ef850189
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:35 +00:00
Anas Nashif
b52a5450b0 legacy: use k_cycle_get_32 instead of legacy sys_cycle_get_32
Jira: ZEP-1585
Change-Id: Idac4685625f191771b90ce78234d97f5143413f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:34 +00:00
Flavio Santes
876f751cde samples/net: Improve text indentation and clarify some instructions
HTML documentation shows misaligned text that may be a bit confusing.
This issue was caused by wrong indentation. Furthermore, board specific
instructions to build the image does not include any instruction header.

This commit fixes the above described issues.

Change-Id: Ie965e09f32f46a9d69aac28c4b389084f06b31b6
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-17 02:45:41 +00:00
Anas Nashif
567c294608 samples: doc: remove 'make pristine', it is not needed
Replace 'make qemu' with 'make run'

Change-Id: I62a8ff30ecf713fe2d2fd27d4de321265d9bb3f7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 18:13:03 -05:00
Anas Nashif
9811d2bc36 samples: dtls: Fixed layout and titles in documentation
Also fixed typo DLTS -> DTLS

Change-Id: I640afa58841eda48a8b87eb62951daa85fe85c07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 14:04:20 -05:00
Anas Nashif
43b9e7dfe1 net: doc: add section about networking with qemu
Change-Id: I478231b6932c379201deaf4e1ca9ff57b43bd05f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 14:04:20 -05:00
Luiz Augusto von Dentz
fb5ea68762 net: zoap_server: Enable connecting with bluetooth
Change-Id: Iae05264f8677afb49c5060c13ad3e89c86c89929
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 17:05:53 +00:00
Luiz Augusto von Dentz
5ea0612f69 net: echo_client: Enable CONFIG_NET_L2_BLUETOOTH_SHELL in prj_bt.conf
This makes it possible to setup a Bluetooth connection using net_bt shell
commands.

Change-Id: Ie4ae7e61345315ef987a00b6b5a28c0419f6b1c8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:37:53 +00:00
Luiz Augusto von Dentz
a70c65d6ff net: echo_client: Don't start sending packets if interface is not UP
If the interface is not UP wait for MGMT event if that is enabled.

Change-Id: I4866c23d1e6f5b1a7cf212434d794673d7e756ce
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:35:55 +00:00
Luiz Augusto von Dentz
04aaab61ca net: echo_client: Fix using CONFIG_NETWORKING_WITH_BT
CONFIG_NETWORKING_WITH_BT no longer exist, instead
CONFIG_NET_L2_BLUETOOTH shall be used.

Change-Id: Ide353b7620228e431c535768b37749994caf8e8b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:35:42 +00:00
Tomasz Bursztyka
4695e895c8 samples: net: Fix dhcpv4 building with net mgmt event support
It was missing for arduino_101.

Jira: ZEP-1574

Change-Id: I08fc0961b94f5f7b1b787ebf52e7d9922e38006c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-13 11:38:17 +01:00
Andy Ross
96294b79a7 net: tcp: Signal EOF with a NULL buffer in the callback
TCP didn't actually have a way to signal synchronous receipt of a FIN
packet.  Extend the recv_cb API to allow a NULL buf argument with
status==0 (by analogy to Unix's zero-length read) to signal EOF.

Update docs too, and also echo_server which wasn't prepared to handle
this situation.

Change-Id: I7dc08f9e262a81dcad9c670c6471898889f0b05d
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-01-13 10:29:03 +01:00
Kumar Gala
0f2ce02abe net: Remove NET_SLIP choice from Kconfig
The NET_SLIP Kconfig choice option doesn't really do anything for us,
plus we get warnings related to setting CONFIG_NET_SLIP=y in prj.conf
files.

Warnings like:

warning: override: reassigning to symbol NET_SLIP
warning: override: NET_SLIP_TAP changes choice state

So remove NET_SLIP choice and remove CONFIG_NET_SLIP=y in the prj.conf
files.

Change-Id: Ibccf9cf167f4c8a4df480ca0396bf83fcf60df1e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-13 10:29:02 +01:00
Sergio Rodriguez
61ac519e1b samples/mbedtls_dtlsserver DTLS server example app using mbedTLS
Jira: ZEP-1534

Change-Id: Ia4b8bf00182c6281144a44a55b0b45354c1b234d
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
1452eba464 samples/mbedtls_dtlsclient: IPv6 client version
Change-Id: Ifff5afc78ca9a84f62890b7c0d5f57ca30b432b9
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
79aee2e002 samples/mbedtls_dtlsclient: Remove hardcoded IP adresses
Change-Id: I0269809b12881fa32fdd231056c5515ee6c30bc7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
3940d9d645 samples/mbedtls_dtlsclient: Change Readme files to rst format
Change-Id: Ibf38dc7166687e248cd2ef37d63a67a67f338f28
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
5d82bc7599 samples/mbedtls_dtlsclient: Using printk instead of printf
Change-Id: Ie6026d261229f16814d9fa0c3477e01c5b8b8de2
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Tomasz Bursztyka
c9a250db11 samples: net: Echo apps need different IP to be able to work
Change-Id: I8d630a568e6520e259b35a4048774355488084c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-13 10:29:00 +01:00
Johann Fischer
1f6e8cab32 samples: ieee802154: rename cc2520 to hw
Rename cc2520 directory to hw and use it as generic
test application for the 802154 hardware driver.

Change-Id: I1c21505b7eb295279190f011a99c80e762178730
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-13 10:29:00 +01:00
Johann Fischer
ce189f84a9 ieee802154: conf: add common log level
Add common log level for all IEEE802154 drivers.

Change-Id: If92c96b14e630d4482aadf9cacb25662d6663399
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-13 10:29:00 +01:00
Flavio Santes
cfe4c2cebb samples/net: Update DNS client README file to RST format
Reformat and consolidate the samples/net/README and dns_client/READMExxx
files according to the RST spec.

Change-Id: I735190245204854ac5527e18971cc4c6478423e5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
38594021d6 samples/net: Update the zperf/README.rst file
Update the zperf/README.rst file with the following information:

- Homogenize the usage of "zperf", "iPerf" and "Zephyr"
- Update the Supported Boards section
- Clarify some instructions
- Add the Requirements section

Change-Id: Idfb29e2a5db9a78c19a6a27923f134583ebe5822
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
447796f4f2 samples/net: Rename prj conf files to avoid breaking the build
Rename the project configuration files to pass the build.

The Makefile specifies the following format for the conf file:
prj_BOARD_PROF.conf. However, there are two files with the
following format: prj_BOARD_IFACE_PROF.conf. So, rename them
to avoid build errors.

Change-Id: I75e0d4169db881583b5f9a2b67deee46f66b6c97
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
24c80faa9c samples/net: Update zperf Makefile
Remove commented line in the zperf/Makefile file.

Change-Id: Id869f21e923d3bb39fc31c5216ce29d78a0e1805
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
9aa5919dbf samples/net: Update DNS logging info
Remove a blank space.

Change-Id: Ia4028cc26ea0f4fc742ae6232f46a5eb242faeb9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:28:59 +01:00
Flavio Santes
bb542d6b11 samples/net: Remove legacy reference in Makefile
Remove the reference to CONFIG_NET_UIP in src/Makefile.

Change-Id: I960413c17496c4b70b9c171a54ccfca4951b858b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:28:59 +01:00
Maureen Helm
4f5c2702da samples: net: Use mcux pinmux driver for frdm_k64f_cc2520 projects
Sample projects that pair the frdm_k64f board with a cc2520 require
additional pinmux settings beyond the standard frdm_k64f pinmux. These
settings used the private k64 pinmux API rather than the public pinmux
API.

Because the mcux pinmux driver now always supports the public pinmux API
(vs. the k64 pinmux driver which only supported it in pinmux dev mode),
we can convert the frdm_k64f_cc2520 projects to use the public pinmux
API and the mcux pinmux driver.

Change-Id: Idfae8393171b007d8629e34bfae64255f55c6792
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:27 -06:00
Maureen Helm
362bdaabeb samples: net: Remove support for the k64 gpio driver
Jira: ZEP-1394
Change-Id: Ib9435109175540e3e2a3ece310e068667e398821
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:27 -06:00
Maureen Helm
1ca06fc9dc samples: net: Add support for the mcux gpio driver
Jira: ZEP-1394
Change-Id: Iff8fc2f10779131e361968ce16e82b248a9e3c17
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:27 -06:00
Maureen Helm
c294ff06f6 samples: net: Remove unnecessary eth_ksdk project settings
Removes unnecessary CONFIG_ETH_KSDK project settings from the net
samples. Some of the configs no longer exist (MAC0-2), some are not
valid (MAC3-5) due to RANDOM_MAC=y, and the rest are already enabled by
default by the SoC and board.

Change-Id: I27079b8bb142ebc507885f3b1de07e282c813506
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:26 -06:00
Anas Nashif
2bc9d69981 build: abstract emulation and replace qemu goal with run
This will replace the current goal of 'make qemu' with 'make run' and
moves Qemu handling into its own file and into the boards instead of
being architecture specific.

We should be able to add new boards that support some other type of
emulation (by adding scripts/Makefile.<emu type>) and allow the board to
define their own options for the use type of emulation.

'make qemu' will still work, however it will be deprecated, starting
with this commit it is recommended to use 'make run'.

Jira: ZEP-359
Change-Id: I1cacd56b4ec09421a58cf5d010e22e9035214df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:47 +00:00
Anas Nashif
f6e039062a kernel: remove dependency on CONFIG_NANO_TIMERS/TIMEOUTS
Remove legacy option and use SYS_CLOCK_EXISTS where appropriate.

Change-Id: I3d524ea2776e638683f0196c0cc342359d5d810f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-08 18:09:52 +00:00
Anas Nashif
fc6137001b doc: move documetnation context to root directory
This will allow inclusion of documentation files that exist outside of
doc/ and will make it possible to add rst files across the tree,
especially for boards, samples and tests.

Change-Id: I7afcf92d99f504b2bc0b2b7e3452acb2f8e08294
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 22:51:31 +00:00
Anas Nashif
eaa06ac40a net: do not skip sanitycheck on samples
Change-Id: I781a908ad998211b34d5f05f53fbf3471e6b9f1b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 22:08:14 +00:00
Tomasz Bursztyka
20404131aa samples: net: Add IEEE 802.15.4 shell module on cc2520 sample
This is easier to test the 15.4 layer instead of hard-coding sample
logic.

Change-Id: I2376dec3dad9e2ceca3f61bd88bf5709f1bc1390
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 12:27:01 +01:00
Tomasz Bursztyka
db1ee31c04 samples: ieee802154: Let's proceed with an active scan
It's currently hard to find a Beacon enabled network. So let's switch to
active scan for now.

Change-Id: I192e7c3128f9488fb680ea7f23221b2b4aa52188
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:44 +01:00
Tomasz Bursztyka
792c29a376 samples: net: ieee802154: Once cc2520 is up, let's initiate a scan
It will print-out the results, if any.

Change-Id: If988a6dc3c4504a8d4aa947d3d3f949870b638c8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Maureen Helm
87bc9eb010 net: samples: Fix stale yaip references
Fixes two references to yaip that were were left behind after net/yaip
was renamed to subsys/net/ip. The zperf sample needs net_private.h, so
the include path is updated. The dhcpv4_client sample doesn't need it,
so the path is removed.

Change-Id: I189f1b58191524330254a5b7b31a9a4974956728
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-06 09:11:43 +01:00
Anas Nashif
453432539e doc: samples: fix rst layout and use code-blocks
Change-Id: Ic55d66bbfa1df67824b47afe478dcdfbb886fc4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-04 12:24:11 -05:00
Tomasz Bursztyka
a1aa08c288 net: ip: Improve logging by adding a dedicated sys_log level
Let's make net stack having its own level of debugging through sys_log.
It replaces NET_DEBUG by NET_LOG_ENABLED, which is then semantically
better: someone wanting to log the errors might want that not only for
debugging.

Along with it, CONFIG_NET_LOG_GLOBAL option is added, in order to enable
all available logging in network stack. It is disabled by default but
might be found useful when warning/errors need to be logged, so it is
then unnecessary to selectively enable by hand all CONFIG_NET_DEBUG_*
options.

It is possible, locally, to override CONFIG_SYS_LOG_NET_LEVEL by setting
the level one want to NET_SYS_LOG_LEVEL. This can be useful on samples
or tests.

Change-Id: I56a8f052340bc3a932229963cc69b39912093b88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:20 +01:00
Flavio Santes
ac7300611c net: Restructure network protocols
This commit restructures the network protocols. Changes applied are:

- Move lib/iot/ to subsys/net/lib
- Move network protocol headers to include/net
- Move lib/iot/zoap/link-format.h to include/net/zoap_link_format.h
  and link-format.c to zoap_link_format.c
- Move tests/iot/ to tests/net/lib/
- Adapt sample code
- Adapt build system
- Modify doxygen paths

Change-Id: I37085fa4cc76a8a8e19a499ecb4e87b451120349
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-02 10:03:19 +01:00
Marcus Shawcroft
2fc5eb2f4c net/dhcpv4: Re-instate init_app()
Re-instate the init_app()call which was accidentally removed by commit
commit 34f9391c9cf5 ("dhcpv4: Report address acquisition.")

Change-Id: Ic5ef70fd855a5bcb3ea1171de652994db493f4bb
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:19 +01:00
Tomasz Bursztyka
cbd1609bf6 net: statistics: Provide specific Kconfig options
This will help to track only what's wanted (ipv6, tpc, udp, else...) if
needed to.

Change-Id: I5c2e5e582db629b5d0e1cd98004f693c50f532a4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka
0a1617365f net: buf: Change NET_BUF_DEBUG to NET_BUF_LOG and add a level option
It will be thus possible to enable only the error logging, or the other
sys_log levels.

Change-Id: I0c0ed789f7cfbb4811320e8f8249151288274873
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka
6158dfdda6 samples: net: STDOUT_CONSOLE is not necessary
printk can do the job properly.

Change-Id: Ib743328e046bdb29be26adfe5cd007aaa758cd64
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Marcus Shawcroft
eb2d16b2e4 net/dns: Drop unnecessary ETH_KSDK configuration.
Change-Id: I99712e04bfc455156751b70778aee24517eb6d6a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:17 +01:00
Marcus Shawcroft
0be2c3f57c samples/dhcpv4: Add missing NET_MGMT configury.
Add missing NET_MGMT configury for frdm_k64f, accidentally omitted
from: 5267ad94ed10c76b51c7fbba01143616d03e9178

Change-Id: I9a6da75f7a036182f44abe8207c7732030ab187e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:16 +01:00
Flavio Santes
225dc3f660 samples/net: Fix logging format error
When building the echo_client sample app, the following warning
is found:

echo-client.c:37:
echo_client/src/echo-client.c: In function 'send_ipv4_data':
include/logging/sys_log.h:108:20: warning: format '%d' expects argument
                                  of type 'int', but argument 7 has
                                  type 'size_t' ...

So, this patch changes %d by %zu to remove that warning.

Change-Id: I8a3822bca6d5988e531684d647de93bd77aabf9b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-02 10:03:16 +01:00
Vinicius Costa Gomes
65cf8c769a samples/zoap_server: Use the correct option for TAP
When using SLIP for TAP networking between guest and host, the correct
option is CONFIG_NET_SLIP_TAP. CONFIG_SLIP_TAP only enables it on the
SLIP side, it should be enabled on the networking stack, as well.

Change-Id: Ie1dacd07eb5a0891a572b08268a865f05a373690
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:16 +01:00
Vinicius Costa Gomes
6a0190befb samples/zoap_client: Use the correct option for TAP
When using SLIP for TAP networking between guest and host, the correct
option is CONFIG_NET_SLIP_TAP. CONFIG_SLIP_TAP only enables it on the
SLIP side, it should be enabled on the networking stack, as well.

Change-Id: I76226db9c587f1b5e9613244adab8f916ad94013
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:16 +01:00
Marcus Shawcroft
0637511e68 dhcpv4: Report address acquisition.
Use the network management interface to catch and report IPv4 address
acquisition in the application.

Change-Id: Idd1bcaac90fffbd617600a7713206599e547826f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:16 +01:00
Andrei Emeltchenko
cdb8133cf5 samples: net: Add echo_client build test for frdm CC2520 configuration
Add build test to sanity_check to get a complex net app being built
for frdm-k64f.

Change-Id: Ib136f7964b65ad2167a3ed4484bff3bfe2a7ebad
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-02 10:03:16 +01:00
Anas Nashif
7297f5db88 shell: move shell to its own subsystem
This moves the shell component into its own subsys and groups all
related files and options into a single place.

Additionally, one Kconfig option will now be required to enable the
shell:

 CONFIG_CONSOLE_SHELL=y

The header files was also moved to include/shell/shell.h and can be now
referenced with

 #include <shell/shell.h>

instead of

 #include <misc/shell.h>

Updated documentation as well.

Change-Id: Iffbba4acfa05408055e9fd28dffa213451351f94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-25 19:35:11 +00:00
Anas Nashif
4b20b634be samples: fix RST syntax and add headers
Change-Id: Ic94213f97698bd861516de0bd159fb37f9124883
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-22 08:01:49 -05:00
Vinicius Costa Gomes
4085e26cdb samples/zoap-client: Fix using wrong addresses
The addresses used by the client were still made reference to the types
used by the old network stack.

Change-Id: Iaba919cb072e3295c9b371cc8fe493284c5b523b
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-22 02:14:50 +00:00
Sergio Rodriguez
71905be857 samples/mbedtls_sslclient: Using native IP stack
The legacy IP stack was removed from the source tree, so this changes
were made to adapt to the native IP stack, but this might not work on
the galileo platform due the ethernet driver not being tested on the
new stack on TCP, but to have the reference application ready when
it gets integrated

Jira: ZEP-1448

Change-Id: Ifa6ea0afb3bc532dfb92b09debbf6eee59e38a25
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-21 19:22:20 +00:00
Flavio Santes
f57023934e samples/net/echo_client: Add ARG_UNUSED
Add ARG_UNUSED to some function parameters to avoid
compiler warnings.

Change-Id: I5db5bc536f1eeb084e08d2fbe4a8b0a8456e67a5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:50 +00:00
Anas Nashif
3dc9eb00cf net: remove obsolete net_testing.h
Change-Id: I75dff74912320a9b623667a53dc8e2b617f17572
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-20 13:31:38 -05:00
Marcus Shawcroft
78a1256646 echo_server: Fix frdm_k64f build in the absence of CC2520
Change-Id: Id8a421ad7862c03be0ac4e7293285fa01e8a93e0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-20 13:44:41 +00:00
Anas Nashif
0e1022833b samples: remove obsolete KERNEL_TYPE
Change-Id: I9fec01fed0407c53b9b447e2a568bc75351cd61e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-20 01:12:43 +00:00
Anas Nashif
a9e879e273 logging: move sys_log to subsys/logging
Move logging out of misc/ to its own subsystem. Anything related to
logging and any new logging features or backends could be added here
instead of the generic location in misc/ which is overcrowded with
options that are not related to eachother.

Jira: ZEP-1467
Change-Id: If6a3ea625c3a3562a7a61a0ba5fd7e6ca75518ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:39 +00:00
Marcus Shawcroft
2c3a3ea84c dhcpv4: Adjust prj file selection.
Change-Id: I8e21285bfde33612fd9ded65257195612f880249
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-19 10:29:15 +00:00
Marcus Shawcroft
28aff9506f dhcpv4_client: Remove unnecessary ETH_KSDK configuration.
Change-Id: I18218501949a7a408c8ecd5501e0011204801e6d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-19 10:29:15 +00:00
Tomasz Bursztyka
7a19370f84 sample: net: Updating qemu config for 802.15.4 testing
Removing useless options, refining the logging and of course setting the
right IP to make it work.

Change-Id: I0c0c1979d590bc4c4fcb3a1d1a252b87b0153511
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
e7af4b8947 samples: net: Fix echo applications setting for 15.4
When zephyr receives a 15.4 frames it allocates 1 RX buf (nbuf) and 1
DATA (buf), and it gets queued on net stack for post processing.

Problem: receiving a lot of frames is just completely nominal and very
fast (timing is critical in radio, and the rx thread of the radio driver
has a high priority, much higher than net stack's rx post processing).
So guess what happens when CONFIG_NET_NBUF_RX_COUNT=10 though let's say
12 packets are coming in?

The RX buffer pools gets empty and soon the system hangs on getting a
newly allocated one.

This proper CONFIG_NET_NBUF_RX_COUNT tweak fixes the issue, however some
future work will reduce the need of so many RX meta buf:
- l2's recv could be called right away at net_recv_data, before queuing
  the buffer for post-processing, but this could affects reception
  timing on radio side, which is critical.
- An l2 pre-processing (in the middle of what current l2 recv does)
  could be implemented, it would be technology depenedent (aka: not
  mandatory on all l2) and could quickly decide what to do and at best
  drop the whole, or at least drop the RX meta buf (frag would still be
  kept). Let's see.

Jira: ZEP-1427

Change-Id: Ic75b02efa36e35b450c02b3e6439a8d73f03f839
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
afab2530c9 iot/dns: Fix IPv6 compilation issue
Update network context variable to 'net_ctx' and 'type' to 'query_type'

Change-Id: I956b8b5c79af7300ea9edc04c6ffd2a2b654d1ba
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
66a323faf2 iot/dns: Add support for the FRDM K64F board
This patch adds the project file for the FRDM K64F board, it also
updates the README_IPv4 file to include instructions for using the
DNS resolver with the FRDM board.

Change-Id: Ic9b92c2fed2636b56044309dc3be7c829d828d35
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
56ba584ef1 iot/dns: Update Makefile
Remove legacy KERNEL_TYPE conf variable.

Change-Id: Ibc064d1e222dd9e085f6782f1a3f8e61661b0691
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
d3f587e326 samples: net: mbedtls: Let's enable fastest enc28j60 speed on a101
enc28j60 can work up to 25Mhz, let's set a divider of 2 on the 32Mhz
host clock then. This require to mimic CS with a gpio in the SPI driver.

Change-Id: I98f84fa793a614cdbb566be39a262ff825101255
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
90dc300f1e samples: net: Add dedicated dhcpv4 prj.conf for frdm k64f board
This will help testing dhcpv4 through frdm k64f ethernet port.

Change-Id: I7cf47d77b79041fe7ab408355d1a9f9332fc1f54
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
cc946bf328 samples: net: Add Arduino 101 dedicated config for dhcpv4_client
This helps to test enc28j60 along with dhcpv4

Change-Id: I884f0aba0a04c3cc0d015d327cb9c100759d45ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
a2bb2119de samples: net: Remove useless prj.mdef from dhcpv4_client
Change-Id: I2d4b5a78b0a38828318634b48bb8e7c59cf62390
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Luiz Augusto von Dentz
cb8f775813 net: echo_client: Fix using CONFIG_NETWORKING_WITH_BT
Removes left over CONFIG_NETWORKING_WITH_BT which has been deprecated.

Change-Id: Ida3a2c2dba6e44f112711170f883c0582c3ee7ed
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 19:14:54 +01:00
Andrei Emeltchenko
e27e1e73e1 samples: net: Fix compile error following frdm pinmux change
Fixes echo_client and echo_server samples.

Fixes compile error:
...
src/built-in.o: In function `fdrm_k64f_cc2520_pinmux_setup':
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
...

Change-Id: I590f88f6bd083a30deea77fa860f001a3a55b278
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
7d5c9de92b samples/net/README: Add DNS client section
This commit adds the DNS client section to the samples/net/README file.

Added text includes a quick description of the application and
references to documentation already available in the tree.

Change-Id: Ia7ef3aea19069df5be2d8f14344b1afa750b22bd
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
fc24fc293a samples/mbedtls_dtlsclient: Add ARG_UNUSED
This commit adds the ARG_UNUSED macro for the status variable in
the udp_received callback.

Change-Id: I8c592cab72ccf5ba314742ef705e96d4a4d067e9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
3b64d87cac samples/mbedtls_dtlsclient: Validate destination buffer size
This commit validates the size of the buffer used to store the
incomming datagram in the udp_rx routine.

Furthermore, two expressions related to the rx net_buf are now
executed before returning on error, avoiding a possible memory leak.

Change-Id: I30dc0a2d57dc207590387f1a9ab79945a1157ef5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Sergio Rodriguez
a6dd26a99e samples/mbedtls_dtlsclient: Using semaphore for rx
The DTLS client will use and asynchronous signaling method to
receive, this makes the sample work on QEMU

Jira: ZEP-1233

Change-Id: I28f074c4736f84c10e6be8119a5ba50b138fcc0d
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
c7afecf179 iot/dns: Update sample application
Previously, the domain names used in this application were
not very useful to proof that the DNS client was able to handle
multiple IP addresses.

In this patch, the number of domain names is increased. Some of them
may return multiple IP addresses as shown in the README_IPv4 file.
However, results may vary depending on the network setup.

Change-Id: Ic713ce48b4afa592c1480311f4394de6e57bf3fb
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
44b2f212a1 iot/dns: Use a k_sem for the DNS rx routine
This patch introduces a k_sem that will block until:
- data is received, or
- the user-provided timeout expires

This change allows us to simplify our previous DNS client
implementation.

This change is related to ZEP-1357 because we are refactoring the
DNS client API removing the continuous update of the net_context_recv
routine that seems to be causing issues after the kernel's update.

Jira: ZEP-1357

Change-Id: If01c9274ac8f096f0095a2872f86be2e007212ee
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
0d257a009a iot/dns: Introduce the dns_context structure
This commit introduces the dns_context structure.

This new structure will reduce stack overhead due to
the simplication of the dns_resolve routine signature.

Furthermore, the timeout parameter is now int32_t
instead of uint32_t.

The dns sample application is also updated.

Change-Id: I5d789656bacbd23c4654edce5d116a88dc42c354
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:52 +01:00
Tomasz Bursztyka
89dc7ed78a samples: echo apps: Use Kconfig options to setup IPv6 on cc2520 config
Change-Id: If2e6f577cee53e0a4362c4b6ba12886ff1cfdcdd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:52 +01:00
Luiz Augusto von Dentz
90be49f1e3 net: echo_client: Enable Bluetooth support
This enables Bluetooth L2 driver with CONFIG_NET_L2_BLUETOOTH and
removes CONFIG_NETWORKING_WITH_BT which has been deprecated.

Change-Id: I6a75c105e45a1b748abf6a70234d415c5121bcdc
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 19:14:52 +01:00
Luiz Augusto von Dentz
88bd2f9560 net: echo_server: Enable Bluetooth support
This enables Bluetooth L2 driver with CONFIG_NET_L2_BLUETOOTH and
removes CONFIG_NETWORKING_WITH_BT which has been deprecated.

Change-Id: I6f8b0e756f6e066b4b9cf9dec22f52fd72155c98
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 19:14:52 +01:00
Tomasz Bursztyka
572f41a464 samples: net: echo apps: Add cc2520 configuration for frdm_k64f
Common code found in samples/net/common
App is built with:
make BOARD=frdm_k64f CONF_FILE=prj_frdm_k64f_cc2520.conf

Note: debug messages are enabled on many parts of the system, and these
are killing the timings. So it's not unusual at all to see rx errors on
cc2520 side. Without most of the debug, much less error will occur (if
any when dbg is fully disabled).

Change-Id: Ib6f0868c300652270661e72e80108804308164ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:52 +01:00
Tomasz Bursztyka
7bd1b6cfeb samples: wpanusb: Removing legacy left-over
Change-Id: I5aeeb239ad425931fd6f87804000d941754e6a05
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:51 +01:00
Anas Nashif
fe958df4dd libc: rework libc selection and reduce Kconfigs
Moved all libc Kconfigs to where the code is and remove the default
Kconfig for selecting the minimal libc. Minimal libc is now the default
if nothing else is configured in.

Removed the options for extended libc, this obviously was restricting
features in the minimal libc without a good reason, most of the
functions are available directly when using newlib, so there is no
reason why we need to restrict those in minimal libc.

Jira: ZEP-1440
Change-Id: If0a3adf4314e2ebdf0e139dee3eb4f47ce07aa89
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-15 22:31:28 +00:00
Anas Nashif
418058a123 kernel: remove NANOKERNEL and MICROKERNEL configs
Those are legacy and not needed anymore.

Change-Id: I8113114fd60880b3f538612db7702f6129af0a06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-14 13:45:52 +00:00
Marcus Shawcroft
954baea90b random: Restructure RANDOM Kconfig
Restructure the RANDOM Kconfig to match the structure used in other
drivers with a single top level menu.  Move the true random number
generators to appear first in the menu, with pseudo generators at the
bottom.  Do not present pseudo generators if a true random generator
is presented.

This change implies that tests, samples and applications that require
the random driver interface must now select CONFIG_RANDOM_GENERATOR.

In order for tests and samples to build (and run) on platforms that
have no random driver it remains necessary to select
the CONFIG_TEST_RANDOM_GENERATOR.

Note that CONFIG_TEST_RANDOM_GENERATOR retains its original purpose of
enabling a random driver that delivers non random numbers for the
purpose of testing only.

Change-Id: I2e28e44b4adf800e64a885aefe36a52da8aa455a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13 22:50:18 +00:00
Johan Hedberg
c3e08c8fea net: buf: Redesigned pool & buffer allocation API
Until now it has been necessary to separately define a k_fifo and
an array of buffers when creating net_buf pools. This has been a bit
of an inconvenience as well as blurred the line of what exactly
constitutes the "pool".

This patch removes the NET_BUF_POOL() macro and replaces it with a
NET_BUF_POOL_DEFINE() macro that internally expands into the buffer
array and new net_buf_pool struct with a given name:

	NET_BUF_POOL_DEFINE(pool_name, ...);

Having a dedicated context struct for the pool has the added benefit
that we can start moving there net_buf members that have the same
value for all buffers from the same pool. The first such member that
gets moved is the destroy callback, thus shrinking net_buf by four
bytes. Another potential candidate is the user_data_size, however
right not that's left out since it would just leave 2 bytes of padding
in net_buf (i.e. not influence its size). Another common value is
buf->size, however that one is also used by net_buf_simple and can
therefore not be moved.

This patch also splits getting buffers from a FIFO and allocating a
new buffer from a pool into two separate APIs: net_buf_get and
net_buf_alloc, thus simplifying the APIs and their usage. There is no
separate 'reserve_head' parameter anymore when allocating, rather the
user is expected to call net_buf_reserve() afterwards if something
else than 0 headroom is desired.

Change-Id: Id91b1e5c2be2deb1274dde47f5edebfe29af383a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-13 21:41:53 +00:00
Marcus Shawcroft
409b754a15 Remove application calls to sys_rand32_init.
The random driver, if enabled, is initialized by the kernel
initialization function.  There is no need for applications or tests
to re-initialize the driver.

Change-Id: Ib4712dda937a7a83a8079c8aa662cec03c5416f8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-11 11:18:18 +00:00
Johan Hedberg
fc21a76db6 net: Fix incorrect logging format specifiers
Fix compilation issues that show up if SYS_LOG is mapped to printk
instead of printf. Unlike printf, printk is annotated so that the
compiler catches incorrect format specifiers passed to it.

Change-Id: Iab7cc6da110e9c98720211a6f773dcf055a3a411
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-07 13:15:58 +00:00
Tomasz Bursztyka
1475322433 samples: net: Leds demo needs GPIO on all platform
Fixing a tiny build error found through sanitycheck.

Change-Id: Iee9a3ac135380ddf70e2902b532f6f28d417715c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-05 16:57:06 +01:00
Tomasz Bursztyka
f3c1b442ba samples: net: echo apps: Add cc2520 configuration for arduino_101
CC2520 is not embedded on an arduino_101, it is however possible to wire
one, and thus it requires to provide cc2520_configure_gpios() function.
This one, being common to a101 is found in samples/net/common.

Change-Id: I86f2734847edb3f6a968522afccc3099ed854d13
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:20 +02:00
Sergio Rodriguez
e6b5239c33 wpanusb: Fix include path
Commit https://gerrit.zephyrproject.org/r/#/c/6971/ changed the
location of some include files, making compilation fail.

Change-Id: I43c124be28b55e550ef2204ca9faa7031665fb4a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:20 +02:00
Flavio Santes
c2f7c907c9 iot/dns: Update sample client application
This commit updates the dns client application to use the
new kernel API.

Change-Id: Ibf920532b02a1561bfb38f69e5dd994ab21574bc
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:41:20 +02:00
Jukka Rissanen
3eaec41ab8 net: Moved net/ to subsys/net
* Moved networking code into subsys/net.
* Renamed net/yaip to net/ip at the same time.
* Fixed the tests/net to compile
* Fixed the Makefiles and Kconfig files in subsys/net
  to use the new location of the IP stack

Change-Id: Ie45d9e8cb45a93fefdf969b20a81e3b1d3c16355
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:20 +02:00
Jukka Rissanen
51da830b5e samples: zperf: Port to native IP stack
Port the zperf network performance tool to native IP stack.

TCP support is missing from this version.

Change-Id: I2648e7d81014bb0cae8cf50854b0ae5f89a6567c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:19 +02:00
Jukka Rissanen
79e2178040 samples: net: Do not quit echo-server if sending fails
If we cannot send a network packet, do not quit as that is
really not necessary here.

Change-Id: I7613d46bdbc849b75aaf0fc71c58beba810fd658
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:19 +02:00
Jukka Rissanen
6c02719125 samples: net: Use qemu_x86 config file by default for echo apps
As the default board is qemu_x86, make sure there is similarly
named config file that can be used by default.

Change-Id: Ibc480d3b4eecc2601e3670c8da19be9c01833c36
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:19 +02:00
Jukka Rissanen
2631995fa9 samples: net: Use board specific conf file for echo apps
Use by default a board specific config files for both
echo-server and echo-client sample applications.
This makes more sense than using the network technology specific
config file that was used earlier.

Change-Id: I155fc138f4b0ed1166f4e25267513afc3fb6fd76
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:19 +02:00
Jukka Rissanen
7ebcf7398a samples: net: Remove prj.mdef file from echo sample apps
Change-Id: I6edb869a5998d47338dfb04e7ed8ee1aee8c1cb8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:18 +02:00
Jukka Rissanen
7048c992fb samples: net: Convert the echo apps config files to native stack
Remove legacy stack artifacts from the echo-server and echo-client
config files.

Change-Id: Icc591b9540495c4ee181517369b0df9bb91972bb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:18 +02:00
Ruslan Mstoi
fed49c7493 samples: net: enable debugging with qemu target
This enables application debugging using qemu target:

export QEMU_EXTRA_FLAGS="-s -S"
make qemu

Was tested with echo_server

Change-Id: I1906dea2fbc5afe03b11729d2edb8f3629a629f8
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen
68ea9377e6 net: Make native IP stack the default
As the native IP stack is now the default, there is no need
for corresponding Kconfig option.

Change-Id: I08e4992f540f928a2b7378e8803e634e38725348
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Flavio Santes
3c28f9c211 net: Remove legacy IoT sample applications
This commit removes the old MQTT and NATS publisher and subscriber
applications that were based on the uIP stack.

Change-Id: I7ba8e155e32ba0aa53c8dec1b6c0cc5170d70943
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen
6b43821f20 net: Remove legacy Contiki based uIP stack
This commit removes the legacy Contiki based uIP stack.
The new native IP stack must be used after this commit.

The commit also removes following things:
- legacy cc2520 driver
- legacy ethernet drivers
- legacy IP stack samples

and changes these things:
- disabled tests that only work for legacy IP stack
- select new IP stack by default
- enable random number generator by default as it is needed
  by the new IP stack

Change-Id: I1229f9960a4c6654e9ccc6dac14a7efb9394e45d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen
b3077ab4e7 samples: net: Fix echo-server compilation error
My IPv4 address was missing because of complex set of #ifdef's.

Change-Id: I6768587d3e104a57c10756bc43267f26068aa3cb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:15 +02:00
Tomasz Bursztyka
f0c41205db wpanusb: Minimize debug output by default and set proper nbuf size
Nbuf data size needs to be set to 128 bytes, specifically for
wpan sample.

Debug output kills timing, and thus can generate spurious failures on
reception, so limiting it to errors by default.

Change-Id: Ia918361d07369dacbe577e26855d7ef6ed865f7b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:15 +02:00
Jukka Rissanen
a870dffa7f samples: net: echo apps can use IP address set in config file
The used IPv6 or IPv4 address can be set in the config file.
This way one does not need to edit the source file to setup
the desired IP address.

Change-Id: Ic900bd4694481b4b035026ad0ba7b9280eb84e4a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:14 +02:00
Jukka Rissanen
876b7a9b10 samples: net: Bind to any IPv4 address by default
Let the echo-server listen any configured IPv4 address
by default.

Change-Id: Ib83c5e069ae1e26615c37fa980bc4009b5a5e40c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:14 +02:00
Jukka Rissanen
0cc43a62ac samples: net: Do not use static address in DHPCv4
If user has enabled DHCPv4 support, then do not try
to set static IPv4 address.

Change-Id: Ia359f578044d72b951f53c509c92c09d575207f0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:14 +02:00
Mahavir Jain
eefd912fed samples: net: Use unified kernel interface for sem/queue declaration
Change-Id: I2519a7a35f83d2542f333ca6791a6f22944a42c4
Signed-off-by: Mahavir Jain <mjain@marvell.com>
2016-12-02 12:41:14 +02:00
Vinicius Costa Gomes
8a11cf696d samples/leds-demo: Listen on the ANY address
If we want to receive packets to multiple addresses, the solution is to
listen on the ANY address, and add the address to the interface in
question (already done).

Change-Id: I383cc1401f1236ee05bdb010252a9f9909aa15bd
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:14 +02:00
Vinicius Costa Gomes
9cd6bd9961 samples/leds-demo: Fix not using the LED correctly
Before using the LED we must set the direction of the GPIO pin to
output, and the LED will turn on when that GPIO pin is 'low'. So, for
our purposes, the LED is active low.

Change-Id: If8e6ce05ff2f3ddb7b17a87b172a91f7276194a4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:13 +02:00
Vinicius Costa Gomes
4723d29e32 samples/leds-demo: Fix missing include file
'board.h' includes the definition of LED0_GPIO_PORT and LED0_GPIO_PIN,
without this include the fallback was used, as if the board in question
didn't have any LEDs.

Change-Id: I78ebdb2e2ffc41dff5011dcf9e33e09d70950e81
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:13 +02:00
Vinicius Costa Gomes
e27c7c02b2 samples/leds_demo: Add config for using 802.15.4
This adds a configuration profile allowing this example to run on a
Quark SE C1000 devboard.

Change-Id: Ic04fd30a91ed0a1fc8c3a3b3a6e397f0722f50b1
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:13 +02:00
Tomasz Bursztyka
d02a9692ff wpan_serial: Minimize debug output by default and set proper nbuf size
Nbuf data size needs to be set to 128 bytes, specifically for wpan
sample.

Debug output kills timing, and thus can generate spurious failures on
reception, so limiting it to errors by default.

Change-Id: Ia0b8c904e0bc66a7922af4f317db623db6c51462
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:13 +02:00
Mahavir Jain
847432e7dd sample: dhcpv4_client: use unified kernel APIs
Remove legacy kernel APIs and use unified interface

Change-Id: I5ef9a31635aa4862640272353003c0c337509a97
Signed-off-by: Mahavir Jain <mjain@marvell.com>
2016-12-02 12:41:12 +02:00
Leandro Pereira
2543b2f6ee samples: net: Finish TCP support in echo server
This adds the required code to echo server so that it works with TCP as
well.

Change-Id: Ib45dd91a52a60ddb4d8f0ae11175ceb52199c398
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2016-12-02 12:41:12 +02:00
Vinicius Costa Gomes
b3dc2f8ecd samples/zoap_server: Using unified kernel API
Dropping legacy API.

Change-Id: If01eb40b7dfd9fac322ab8c001b7ebe37c0fed43
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:12 +02:00
Vinicius Costa Gomes
19087b8eca samples/zoap_client: Using unified kernel API
Dropping legacy API.

Change-Id: I8df78bc33550467b8558f8e58a6c390ce84f3b12
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:12 +02:00
Andrei Emeltchenko
b0aee95eda wpanusb: Log INF about upper layer start/stop
Change-Id: Ibb841afb94150ccc73b5e80a41a2ca9c949a25c8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:12 +02:00
Andrei Emeltchenko
17b6c45e79 wpanusb: Include shell to the sample
Including shell allows to execute some kernel commands and make sure
system is not crashed.

Change-Id: I6157229614655dc7e523f1cf0f84ee7c58d7a717
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:11 +02:00
Tomasz Bursztyka
640ba28793 samples: net: No need of full debug output on cc2520 in echo client
Change-Id: I6ffe5e5c9e8f4baa55386c2f5f430c2765e6f6ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:11 +02:00
Andrei Emeltchenko
82ac4f68f7 wpan_serial: Correct file description
Correct leftovers from CDC sample.

Change-Id: I337440a4f9a9016bb0635f49e205c1b6fee56e96
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
fd57ca6f23 wpan_serial: Use unified API for wpan_serial sample
Convert API to unified.

Change-Id: Ie00eb84441295a8311181186cbb117837a0fd3ca
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
3f2db79cd2 wpanusb: Use unified API for the wpanusb sample
Convert to unified API.

Change-Id: I8f400fe5fca6411f3c3da40d409cff49a05da619
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
cf66ddfd39 wpanusb: Use INFO default logging level
Due to huge delays with DEBUG log level change it to INFO.

Change-Id: I81caf78fc6e9e064c2ed8e18caa99351028af62a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
b2d2c7fe06 wpanusb: Send zero sequence for unsuccessful transmit
In a case transmit is failed send ack to the driver with zero sequence
number which is not used for valid seqs.

Change-Id: I1047de9ab5de636c5a8983f31376046757c4dc0c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
5ceb1133c4 wpanusb: Allow retransmission when cc2520 transmit not done
Following replacing semaphore with timeout semaphore transmit may not
be finished returning error after which communication stalls. Allowing
3 retransmits solves the issue.

Change-Id: Ibad05c2eac43dd6bb0ed72aaf16a7a2ef4185067
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:09 +02:00
Tomasz Bursztyka
0bb17f9639 samples: net: Put a proper stack size for echo-client
Having 1024 bytes was really unsufficient and creating a lot of weird
bugs everywhere.

Change-Id: Ib642744fa6dfc9f3a699a0dc2f0c1783dc6f87b2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:09 +02:00
Tomasz Bursztyka
1e7a92f7da samples: net: Fix how k_sem_take is used in echo_client
Semantic has changed in k_sem_take in comparison with legacy
nano_sem_take.

Change-Id: I06129b6f15f66266919bf371c2358e5634109156
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:09 +02:00
Tomasz Bursztyka
2dd1b5df0f samples: net: Use uart-pipe for 802154 iface in echo apps
This is meant to test echo applications with 802.15.4 L2 directly in
qemu.

Change-Id: I0edccd8c39360421dc77e0064147221d86877bdf
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:09 +02:00
Jukka Rissanen
26ea431c5f samples: net: echo apps: Do not set preferred IPv6 address
Previous commits support auto configured IPv6 addresses so no
need to manually tweak the address settings.

Change-Id: Ie641212981a04229721c84990a54876977d9cfc4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:08 +02:00
Jukka Rissanen
7e9eaaacb9 samples: net: Fix echo-server UDP packet sending
This commit fixes the case when we receive large amount of
data and then copy it into new fragments. If the MTU is larger
than the fragment size, then it is possible that we might
overwrite net_buf memory and crash. This is typical in ethernet
network.

Change-Id: Ib1c65819c3bc718ec04f558e3df235246b5655dd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:08 +02:00
Sergio Rodriguez
8a7ca107b5 samples/mbedtls_dtlsclient: Using unified kernel thread spawn API
Change-Id: I760183861e458f3daf8d419a5234332141a732dc
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:07 +02:00
Sergio Rodriguez
67ce715d0d samples/mbedtls_dtlsclient: Removing unnecessary files
The DTLS client will not longer use the legacy IP stack.

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I7402a188fc7501873d98d3b6cb2f03ee51f3506b
2016-12-02 12:41:07 +02:00
Jukka Rissanen
f836032d39 samples: net: Bind any IPv6 address by default in echo-server
This commit allows echo-server to listen all defined addresses
specified to its network interfaces.

Change-Id: I52874210f6987c75d7921e514399a9eda55911bb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
3964a6cef3 samples: net: echo apps: Using unified kernel API
Dropping legacy API.

Change-Id: Ib1f2fbffddde02ea97ad2cb665d7fda77248d936
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Andrei Emeltchenko
3d67b5badb wpan_serial: Correct SLIP buffer size
SLIP buffer size depends on maximum IEEE 802.15.4 frame size and start
byte.

Change-Id: I1cb0a848dce6b0c85bf11408733d777f7a3b03c9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:06 +02:00
Andrei Emeltchenko
f0e819faea wpanusb: Update wpan protocol document
Remove unneeded SET_HW_ADDR_FILT since it is handled by other
commands and add missing opcodes.

Change-Id: I4b6488e6cee742b79c16789e817795138506dc77
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:05 +02:00
Tomasz Bursztyka
acc7e6a011 samples: net: Do not set nbuf data size on 802.15.4 samples
It's 127 by default as soon as 802.15.4 l2 is selected.

Change-Id: I6c29d88bb3277a15fe54693027caf320bc3d9fc4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:05 +02:00
Vinicius Costa Gomes
432c6b9997 samples/net: Add a simple demo for the link-format feature
This demo showcases how to expose resources that are exposed using the
link-format feature.

Change-Id: Iad9421082fae3212cae58e6d6e9b88fa170678b8
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:05 +02:00
Tomasz Bursztyka
d604bb98c3 samples: net: Add CC2520 dedicated prj.conf files for echo apps
Change-Id: I264a1577a176d37793a475e9605694d9d988fc69
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:04 +02:00
Jukka Rissanen
1aeea63d17 net: apps: Set the IPv6 source address preferred for echo-client
Forcefully set the IPv6 address in echo-client so that we
can use that address when sending data. Normally this should
not be done like this as the system should autoconfigure itself.

Change-Id: Id24f9aa84b30a3da941bb6b9e4522c7218687e12
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:03 +02:00
Sergio Rodriguez
51c61dcd50 samples/mbedtls_dtlsclient: mbedTLS sample DTLS compile on unified kernel.
Makefile modifications to be able to be compiled with the unified kernel

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I0fce5d3f6b28df0cff4b7c0b554a787996e8c966
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
f416f615bd wpan_serial: hexdump and interrupt debug to VERBOSE_DEBUG
Print packet hexdump and interrupt related debug only when
VERBOSE_DEBUG is enabled.

Change-Id: Ieb997e3537a9a2316d1435372948004dd93babab
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
a239abeb5c wpan_serial: Update README
Update information related to simple web server info.

Change-Id: Ib0155c116a3d53b374a7401eb6e9d1599390dba3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
c275f0756e wpanusb: Decrease amount of debugs
Print packet hexdump only when VERBOSE_DEBUG is enabled and remove
debug print in empty functions.

Change-Id: Ifd3ae59001233f0237c4b7575bd92607c93e2ea0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Jukka Rissanen
06a408e16c net: apps: Set the IPv6 source address preferred for echo-server
Forcefully set the IPv6 address in echo-server so that we
can use that address when sending data. Normally this should
not be done like this as the system should autoconfigure itself.

Change-Id: I99041539c50f994f5d3ddaabaf5cac8599d82078
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:03 +02:00
Tomasz Bursztyka
3e23b2b824 samples: ieee802154: L2 debug Kconfig option has changed
Change-Id: I81e23038947e9423b38391943298b67c83a7a221
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Sergio Rodriguez
0b56b4066f samples/mbedtls_dtlsclient: mbedTLS sample DTLS client app on Arduino 101.
This is a sample app using ECJPAKE crypto algorithm on DTLS, using mbedTLS,
native IP stack and the enc28j60 SPI Ethernet Driver

Change-Id: I658c3d9a54cfdd164a4147903125400f223c6e0a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:01 +02:00
Vinicius Costa Gomes
098bdc0741 samples/zoap_server: Fix wrong reference count
It is the responsibility of the callback to release the buffer.

Change-Id: Id80f5f9ca190868a7c173994bb7ec7ee7f6251b7
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:58 +02:00
Vinicius Costa Gomes
d51e682f5c samples/zoap_server: Fix retrieving the wrong address
When retrieving the address of a peer from the net_buf, care should be
taken so it happens before the 'data' pointer of the buffer is modified,
which causes the macros to retrieve the address from invalid positions.

Change-Id: I466fb989119ab5f7d0ac3899979670675bdaa946
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:58 +02:00
Tomasz Bursztyka
7fb317321b samples: ieee802154: Fragmentation is now supported so enabling it
Change-Id: Ibddde76f82da4b40fdb9f62d9b2a481ee7feec3c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:57 +02:00
Jukka Rissanen
5f3f331d48 net: Adapt to new behavior of net_buf_frag_add v2
This change is related to patch called
"net: Adapt to new behavior of net_buf_frag_add"

This version removes extra net_nbuf_unref() from
the code. The unref was done because net_buf_frag_del()
did not remove the double ref from the list element.

Because of the other patch, the list does not have
double ref any more, so we need to remove the extra
unref in couple of extra places.

Change-Id: If90e01c24b9b4e68afbfa283850d2a1ecb3065ed
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:54 +02:00
Andrei Emeltchenko
899df8742f wpanusb: Add wpanusb syslog domain
Change-Id: I06f2df88678658a495b3ae0064b542f4697161a9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:54 +02:00
Andrei Emeltchenko
3c75cc9c9c wpanusb: Correct definition names
Change definition name suffix to WPANUSB

Change-Id: I3456ebff061866a67b7a07b33f6ff83a31a2d7a8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:54 +02:00
Andrei Emeltchenko
cb77016c23 net: samples: Add samples overview for wpanusb and wpan_serial
Change-Id: I05f6ce9a823cb8a5466bd02739386f23e9266cc2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:54 +02:00
Flavio Santes
fd2e2f2f5e iot/dns: Update README files
This commit updates the README files to reflect that ZEP-1036
is already solved.

Information about ZEP-1097 and ZEP-1098 is now included.

Change-Id: I3c83160962d308d374823e086bbf083dca988606
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:52 +02:00
Flavio Santes
ffb6ae0dda iot/dns: Improve support for additional boards
This commit modifies the conf and Makefile files of the DNS client
application.

Inside the Makefile, the CONF_FILE variable is updated to include
the BOARD name, therefore prj_'board_name'.conf is used from now on
to refer to the conf file. The right conf file is selected by passing
BOARD='board_name' to make.

Configuration variables at the conf files are also homogenized.

Change-Id: I6f5aaad0b52d458bceb90b315aba2b31f085c0a0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:52 +02:00
Andrei Emeltchenko
408d0c2124 wpanusb: Improve debug for wpanusb
Change-Id: I90201df4a50f81cd9a479539826456a6ffb62bb9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:52 +02:00
Andrei Emeltchenko
9bbfaef4a1 wpan_serial: Implement 802.15.4 serial radio protocol
Implement serial-radio protocol used in Contiki-based border routers
to interact with 802.15.4 devices connected over serial or USB-serial.

Change-Id: I938b34ca32ae7a08e5d48e3bea585cda6c98c113
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:52 +02:00
Andrei Emeltchenko
7b4acbff25 wpanusb: Add wpan radio protocol specification
Change-Id: I4ab00d87de50a9efa5b715649d4b5154e37ce1c0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:52 +02:00
Jukka Rissanen
ddda50c214 net: tcp: Initial TCP functionality
This creates initial TCP handling logic but does not yet
enable fully working TCP connection.

Some of the connection logic is taken from FNET TCP
implementation.

Origin: FNET 3.6.1
URL: https://github.com/butok/FNET/blob/master/fnet_stack/stack/fnet_tcp.c

Change-Id: I1e100d9fa9c91437562b933d94d0bd3db1a5885e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:51 +02:00
Paul Sokolovsky
4de34b3914 net: apps: Fix echo-server where IPv6 TCP context was used instead of IPv4
Apparently a copy-paste error.

Change-Id: I55aac4231384cbd95394f08a4c4f9c717aae5248
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-12-02 12:40:51 +02:00
Ravi kumar Veeramally
c689fd6f1a net: Rename net_nbuf_write to net_nbuf_append
Current net_nbuf_write() api just appends data to last fragment. And
doesn't write data based on offset. That's why renaming this api.

New net_nbuf_write() apis based on offset will be coming soon.

Change-Id: Ie8e13e5f6091a279b62b6d8b0b3928a5187e75b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:51 +02:00
Flavio Santes
8d001fa5cb iot/dns: Add support for Arduino 101 and ENC28J60
This commit adds support for the Arduino 101 board with the
ENC28J60 Ethernet module.

Change-Id: Ib852e9cfb2b3b2188d3320e00d6bc24620e187f5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:51 +02:00
Sergio Rodriguez
05aded096e samples/mbedtls_dtlsclient: mbedTLS sample DTLS client app.
This is a sample app using ECJPAKE crypto algorithm on DTLS, using
mbedTLS, and native IP stack

Jira: ZEP-900
Jira: ZEP-943

Change-Id: Ica17b047aab11b989d3e8c8f6ac1b79e3041053a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:40:51 +02:00
Vinicius Costa Gomes
46be4f4907 samples/zoap_client: Use token generator helper
Change-Id: If3dfe80deb8ff753fecae539032399deb15279ee
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:50 +02:00
Vinicius Costa Gomes
dc45748d50 iot/zoap: Port to the native stack
This ports zoap to the native stack.

Just for reference, and totally not scientific, here are the numbers
using the old stack:

$ size outdir/qemu_x86/zephyr.elf
   text	   data	    bss	    dec	    hex	filename
  34657	  10316	  16916	  61889	   f1c1	outdir/qemu_x86/zephyr.elf

With yaip:

$ size outdir/qemu_x86/zephyr.elf
   text	   data	    bss	    dec	    hex	filename
  30575	   9148	   6164	  45887	   b33f	outdir/qemu_x86/zephyr.elf

Jira: ZEP-818

Change-Id: I7992a3e2af7d419081ee5a64d7cc2d49fb628ead
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:50 +02:00
Juan Manuel Cruz Alcaraz
92539f21fc enc28j60: Modify echo server and client samples to support enc28j60
Extends the echo server and echo client samples to work with YAIP
network stack with ethernet L2 layer and ENC28J60 ethernet device
on Arduino 101 boards.

Jira: ZEP-859

Change-Id: I242e5555aff18741bf00a551424b081b5396f4b3
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:50 +02:00
Flavio Santes
552dfaeaa7 iot/dns: Add DNS Client sample app
This commit adds the DNS Client sample app on top of the new native
IP stack. This sample app supports IPv4 and IPv6. See README_IPv4 and
README_IPv6 files.

Origin: Original

Jira: ZEP-793
Jira: ZEP-855
Jira: ZEP-975

Change-Id: Id78bd634c44e216fd45b395c91d95b71ef68c976
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:49 +02:00
Flavio Santes
eb03404bce iot/dns: Remove legacy DNS client sample code
This commit removes the legacy DNS client sample code.

This patch is part of a commit series that will add support for
DNS client services on top of the new native IP stack.

Jira: ZEP-793
Jira: ZEP-855
Jira: ZEP-975

Change-Id: Ieb3366b21a365b8f77e576109c64c0fc4218aabb
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:49 +02:00
Jukka Rissanen
146f0e7b87 net: sample: echo-client ported to use the new IP stack
Change-Id: I1666d0634af124fc7a01027187916f427b7c98f8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:46 +02:00
Jukka Rissanen
35c9098c82 net: sample: Make sure echo-client is compiled by sanitycheck
In some cases the BT header files are missing and the compilation
will fail when done by sanitycheck script.

Change-Id: I484e1f0c23975053e947bc57ff3c9f4042fad71e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:46 +02:00
Andrei Emeltchenko
3bc58717a1 wpanusb: Export ieee802.14.5 over USB
Export ieee802154 radio over USB to be used in other Operation Systems
like Linux. In this scenario Linux SoftMAC driver would be used
implementing ieee802154 stack inside Linux.

Currently tested to work with Raspberry Pi and addon ieee802154 board.

Change-Id: Iabcbbfcaad8e3935a63faca50a19fb624e78a351
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:46 +02:00
Tomasz Bursztyka
dd7b967f2d samples: quark_se_devboard has been renamed to quark_se_c1000_devboard
Change-Id: I38942fad17b9955ca4c6e25414284eab465225df
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:27 +02:00
Ravi kumar Veeramally
a026c615ff net: apps: Add DHCPv4 client sample application
Change-Id: Ia0366a24c2bc18cbd9278b7dc7d4a155df6521fb
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:26 +02:00
Ravi kumar Veeramally
eff902b4c7 net: tests: Add include dir only when specific options enabled
Change-Id: I2119c6e08b0d13c6a6849b46f210196b07b8d51e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:26 +02:00
Tomasz Bursztyka
203be13f83 net: samples: Add a simple Qemu sample for testing off-line 802.15.4
This will use the dedicated UART pipe driver to send/receive IEEE
802.15.4 "radio" frames.

- make
On one console:
- make qemu1
On a second console:
- make qemu2

Note:
net-tools is needed, cloned into net/tools
https://gerrit.zephyrproject.org/r/#/admin/projects/net-tools

Change-Id: I833cd40238b0653bb5b9a9b462fb4d5d2a3504b9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
60c71f4d90 samples: net: Qemu make utilities update
- net tools directory is now in net/tools
- fixing the 80 chars line limit

Change-Id: I079880fa3449beffb326369ab23550dcba3ccf20
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
49dffe2669 samples: net: Moving the current ieee802154 sample
More samples will come. Current one is meant to test ieee802154 with
cc2520 on quark_se_devboard target. Some future sample will show how to
use the Qemu uart pipe fake 802.15.4 radio driver for testing on one
host.

Change-Id: Idea2b16cde091c7da926ca8aa71912fbfd0a3d62
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
73d8c7c443 net: drivers: cc2520 ieee802154 drivers select relevant options
If no IP stack is seleceted, selecting one of the 2 cc2520 driver will
automatically select the relevant stack.

Change-Id: Icca22da190dc790ce6d302e14c45732f902e02ae
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
becf74743b net: Split debug Kconfig options from legacy to new stack
- new stack options are renamed and placed in their respective menus
- new stack Kconfig gets normalized (tabs vs spaces, etc...)

Change-Id: Ia68f6589fed464bbdd76dc0812775684b2f94a58
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Jukka Rissanen
58a7ada44c net: Add network address length to user API
Add socklen_t addrlen parameter to net_context_bind(),
net_context_sendto() and accept callback.

Currently the address length option is not really mandatory
as we can figure out the length from the address family.
But if we are going to support other protocol address families
it might be needed.

Change-Id: I59206465c3259050c469c5b2150221646a9a08d7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:24 +02:00
Paul Sokolovsky
5d7be031f3 net: samples: Fix the echo-server IPv4 address
When running echo-server in the Zephyr device (either a real
device or qemu), set the IPv4 address to be 192.0.2.2. The host
IPv4 address should be set to 192.0.2.1 in this case. This change
is similar to IPv6 address change made earlier (now both IPv4 and
IPv6 addresses on device side end with "2", on host side, with "1").

Change-Id: I639b7be4403b4b2f38f01675d0ef56eaabf0f82c
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-12-02 12:40:23 +02:00
Jukka Rissanen
9231f41f52 net: samples: Fix the echo-server IPv6 address
When running echo-server in the Zephyr device (either a real
device or qemu), set the IPv6 address to be 2001:db8::2.
The host IPv6 address should be set to 2001:db8::1 in this case.

Change-Id: Ia967cecabece4b06a2f5a12b11c68a9de4aeb2af
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Jukka Rissanen
0be446ba5f net: samples: Fix slip config for echo-server and echo-client
The prj_slip.conf file should be used for qemu-to-host
communication only. It is not usable for testing between
two qemus.

Change-Id: Id06813a1b36f33f585e06df3f29479891ea3d2d8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Jukka Rissanen
6258dc8e87 net: samples: Fix the location of net-tools project files
Fix the correct location of net-tools project files to
samples/net/README file so that the user can test the
echo-server and echo-client apps using SLIP and Qemu.

Change-Id: Ic34fa6e67da916c63e4f138e1e0def5d7632c80c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
b84e62f269 samples: Build ieee802154 sample with 6lo support
Debugging messages in 6lo are enabled as well.

Change-Id: I8fea044216e3c4e60d742ebc7256489832ae09ac
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
ba4dda1703 samples: ieee802154: Debugging needs new Kconfig option
Change-Id: Iad9e5b9a2fda5b2c26697239d5437ff8ae75743a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Jukka Rissanen
44e2ce92f5 net: Fix the debug prints in echo-server
Change-Id: I1bda06e3b8727544727d0929aa180022b7a162d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:19 +02:00
Tomasz Bursztyka
93ac4a2520 net: Sample code to play with ieee 802.15.4 stack
Meant to setup a real 802.15.4 device, changing channel, pan id, etc...

Change-Id: I221ad197aa221bc8f9ec67d0fd523da2023f7979
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:18 +02:00
Jukka Rissanen
84edd8f2f1 net: apps: Fix echo-server to use the new user API
Echo-server no longer reverses the data as doing it
when we have a fragment chain is quite challenging.

Change-Id: I298669f3ddba67000672320e7b3b14f72e9f12d4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:16 +02:00
Tomasz Bursztyka
f51d84d93b samples: Fix echo_server for native IP stack
net_context.h is missing and one variable had a wrong name.

Change-Id: I4aac2f5c12cea39553fb86d1bd497c88f0ef1963
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:13 +02:00
Tomasz Bursztyka
260d3b95d7 net: Make net_core.h include the least amount of necessary header
net_core.h is the ground brick of the IP stack, and thus should not
include other headers that might include net_core.h also: this would
create circular dependencies.

Change-Id: I70c17b736788528e4e0b4b5b2c478098b049c9b1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:06 +02:00
Jukka Rissanen
73b57414a7 net: Setting static IP addresses for echo-server
This allows to test things between qemu and host when
using slip.

Change-Id: I27e17de9f0d8c2c8406f0afdd66c295e827f87a0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:05 +02:00
Jukka Rissanen
2f76da194d net: Make echo-server to use documentation IPv4 addresses
Use 192.0.2.0/24 address space that is specified in RFC 5737.

Change-Id: Iff2545f5b0f4817c99813c986d57801e166967a3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:05 +02:00
Jukka Rissanen
d24f673248 net: Receive IPv4 packet
Check if we have received IPv4 packet and call a handler
function to process it.

Change-Id: I9f9e5f0888d2c3b91401c98f4925647ddce09962
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:02 +02:00
Jukka Rissanen
e6d92ecdcf net: apps: Create a skeleton echo-server for new IP stack
This echo-server does not yet do anything useful.

Change-Id: I317051b3a2bfb0a80584ad385c2f308978a243cd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:00 +02:00
Baohong Liu
b18e4307b6 samples: net: fix a memcmp len error
The memcmp is a comparison between two strings or buffers.
So, the length should be the buffer length, not the length
of the pointer to the buffer. This was caught by LLVM.

Jira: ZEP-1179

Change-Id: I7fd6b199686b19e7f4a2e1288897483e69ad091e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-18 00:20:12 +00:00
Johan Hedberg
c583a9f43b Bluetooth: Kconfig: Restructure for a more logical hierarchy
Restructure the Bluetooth options more logically.

- Both host and controller are now behind the same high level
  CONFIG_BLUETOOTH.

- Selecting controller support disables other HCI driver selection, so
  the controller isn't in the same list as HCI drivers any more.

- Under the top-level there's a "Custom stack" option, which when
  enabled opens up the option of choosing CONFIG_NBLE.

There are various other cleanups and simplifications in this patch as
well, since splitting these up would have been fairly tricky while
making sure all test cases still build.

Change-Id: I5bb715cb9d20201cb8b72fbd149c8a09a4b2d7d2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 07:59:15 +02:00
Sergio Rodriguez
d56714b1c7 samples/net: mbedTLS TCP client use unified thread spawn API
Change-Id: Ic0c5f9abf94c593ce4aad09faff0b7bcac4e2cd8
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-11 02:51:32 +00:00
Sergio Rodriguez
fdc93c4733 samples/net: mbedTLS TCP client use unified kernel
Removing unnecesary flags

Change-Id: I2c72678dc8ba38ae0bd85459c2ea97d0de676314
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-11 02:51:31 +00:00
Andrew Boie
252144f6e8 samples: remove old kernel support
Change-Id: I89ab1e1926e2e8f07f8c8d5538a7587a605cb36b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-07 11:34:18 -08:00
Sergio Rodriguez
ddd47e2292 samples/net: mbedTLS TCP client use unified kernel
Use unified kernel.

Change-Id: I533321e908de999d9da9bd26adfc6215175a0cd9
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-05 13:01:21 +00:00
Benjamin Walsh
8cf56bcac7 unified: dissociate system workqueue from common workqueue module
Making a reference to the common work queue code should not necessarily
drag in the system workqueue, since it is possible to use a workqueue
that is not the system workqueue. This is done by moving the system
workqueue into its own code module.

Moving the system workqueue to its own code module allows removing the
NANO_WORKQUEUE and SYSTEM_WORKQUEUE kconfig options, and compiling the
common workqueue code and system workqueue all the time. They are only
linked in the final image if a reference to them exist, same as the
other kernel modules.

Change-Id: I6f48d2542bda24f4702e7c2e317818dd082b3c11
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-04 22:39:54 +00:00
Anas Nashif
d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Yael Avramovich
d5db35204a console: shell: Support multiple modules
Ability to use Zephyr shell by multiple modules simultaneously, each
module for its own usage.

Old shell implementation enabled the user to call only one module
commands, not all of the modules simultaneously.

Change-Id: I0ef8fa2fd190b7490c44fe91d1016363258302c9
Signed-off-by: Yael Avramovich <yael.avramovich@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 00:23:18 +00:00
Anas Nashif
b4dc970a7c tests: convert loopback test to unified kernel
Make it run on Qemu only, this test is not intended for HW.

Change-Id: I842d7456f9238221ef5b661749136f4418d5ab16
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 10:24:55 -04:00
Marcus Shawcroft
c20b48b9ed samples:dhcp_client: Add frdm_k64f configuration.
Change-Id: I4291c42ee601194c4c2cac0c997a2c48a8d52658
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 12:35:20 +00:00
Marcus Shawcroft
1c33ccfbe9 samples:dhcp_client: Refactor config file selection.
Adjust the dhcp_client sample Makefile to select a project
configuration based on BOARD rather than interface hardware.  This is
more convenient for supporting other hardware than the current
organization and is consistent with various other samples.

Change-Id: I0f59b632144dfa875dc036ec6f4aa4f6657a79bc
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 12:35:19 +00:00
Vinicius Costa Gomes
fcf98d1534 samples/zoap_server: Add preliminary support for validation
Implement resources so they conform to what the ETSI plugtest suite
expects.

This allows the zoap-server sample to pass most of the tests of the
CORE[1] group, only TD_COAP_CORE_09 is not implemented.

Tests involving lossy networks weren't run as well.

The tests were run against the libcoap[2] client.

[1] ETSI CoAP test description
http://www.etsi.org/plugtests/CoAP/Document/CoAP_TestDescriptions_v015.pdf

[2] libcoap
https://libcoap.net/

Change-Id: Ifa3ed21a93052e02f47e99d7cb6d9d4b28e576d8
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-17 02:12:12 +00:00
Vinicius Costa Gomes
da41fc87ed samples/zoap_server: Fix warning about pointer signedness
Change-Id: I78b2762d0713aa42d9800cb7736f4831195a6d3c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-04 12:29:07 +00:00
Vinicius Costa Gomes
0dfc9db815 samples/zoap-client: Add a README.txt to zoap-client
Change-Id: I2373d87cda125036cce169aaa492aeedcbe200dd
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:27 +00:00
Vinicius Costa Gomes
fcb3297b32 samples/zoap-server: Add a README.txt to zoap-server
Change-Id: I136d405e520ed8550e0b5012128a0c673bb9954a
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:27 +00:00
Vinicius Costa Gomes
76e81874f0 samples/zoap_client: Make it work with zoap-server
The path and port used by zoap-client were different than the ones used
by zoap-server.

Even if they are different applications, for consistency, it makes sense
for them both to be able to talk to each other.

Change-Id: I883d59c77bc3800b4f0965ba7bcf96a08e545d29
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:26 +00:00
Vinicius Costa Gomes
441d22a371 iot/zoap: Add port information to network addresses
uIP keeps the port separated from the IP addresses, so if the
application wants to communicate with a remote endpoint we must also
have the port information available.

Change-Id: I8e2b01fe5717166e1f9cebcc74b2056325b8ccc3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:25 +00:00
Anas Nashif
179ce1c891 boards: remove obsolete board basic_minuteia
This board is not being used or tested and does not actually
run on any hardware, remove it in favor of well supported boards
for this CPU.

Jira: ZEP-850
Change-Id: I01c825c7eb44d6c321f2ffb88e8899da528921dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-22 22:09:34 +00:00
Anas Nashif
572f4a1a14 boards: remove obsolete board basic_cortex_m3
This board is not being used or tested and does not actually
run on any hardware, remove it in favor of well supported boards
for this CPU.

Jira: ZEP-850
Change-Id: Ied681b6059ad74f9d019054292c919a9f938e7d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-22 22:09:33 +00:00
Anas Nashif
5363d14a9e boards: rename Quark SE Devboard to Quark SE C1000
This board now has an official name and will be available soon:

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/se-soc/overview.html

Jira: ZEP-758
Change-Id: Ia16d33722308cf81471321c3063bdc75055a4d50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:31 +00:00
Anas Nashif
5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Javier B Perez
5879f1702c samples: zoap server: exclude quark d2000 not enough ram
Excluded Quark D2000 because there is not enough RAM to
build the sample.

Change-Id: Icc772e0aaca2be8731eae8f986eed17782beb445
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-09-14 21:23:25 +00:00
Benjamin Walsh
c72acc9333 zperf_shell: add unified kernel string for unified kernel case
Change-Id: I61053d6aff6381eb32626b457da6ef5170ffc503
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Anas Nashif
884d9fb50f samples: zoap: build only for specified boards
Change-Id: I52e5dd0d638eb4582baf9bc7c8ce4d30b4d49733
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-12 19:53:15 -04:00
Vinicius Costa Gomes
8dad0093d3 samples/net: Add a sample for a CoAP client
Change-Id: I17d88081eb719e55d97a5a034f6861e01ebb6a52
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-09-12 12:25:25 +00:00
Vinicius Costa Gomes
97ea9b19ea samples/net: Add a sample for a CoAP server
Change-Id: Ibca646d9c9f85a14939e1cf488eee7a41f688fd2
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-09-12 12:25:25 +00:00
Flavio Santes
13a75b7e42 dns: Remove deprecated functionality
This commit removes deprecated APIs and replaces them with routines
that provide similar functionality without the flexibility originally
offered by the deprecated APIs.

Removing deprecated routines will help us to be prepared once the
new IP stack is ready (ZEP-793). Furthermore, this commit will also
help us to move our current DNS Client implementation to the lib/iot
directory, as specified by ZEP-847.

This commit removes the netz library from the DNS client sample
application. UDP functionality is replaced by primitive routines.
Specifically, the following changes are applied by this patch:

- Remove netz routines
- Remove app_buf data structure
- Introduce primitive data types in the DNS client code
- Introduce primitive network routines
- Add a header file containing configurable parameters

Jira: ZEP-793
Jira: ZEP-847

Change-Id: I0302133da77308f0cdd9ace2c0265e6b77673ff0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-12 02:15:44 +00:00
Jukka Rissanen
4a088a1259 net: apps: Example app for Trickle algorithm
This is only meant for Contiki based IP stack.

Change-Id: I53cbcb7da0bd13ad87243fd70974cec0bd31072e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-09-12 02:00:12 +00:00
Andrew Boie
e220bc543c samples: zperf: fix incorrect printk() usage
Change-Id: I0f7a9fcc6ed75013c388a14142aaad8e8243c8b5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Anas Nashif
47edaa343b net: For 15.4 sample, whitelist the supported boards
Jira: ZEP-739

Change-Id: I6c58b4b7dbd227364503023e7a443d2441a19701
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-08-25 06:06:52 -04:00
Flavio Santes
e288040b7b samples/net: Add KNOWN_ISSUES file for NATS and DNS sample apps
The KNOWN_ISSUES file describes issues and workarounds for the NATS
and DNS sample applications.

Change-Id: I9a33a82073707dbdd4109e0740108b99c42ad772
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-24 23:36:45 +00:00
Javier B Perez
8c55291e83 sanity: exclude boards for samples/net/test_15_4
Excluded Quark D2000, Nucleo F103RB, Olimexino STM32 for the
sample test_15_4. Boards doesn't have support for 15.4 neither
enough space.

JIRA: ZEP-738
Change-Id: I963509a77cdf6a8ff2efee2f2d4a498e3c07f9b5
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-08-24 10:53:38 -05:00
Andrew Boie
bc94f7c723 Revert "misc: Remove generic PRINT macros from net samples"
This reverts commit 4dc93fed2f.

Change-Id: I35f7e355f1b9cfcfdf933a26cc30e0f92680079d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:44 -07:00
Jaakko Hannikainen
db493450ac net: ip: Fix compiling with 15.4
Kconfig allows selecting NETWORKING_WITH_15_4_TI_CC2520 even if the
current board doesn't support it, and also selects it by default. This
breaks building the 15.4 sample with qemu_x86. Add a config option for
having CC2520 support and enable the choise only if it is available.

In addition, remove unused function from iee802154 code, as it now
fails the tests.

Jira: ZEP-697

Change-Id: Ib082f82acdd0f86d3306bbd3bb827f61b0fd0be1
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
2016-08-23 13:13:59 +00:00
Flavio Santes
74980d02f4 mqtt: Add KNOWN_ISSUES file
The KNOWN_ISSUES file describes the following:

- "Unable to connect" and timeout errors
- Publisher and Subscriber limitations

Jira: ZEP-428
Jira: ZEP-632
Jira: ZEP-669

Change-Id: I10591a1fd14bccbeb0b7f3876549d29ddf8ffd1f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-18 23:56:05 -05:00
Flavio Santes
29fc59e535 samples/net: Remove call to unref routine when net_send returns >= 0
According to last comments posted in ZEP-632, the unref routine must
be called only when net_send reports an error.

Jira: ZEP-632
Change-Id: I11553edf2c7d686c3e58617c2e05b6f18962955e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-18 16:08:11 +00:00
Andrew Boie
fee8fabf2b samples: net: zperf: build for sanitycheck runs
Change-Id: I147b042bac229472238d02233d1c220aa5c1b4b9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:53 -07:00
Andrew Boie
9d5941c843 samples: net: loopback_test: build for sanitycheck runs
Change-Id: I3d275d754860b2471b3531eaeb70b70bdf0759cb
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:53 -07:00
Andrew Boie
fc605405f9 samples: test_15_4: fix build warning
Change-Id: I10a6fc3f16da9f821a34d798fd00018bd662e41b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-12 22:57:57 +00:00
Ravi kumar Veeramally
c5c1ddcf7d net: samples: Fix Rx buffers count.
Incase of slip or ethenet use, if these is too much incoming data
current buffer count is not sufficient. Noticed with TCP client
and server example. So increasing it to avoid not enough Rx buffers
issue.

Change-Id: I6eef51c28c7c4751955aa4403122bf17d55ce12c
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-08-12 20:37:25 +00:00
Inaky Perez-Gonzalez
d7c37f6748 samples/net/loopback_test: fix testcase markup
The app has updated the text it prints (which we were looking for) so
this was causing a false negative.

Change-Id: I3223a0dec8e44b0f89caf73626ffff82d74ab24d
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-08-12 20:35:13 +00:00
Flavio Santes
d7555dbe21 samples/net: Update README file w.r.t compiler warnings
README files are updated to include information about the
warnings displayed by the compiler.

Applications affected: DNS, NATS and MQTT.

Jira: ZEP-681

Change-Id: I482c3bbf37c5d9af3bb43b7ef5e58957bac2852a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-11 17:43:16 +00:00
Ravi kumar Veeramally
5cabc0e048 net: samples: Fix RFC3849 address config option.
NET_TESTING_USE_RFC3849_ADDRESSES not defined as a Kconfig option.
Enable this in Makefile like this
ccflags-y +=-DNET_TESTING_USE_RFC3849_ADDRESSES=1 incase if you need
it.

Change-Id: I96b05d069cf5baa56cc27489b3c38b84412eec97
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-08-10 15:14:44 +00:00
Flavio Santes
b564ee6d76 mqtt: fix: Remove ping function call
Zephyr's MQTT does not implement a client's message queue.
So, a race-condition may be present when multiple messages are
received and processed.

We remove the pinreq function call to allow the mqtt_read function
to handle all the incoming messages.

CONFIG_IP_BUF_RX_SIZE is also updated to allow more messages to be
queued by the IP stack.

Jira: ZEP-669

Change-Id: Ie3ef55b17020e04c6540adf975a66fb004933914
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-10 14:41:00 +00:00
Flavio Santes
97e1beaf52 mqtt: fix: Eliminate redundant lines by using a common exit point
Use the goto statement to create a common exit point.
Remove redundant code when possible.

Change-Id: I2e22483c6fca4cb501b401164faf97d585ecec3c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-10 14:41:00 +00:00
Flavio Santes
f8b30eada7 mqtt: fix: pinreq handler function exit condition
The previous version of the pingreq handler function leaves
the semaphore blocked if an error condition is detected.

This patch solves the above described situation.

Change-Id: I4897609fae3f6523244892ae38ffdc5ae85f852d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-10 14:41:00 +00:00
Flavio Santes
a7362cf77f dns: FIX: use byteorder.h functions
The previous version of the DNS Client sample code assumes a
little-endian machine as a target. In this patch we use the byteorder.h
functions to handle the cpu to network order conversions.
Theoretically, this code must run on little and big endian machines.

Cosmetic changes are also applied to other files.

Change-Id: I2b47f6252fa070e0a0253666fde1785530d6aebf
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 23:15:50 +00:00
Flavio Santes
0aa191389c dns: FIX add README_API file and improve sample code
README_API file is added in this patch.

Inline code documentation is improved. More test domains are added.
The README file is also updated to reflect these changes.

Change-Id: Ie670a6559611c6a8d216470e245dbea48369696f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 23:15:39 +00:00
Flavio Santes
df22e226f0 mqtt: FIX: add unsubscribe function and update return codes
MQTT unsubscribe message was not included previously. See ZEP-623.
So, this commit adds the handling functions for the MQTT UNSUBSCRIBE
message.

MQTT high-level API return codes are now unified to only return:
- 0 on success
- -EINVAL when invalid parameters are received
- -EIO on network error

API documentation is also updated to reflect the previous changes.

Jira: ZEP-623

Change-Id: I04d65c303762ce2ecaca73a4f222f0b77fe70503
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 23:13:58 +00:00
Flavio Santes
5280beffab mqtt: FIX: add MQTT unsubscribe/pingresp handling functions
The UNSUBSCRIBE and UNSUBACK functions are added. These functions allow
to create the UNSUBSCRIBE message and to read the UNSUBACK message,
repectively.

Another function to create the PINGRESP message was also added.

Jira: ZEP-623

Change-Id: Ic055e5762051cc9fb5d59a19c6eb974e34014d7e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 23:13:58 +00:00
Flavio Santes
6503654e75 mqtt/subscriber: FIX: update README file
README file now has a Troubleshooting section. It could be useful during
tests.

Change-Id: I925812b9bd62ac00a2f404939c1c0b7d9cf4dfd2
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 23:13:58 +00:00
Flavio Santes
fb080a3211 mqtt: FIX: update sample code to include MQTT UNSUBSCRIBE message
This patch demonstrates how to use the MQTT UNSUBSCRIBE message.

The publisher application is updated to fix a typo.

Jira: ZEP-623

Change-Id: I2c302c9f9320687fc39f36726394417db89f06d8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 16:54:54 -05:00
Flavio Santes
dde410e2a6 mqtt: FIX: update hack to handle dummy packet for TCP connect
The zero bytes hack to connect was deprecated by last
commits, so now we send 1 byte initialized to 0 :).

Jira: ZEP-612

Change-Id: I372964bbb102811d33509ad9386d9b360032a180
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 16:53:32 -05:00
Flavio Santes
57cf077e9c nats: FIX: update hack to handle dummy packet for TCP connect
The zero bytes hack to connect was deprecated by last
commits, so now we send 1 byte initialized to 0 :).

Jira: ZEP-612

Change-Id: Ie9e65fad3945d0babc4287e287be3aa57d68ed5a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 20:50:20 +00:00
Flavio Santes
b0cd36040c nats: FIX: add README file
This patch adds a README file describing the known-limitations of our
implementation.

Change-Id: I174db79783861f145ae224eca86f3fe4968e0205
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 20:50:20 +00:00
Flavio Santes
9676df04d1 nats: FIX: homogenize return codes and update API documentation
This patch standardizes the return codes:
- 0 on success
- -EIO on network error
- -EINVAL if an invalid parameter was passed as argument or
   received from the server

API documentation is also updated to reflect those changes.

Change-Id: I076d195fde7c6b32b4a52454f312fb8cd8ce2332
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-05 20:50:19 +00:00
Juan Manuel Cruz Alcaraz
4dc93fed2f misc: Remove generic PRINT macros from net samples
Remove generic PRINT macros from net samples and replace
with SYS_LOG  module.

Jira: ZEP-240

Change-Id: I4bec179c99056cce41e1f3495c162f25c3cd2364
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-05 20:36:52 +00:00
Flavio Santes
e22df46b61 samples/net: Add network-related functions to MQTT Subscriber
Add TCP/IPv4 routines to this sample.

This MQTT sample code demonstrates how to implement an MQTT subscriber
application.

To build this sample, the Paho's MQTT Packet Library is required. See
the README file.

For network application development, see:

* samples/net/echo_server
* samples/net/echo_client

Change-Id: Ibeb175ee2c4594b8961c60f2a0d25296c238401c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-02 01:59:13 +00:00
Genaro Saucedo Tejada
67c465d2cc sys_log: replace old debug macros at ieee802154 driver
ieee802154 driver is now using new system log macros, update the
Kconfig variable to be a level rather than a bool and the .conf
files at samples.

JIRA: ZEP-311

Change-Id: I640e973d880c3a222cd7c13a72d35edf49ada3a8
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-08-01 22:03:45 +00:00
Flavio Santes
54bfc3cc63 samples/net: Add network-related functions to NATS Subscriber
- Add TCP/IPv4 routines to this sample.
- Add a testcase.ini file.

This NATS sample code demonstrates how to implement a NATS subscriber
application.

Change-Id: I25a7465b7163a09a0163859076a97b1e258a06f1
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-01 14:31:27 -05:00
Flavio Santes
8f54ece6e6 samples/net: Add network-related functions to NATS Publisher
- Add TCP/IPv4 routines to this sample.
- Add a testcase.ini file.

This NATS sample code demonstrates how to implement a NATS publisher
application.

Change-Id: Ifeac3bf03b7febafcee927b1d2ec256685885fd8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-01 14:21:51 -05:00
Flavio Santes
e240f84c75 samples/net: DNS client application
This sample code shows how to write a DNS client application.
Only client functionality is implemented in this sample.

The code is self-documented. Read the README file for more information
about the network setup.

See https://tools.ietf.org/html/rfc1035 for more information about the
DNS protocol.

Origin: Original

Jira: ZEP-500
Jira: ZEP-501

Change-Id: Ibcfa4e392143fdc2258971304d5296d70c1c9423
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-01 18:54:07 +00:00
Flavio Santes
8ba4f26e5f samples/net: Add network-related functions to MQTT Publisher
Add TCP/IPv4 routines to this sample.

This MQTT sample code demonstrates how to implement an MQTT publisher
application.

For network application development, see:

* samples/net/echo_server
* samples/net/echo_client

Change-Id: I13ac5ca1da2cd4d984fb595b599c3eab4edc5bf0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-08-01 18:28:38 +00:00
Sergio Rodriguez
259c24397d samples/net : Adding mbedTLS sample client
This is a client that uses shared keys to execute a TLS handshake and read
info from the server, information on how to run the test is in the README
file.

Jira: ZEP-327
Jira: ZEP-340
Jira: ZEP-495

Origin: https://tls.mbed.org/download/start/mbedtls-2.3.0-apache.tgz

Change-Id: I10f31f3635f346936807b7c8470b3d6ffb3af283
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-07-31 17:00:45 +00:00
Flavio Santes
f61574eef7 samples/net/mqtt: Update README file for Debian/Ubuntu users
Debian and Ubuntu distributions come with an old version of the
mosquitto server that does not support MQTT 3.1.1.

So, the MQTT applications' README file is updated with this
information.

Change-Id: I1c76c757b5a15aa2bdd192bd912835a417cb0031
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-29 19:14:42 +00:00
Flavio Santes
4172b3afab samples/net: Add a NATS subscriber application
This sample code demonstrates how to write a NATS subscriber
application. Code is self-documented and a README file is also
included.

This sample code uses the netz API.

The NATS protocol specification is available at:
http://nats.io/documentation/internals/nats-protocol/

Origin: Original

Jira: ZEP-415
Jira: ZEP-573
Jira: ZEP-597

Change-Id: I4b7e56bb6c2a934012b33039ea5b313b14f3b4c5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-28 15:40:46 +00:00
Flavio Santes
78aa6ea050 samples/net: Add a NATS publisher application
This sample code demonstrates how to write a NATS publisher
application. Code is self-documented and a README file is also
included.

This sample code uses the netz API.

The NATS protocol specification is available at:
http://nats.io/documentation/internals/nats-protocol/

Origin: Original

Jira: ZEP-415
Jira: ZEP-573
Jira: ZEP-596

Change-Id: Ieb6e6e5f9bd48f34246b6d8c1bd9af3bbbe016bb
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-28 15:40:26 +00:00
Flavio Santes
bbd4d4cb1f samples/net: MQTT subscriber with QoS
This sample demostrates how to write a subscriber application that is
able to receive messages with different Quality of Service values.

The code is self-documented. Read the README file for more information
about the network setup.

This sample code uses the Network for Zephyr API (netz).

More details about MQTT can be found in the official documentation:
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html

Jira: ZEP-416
Jira: ZEP-568
Jira: ZEP-573
Jira: ZEP-594

Change-Id: Ia660313439c0c61c2210abbf8ce09ff278d11a1a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-28 15:37:24 +00:00
Flavio Santes
cc2804f2b6 samples/net: MQTT publisher with QoS
This sample demostrates how to write a publisher application that is
able to send messages with different Quality of Service values.

The code is self-documented. Read the README file for more information
about the network setup.

This sample code uses the Network for Zephyr API (netz).

Old mqtt applications (paho_mqtt_client and paho_mqtt_shell) are now
deprecated.

More details about MQTT can be found in the official documentation:
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html

Jira: ZEP-416
Jira: ZEP-568
Jira: ZEP-593
Jira: ZEP-573

Change-Id: I31f8a01e143e5d446f2fb4055c1cacb9d7174517
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-28 15:37:11 +00:00
Andrew Boie
18aac630ef Revert "samples/net: Add netz_client sample code"
This reverts commit a3c0b2c00f.
The status of the 'netz' library is still under
consideration.

Change-Id: Ifde93465da306d86aec8a71d02a16653eb7cef9c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-28 07:33:11 -07:00
Kumar Gala
62ca7ef1fc samples/net: Fix typo in comment
Fix comment that had CONFIG_MICROKERNE should be CONFIG_MICROKERNEL

Change-Id: Ic7ad63350abe92e9f1b84f4de0d6d3bb1b43dc77
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-27 16:20:55 +00:00
Flavio Santes
a3c0b2c00f samples/net: Add netz_client sample code
This sample code demostrates how to use the netz API. A basic
IPv4/TCP/UDP client application is provided.

The README file describes the basic setup.

Origin: Original

Jira: ZEP-567
Change-Id: I1c7d2454336dc00747044c5fc330f9ab6457ecf1
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-07-27 14:45:32 +00:00
Inaky Perez-Gonzalez
eb2d8b418c testcases: add automation markup to samples/
Code in samples does not follow an standarized format for reporting
success or operation failure -- thus we use markup (in file sample.tc)
to specify what shall be found in the console to consider execution a
success.

There is a few functional code modifications that add/extend console
messages so verification is possible or easier:

 - hello_world, synchronization: extend the success message to also
   print which core is running the testcase

- pci_enum: print message on success.

Change-Id: Idb6cea03adebe97d97854603f963f4e3d4cb856a
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-26 08:32:24 +08:00
Inaky Perez-Gonzalez
3e63a74514 net/yaip: revert merge
Follow up to TSC decission for further discussion in the networking
WIG.

Change-Id: I148b484dfe308661573e47ed3e60cceed673bddf
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-22 04:43:09 +00:00
Tomasz Bursztyka
bb1fe0c147 net: yaip: Make net_core.h include the least amount of necessary header
net_core.h is the ground brick of the IP stack, and thus should not
include other headers that might include net_core.h also: this would
create circular dependencies.

Change-Id: I70c17b736788528e4e0b4b5b2c478098b049c9b1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-13 14:06:19 +00:00
Jukka Rissanen
1145bd43a1 net: yaip: Setting static IP addresses for echo-server
Makes it possible to test things between qemu and host when
using slip.

Change-Id: I27e17de9f0d8c2c8406f0afdd66c295e827f87a0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:14 +00:00
Jukka Rissanen
8a9f8d17b9 net: yaip: Make echo-server to use documentation IPv4 addresses
Use 192.0.2.0/24 address space specified in RFC 5737.

Change-Id: Iff2545f5b0f4817c99813c986d57801e166967a3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-13 14:06:09 +00:00
Jukka Rissanen
fbb940d9f0 net: yaip: Receive IPv4 packet
Check if we have received IPv4 packet and call a handler
function to process it.

Change-Id: I9f9e5f0888d2c3b91401c98f4925647ddce09962
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 19:20:50 +00:00
Jukka Rissanen
cba9d3096c net: yaip: apps: Create a skeleton echo-server for new IP stack
This echo-server does not yet do anything useful.

Change-Id: I317051b3a2bfb0a80584ad385c2f308978a243cd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:21:03 +00:00
Javier B Perez
22c68169fd samples: testcases.ini change tags separated with commas
Tags should be separated with spaces no with comma.

Change-Id: I5381200bcd0caf59f3601ec849d698966c734a28
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-07-08 18:20:08 +00:00
Kumar Gala
7dcbbc39e7 build: move from srctree to ZEPHYR_BASE for app include paths
$srctree for the application might not be set to be $ZEPHYR_BASE, use
$ZEPHYR_BASE instead to be more explicit in the build.

Change-Id: Iefa5ff59f246b584949329044f7a6531adc6ed62
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-30 14:36:39 +00:00
Fabrice Olivero
c66ed19dea samples/net/zperf: add task profiler support
Change-Id: I199e4b5aca0b0793e18149a758c430d01b5aabd4
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-06-16 18:10:29 +00:00
Ravi kumar Veeramally
5d98ba37f6 net: apps: Fix ip buf application data length
ip_buf_appdatalen is not set while sending buffer.

Fixes: RTOS-1562

Change-Id: Id423ba5898b9b405d0ca027a74a06a19708841fe
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-06-09 08:53:16 +00:00
Luiz Augusto von Dentz
f6dd1e4144 Bluetooth: Add support for using SYS_LOG
This add CONFIG_BLUETOOTH_DEBUG_LOG which depends on SYS_LOG since the
later can actually use either CONFIG_PRINTK or CONFIG_STDOUT_CONSOLE.

Change-Id: Ib2974d1331f6c91d119a218ec95e8bf01069377b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-01 05:04:10 +00:00
Flavio Santes
65ccf8330f samples/net/mqtt: Fix mqtt_connect function
Remove erroneous initialization of 'data' via memset.
Set keep alive interval to 0.

Change-Id: I5da4649985efd39b37bbbdc6ae21a856f9e40b13
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-31 11:22:01 -05:00
Flavio Santes
0224e3577e samples/net/mqtt: Add a MQTT interactive shell
Add a MQTT interactive shell that can connect, disconnect, subscribe,
publish, read published messages and ping to the MQTT gateway.

Origin: Original

Jira: ZEP-364
Change-Id: Ie85e7b8b9290cb8e80548886aea74a8427b2323b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-30 20:23:53 -05:00
Flavio Santes
4a320be8a2 samples/net/mqtt: Reduce tx/rx buffer size and update mqtt_publish_read
Set CONFIG_IP_BUF_RX_SIZE and CONFIG_IP_BUF_TX_SIZE to 4.
Modify mqtt_publish_read to retrieve topic name and message as strings.
Change printf for printk.

Change-Id: I6746846cb3359096d87dfbb3134d6a3a95bf087e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-30 17:26:02 -05:00
Flavio Santes
2df4a0f9e2 samples/net/mqtt: Update README file and code cleanup
Add instructions to download Paho's MQTT Library.
Simplify if statement.

Change-Id: Iba500c47a56896f9c9b726751933443a5318ced7
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-30 10:11:38 -05:00
Flavio Santes
f194272c41 samples/net/mqtt: MQTT publisher and subscriber
This sample shows how to integrate Paho's MQTT Packet Library to create
a MQTT publisher and subscriber application with Zephyr.

Change-Id: I1cb4124386752eef6187a56ccc9f6fd7fe7175a3
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-29 22:24:26 +00:00
Ravi kumar Veeramally
6a9817a091 net: apps: Add DHCP client sample application
Change-Id: I9c3f317fb13bce56ee93d66d692618145087a6a9
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-05-27 11:09:31 +00:00
Ravi kumar Veeramally
2c6de48374 net: apps: Provide pcap support for echo apps
Provide pcap support for echo-apps with PCAP=<filename> option.

For pcap support:
make server NET_IFACE=qemu PCAP=sample.pcap.

without pcap support:
make server NET_IFACE=qemu

Change-Id: Iad90064e0c32134f9c2fda7b28e2cbca1e4e931c
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-05-27 13:13:47 +03:00
Jukka Rissanen
2dab1d7371 net: apps: Ignore multicast context get fails in echo-server
The echo-server should work just fine even if the multicast
context cannot be get. By default there are only two contexts
so the multicast would fail always anyway and the program
would not run properly.

Change-Id: Ia9737cbda4a933a208aae020f055f0b6062b4f47
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-05-27 06:15:22 +00:00
Jeremie GARCIA
9891d1e12b net: apps: zperf - add TCP client
Change-Id: I292e03c28169ca05f6b982a36be2ed618f8455bb
Signed-off-by: Jeremie GARCIA <jeremie.garcia@intel.com>
2016-05-26 00:47:01 +00:00
Luiz Augusto von Dentz
7941630e17 console: shell: Add return to command callback
This enable checking for errors and automatically print help string:

btshell> connect
connect <address: XX:XX:XX:XX:XX:XX> <address type: (public)>

Change-Id: Ie097ecddb72ab15bf6192e310d0bd839bfd251d5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-23 11:00:21 +03:00
Sebastien Griffoul
818875f364 net:apps: Add ipv6 support for zperf
Update the zperf app in order to support ipv6.

Change-Id: I137af07bbd739cf4bfe60bd13bdb06cf939c6c55
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
2016-05-17 20:13:13 +00:00
jgarcia
1ebed467bf net:apps: zperf - add TCP server
This patch adds the TCP server capability
to zPerf tool.

Change-Id: I8e4d92b10079a7c4b4bddab8d78655031ca6125c
Signed-off-by: jgarcia <jeremie.garcia@intel.com>
2016-05-17 20:09:06 +00:00
Jukka Rissanen
1f10410076 net: apps: Add IPv4 client support to echo-client
Change-Id: Ic879b64f22e0a2a1edbeaa1a6315a605993a09a4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-05-17 09:57:29 +03:00
Jukka Rissanen
7bb3f2e01a net: apps: Add TCP client support to echo-client
The echo-client can now initiate a TCP connection.

Change-Id: I8223ef377127319dd1791497675a4abe8b382365
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-05-17 09:57:28 +03:00
Jukka Rissanen
d57c2d35df net: apps: Quit echo-client if TCP connection fails
If the active connection to another TCP host fails, then
quit as it is no point continuing.

Change-Id: I21317d7062d4ac93c342834a2503139fe27076e7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-05-17 09:57:28 +03:00
Jukka Rissanen
0a12b4768c net: apps: Add TCP support to echo-client application
If TCP is activated, then the echo-client application opens
a TCP socket and starts to send data to server. For TCP
connections, the application data is not reversed because
it would make it difficult to verify the data in the sender
side.

Change-Id: I35306b8ecd6794365086a23bf6a17f5103d7ac80
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-05-17 09:57:28 +03:00
Flavio Santes
7e32716d25 samples/net/loopback: Add helper functions to handle app data
Add two helper functions to simplify the use case.
Add comments to clarify the use of the networking API.

Change-Id: I60c58296b77d724b7094b90e153b50dfc0b58135
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-16 14:54:24 +00:00
Flavio Santes
e5d0b8f93e samples/net/zperf: Delete symbolic link
Remove the symbolic link.
Update the Makefile.
Rename README as README.rst and restructure its content.

Change-Id: Ic74e91749fc0bbf728e528b49e99a87188f84e6d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-15 01:16:55 +00:00
Anas Nashif
f62d86c42b samples: get rid of obsolete usage of ARCH variable
Using ARCH variable to select different configurations for the different
architectures is misleading and conflicts with the variable ARCH being used by
the build system.  The variable is not needed, it is application specific and
an application can be built without the need to specify ARCH on the command
line.

This is yet another item specific to samples and test cases that
wrongfully being used and documented for every application.  We need to use
another variable and just make it clear it is specific to samples and how they
are written.  One possible solution is to have a script that gets the
architecture based on the board being used.  Attachments

Jira: ZEP-238
Change-Id: Ieccbc087a41858fb96fb361c0aaa04705e968a4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:28 +00:00
Flavio Santes
05bd623aa1 net: apps: Break long strings in loopback test
Use string literal concatenation to break the sample text.

Change-Id: I0729b113e80d3efec909603fbb143d1bc515f165
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-04-26 08:09:01 +00:00
Jukka Rissanen
cdb296a51f net: apps: Set IPv4 configuration when doing automatic testing
Set the IPv4 address, netmask and default router addresses
that are used for automatic testing.

Change-Id: Iebddc42c56dceeb089af7878102f8a73c30f0b74
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
7e91a42ced net: apps: Fix IPv4 support in echo-server
The IPv4 address is set properly for testing purposes.

Change-Id: I996e7435276f65dbb642aa9ab99c37cd842d4b39
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
74d6563627 net: apps: Add TCP support to echo-server application
If TCP is activated, then the echo-server application starts
to listen TCP socket and reply data to caller. For TCP
connections, the application data is not reversed because
it would make it difficult to verify the data in the sender
side. The TCP packets might be split into smaller chunks by
echo-client so client would have some unnecessary difficult
to verify the data it sent if we reverse it.

Change-Id: Ic146dfc75825bc8057968c581bfe9d3285e0d7b4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:34 +03:00
Jukka Rissanen
ad2e661569 net: Enable TCP support
User can enable TCP server (listening socket) support in the
IP stack. This commit does not yet have TCP client (connecting
socket) support.

Change-Id: I75dd02a81addc1d1e026463b53631d56378157df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-25 09:40:32 +03:00
Johan Hedberg
560956c54d Bluetooth: Kconfig: Split debug selection into a choice
This prepares for adding other debug types besides the printf-style
logging to the console.

Change-Id: Ic2ed305192491734da991c4f61fdaace03fd60f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-20 17:46:09 +03:00
jgarcia
7b8d89d921 net:apps: zperf application
zperf is a network traffic generator for Zephyr.
Same application is able to work dynamically in client or server mode.
It allows to assess network bandwidth.
zperf is compliant with iperf_2.0.5.
zperf can be run in micro or nano kernel.

Change-Id: Icbd69e1ad56ad29c678b098e7a2e07c44f90e48e
Signed-off-by: jgarcia <jeremie.garcia@intel.com>
2016-04-18 06:07:02 +00:00
Tomasz Bursztyka
af33e21017 net: Test random is necessary to use CC2520 as radio driver
It will not build without it. Generalize it then.

Change-Id: I334586f629de1f057e654a13a1c705cd559b44d8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-14 07:49:22 +00:00
Ravi kumar Veeramally
61372c4ece net: apps: Move Makefile.ipstack to common folder
Makefile.ipstack is more generic to net applications which
communicate through slip or between two qemus. So net apps
common folder is right place for it.

Change-Id: I57ca1eeaff28b853609daf92772361406131aa7e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-16 11:40:17 +00:00
Ravi kumar Veeramally
b19f7fe5f4 net: apps: Add prj_qemu.conf files for dtls apps
Add prj_qemu.conf files for dtls_server and dtls_client. Now
it can be tested between two qemus running 802.15.4 dummy driver.

Change-Id: Id94492f90539025854063662c2f0750a0b9ca845
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-16 11:39:06 +00:00
Jukka Rissanen
c07ac4d072 net: apps: Change dtls-client to use common testing header file
Move network testing setup from dtls-client to common net_testing.h
file which makes the application much simpler.

Change-Id: I5a727325c22f98170f12620629898e5ed052b707
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-14 15:11:46 +00:00
Jukka Rissanen
8399fc4b3d net: apps: Change dtls-server to use common testing header file
Move network testing setup from dtls-server to common net_testing.h
file which makes the application much simpler.

Change-Id: Iacd99917cda3efc4cd92d0f48a8cbbc259ef7a84
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-14 15:11:23 +00:00
Jukka Rissanen
d8c495f24b net: apps: Fix connectivity between echo-server and client
If the echo-server and echo-client are run in real hw, then
we need to add the used IPv6 prefix to the system. Otherwise
the client is not able to send anything because there is no
route to 2001:db8::/64 network that is used in these examples.

Change-Id: I3a00b77acf1329b3e448bd62ec38cc408c0bd086
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-14 15:11:23 +00:00
Ravi kumar Veeramally
a77ab4f4e2 net: apps: Update CoAP apps to use net_testing header file
Update CoAP apps project configuration files and also update
according to common net_testing header file.

Change-Id: I09294dfd71e3d0cac980be4ae6d142cc3a59d85c
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-14 16:11:51 +02:00
Jukka Rissanen
b650e8edb1 net: apps: User can set the loopback test count
User can set the desired number of network packets that are
sent. There is an example config that sends 10000 packets
and then stops the test application.

Change-Id: I5aa9049236f7bebdc9ea9997b9eb1f672c6adcbf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-14 12:45:07 +00:00
Jukka Rissanen
b8f28079ec net: apps: Fix the loopback test application
The loopback test application works now and it verifies that
the data sent is the same as data received. This fixes the
issue described in bug ZEP-101.

Change-Id: I1babfab4db9d4df0e769711aa41983366a8b5065
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-14 12:44:58 +00:00
Luiz Augusto von Dentz
1d523c3faf Bluetooth: IPSS: Move sample service to gatt
This moves IPSS sample code to samples/bluetooth/gatt which shall become
the default place for GATT related samples that can be reused.

Change-Id: I04089f6e43bfcc30ee1c7cc766620f19e3dad08e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-03-11 11:29:13 +02:00
Jukka Rissanen
efe0d36c7d net: apps: Change echo-client to use common testing header file
Move network testing setup from echo-client to common net_testing.h
file which makes the application much simpler.

Change-Id: Ib1a90b9d87014b7f9adc5f6865ce0fc9faa13422
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-11 07:26:12 +00:00
Jukka Rissanen
ed4f794ac8 net: apps: Change echo-server to use common testing header file
Move network testing setup from echo-server to common net_testing.h
file which makes the application much simpler.

Change-Id: I6f68826916c870ad7db597d30f20245bada70091
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-11 07:26:12 +00:00
Jukka Rissanen
b3c8b5fa19 net: apps: Common routines used in qemu testing
Collect common routines used in every network sample application
into same file. These routines are used when testing with
qemu and slip.

Change-Id: I02f20b3a9bfa1e886846801b22f43a1d06c59930
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-03-11 07:26:11 +00:00
Ravi kumar Veeramally
325eb61a6d net: apps: Add qemu support without monitor tool
Echo-server and client will exchange data without monitor
tool support.

Change-Id: I3cf73a4baf025bf7e5fc634bef696d5f0e6b4c57
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-09 08:36:46 +00:00
Ravi kumar Veeramally
fe67b69cd0 net: apps: Add separate prj_qemu.conf for board type qemu
Add separate prj_qemu.conf files for qemu_86 board type. Also
remove set_options from Makefile.ipstack which is not required now.
Now build the echo-server with "make server NET_IFACE=qemu" and
echo-client with "make client NET_IFACE=qemu" command options.

Change-Id: I1f3c9c6a198f2b6cae54ae4a5da970b284ef84de
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-03 07:17:30 +00:00
Ravi kumar Veeramally
4e2023c663 net: apps: Fix echo apps Makefile
Add bt related qemu flags only when BT is enabled.

Change-Id: Idc611dcf7726829ed77c3f4898abd794a825212f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-03-03 07:17:29 +00:00
Luiz Augusto von Dentz
0401d5a54a net: dtls_server: Add support for Bluetooth
This enables using dtls_server with Bluetooth by passing
CONF_FILE=prj_bt.conf, it is also enabled for testing so changes to
dtls-server are actually tested with NETWORKING_WITH_BT.

Change-Id: Ice4f409c8e2d9e97856159482969f6352264864b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-29 13:03:35 +00:00
Luiz Augusto von Dentz
758b159120 net: dtls_server: Avoid using #ifdef and #ifndef
It is prefered to use #if (!)defined form for checking defines since it
can actually check more complex conditions.

Change-Id: Ia8ab6898d340967759a8ecbda65c4bcacdc0293e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-29 13:03:20 +00:00
Luiz Augusto von Dentz
f32a837c9b net: coap_observe_client: Add support for Bluetooth
This enables using coap-observe-client with Bluetooth by passing
CONF_FILE=prj_bt.conf, it is also enabled for testing so changes to
coap-observe-client are actually tested with NETWORKING_WITH_BT.

Change-Id: I02705f855c1974b065557986f9b231201ba310a7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-29 13:03:08 +00:00
Luiz Augusto von Dentz
86a4eeb740 net: coap_observe_client: Avoid using #ifdef and #ifndef
It is prefered to use #if (!)defined form for checking defines since it
can actually check more complex conditions.

Change-Id: I80b97d51cb321d84df417f8722e661d944504d4f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-29 13:02:52 +00:00
Luiz Augusto von Dentz
59fa70e8ff net: coap_server: Add support for Bluetooth
This enables using coap_server with Bluetooth by passing
CONF_FILE=prj_bt.conf, it is also enabled for testing so changes to
coap_server are actually tested with NETWORKING_WITH_BT.

Change-Id: I58b286520da0e0e4cba77dd52ea3f64f0268582a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-29 13:01:34 +00:00
Luiz Augusto von Dentz
c21de2eeb5 net: coap_server: Avoid using #ifdef and #ifndef
It is prefered to use #if (!)defined form for checking defines since it
can actually check more complex conditions.

Change-Id: I2080377b4b95e9d973e8c0753ae66dba151372e6
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-29 13:01:22 +00:00
Luiz Augusto von Dentz
ccb00e01b0 net: echo_client: Add support for Bluetooth
This enables using echo_client with Bluetooth by passing
CONF_FILE=prj_bt.conf, it is also enabled for testing so changes to
echo_client are actually tested with NETWORKING_WITH_BT.

Change-Id: I1ff83a9d0049e121dc7e406656e3282b16ee8c91
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-23 18:08:21 +00:00
Luiz Augusto von Dentz
fb568ac6a9 net: echo_client: Avoid using #ifdef and #ifndef
It is prefered to use #if (!)defined form for checking defines since it
can actually check more complex conditions.

Change-Id: Ib8779a344a1a7ec02f10b0e23a533c78e68343b5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-23 18:07:53 +00:00
Jukka Rissanen
79932abdb7 net: apps: Fix the mac addresses in dtls client demo
Change-Id: Iec0e0d716f7aa718134167ac43b014ef95d7e67b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-19 12:38:48 +00:00
Jukka Rissanen
dccce8fab6 net: apps: Make dtls server/client to accept different bearer config
User can now say "make BOARD=xxx NET_IFACE=802154" to compile
IEEE 802.15.4 support into the dtls server/client application.
The default is to compile for qemu and use slip.

Change-Id: I87f9b2d766cc5337a9c01c7657fb8d08d2d3e244
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-19 12:38:25 +00:00
Jukka Rissanen
04ef24d21b net: apps: Comment out code if IPv6 ND is in use
If neighbor discovery is in use, then we do not need to do
various route etc setup. Normally ND needs to be active
but in some specific scenarios it can be turned off. One
such scenario is if an application is run inside qemu
which uses slip and host tun0 interface for communication,
in this case host typically do not activate ND for tun0
so we need to disable it also in zephyr side.

Change-Id: I8ac59990c5bbcdb06cca98bde7be3a0ad6e807a8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-19 12:36:28 +00:00
Jukka Rissanen
e0f966de10 net: apps: Rename application init function
Rename application init function to init_app() so that it is more
descriptive.

Change-Id: Id470756345c0bd10b103270115b26f3e8a281d17
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-19 12:35:52 +00:00
Jukka Rissanen
3571e1f20a net: apps: Use IPv6 link local addresses in network apps
Use link local addresses instead of public IPv6 addresses
in the demo applications. This way the application do not
need to do any special setup.

Change-Id: I9aa817c388e3f673a6597801813dd1d0a8feb6b5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-19 12:35:12 +00:00
Jukka Rissanen
1b4271baef net: apps: Fix style issue
Add spaces after a list of values as required by checkpatch script.

Change-Id: I04bd8af8195e3966fd2b9c36ead49483030eae18
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-18 12:51:27 +00:00
Luiz Augusto von Dentz
ce83b0f955 net: echo_server: Add support for Bluetooth
This enables using echo_server with Bluetooth by passing
CONF_FILE=prj_bt.conf, it is also enabled for testing so changes to
echo_server are actually tested with NETWORKING_WITH_BT.

Change-Id: I1d949798c7a9689ebc2d342ae7342dce32f319e5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-18 12:16:19 +02:00
Luiz Augusto von Dentz
53dbe52f7d net: echo_server: Avoid using #ifdef and #ifndef
It is prefered to use #if (!)defined form for checking defines since it
can actually check more complex conditions.

Change-Id: I59c6fff1f2d4e950f9ae64adb9f8833ef0fea4d0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-18 12:16:18 +02:00
Jukka Rissanen
a63f175d44 net: apps: Resend failed message once in echo-client
If the reply for a sent message is not received, then try
to send it once again. If the second resend fails, then mark
the packet as failed.

Change-Id: Ibe9b9384e2e84f055c6486a5bd4d7293675e5d42
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-17 13:07:54 +00:00
Jukka Rissanen
feff518981 net: apps: Disable multicast sending in echo-client
In order to test unicast sending properly, disable multicast
sending temporarily.

Change-Id: If90acf003910a954770caa53825116d2a9ddadc1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-17 13:07:18 +00:00
Jukka Rissanen
36605e6182 net: apps: Make sure CoAP server works with IPv6 ND
Fixed the IPv6 address handling so that CoAP server works
with default settings when IPv6 neighbor discovery is enabled.

Change-Id: Idd0b0df61aaebed43a9c5a408a192add445cacfe
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-12 15:36:55 +00:00
Jukka Rissanen
5c72abe769 net: apps: Make CoAP server to accept different bearer config
User can now say "make BOARD=xxx NET_IFACE=802154" to compile
IEEE 802.15.4 support into the CoAP server application.
The default is to compile for qemu and use slip.

Change-Id: I2c61ac91d4ae7b2c3611567646028bc751e0419e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-12 15:27:44 +02:00
Anas Nashif
3bf7ee01ea net: apps: Move net samples to one directory instead of per kernel
Consolidate networking tests into 1 directory where possible and put
files under samples/net where possible.

Change-Id: Ieb65e000e1717f4d53058f87e36840a0786d467b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Jukka Rissanen
1fe7ae910a net: apps: Remove obsolete listener application
Change-Id: If26ed436211b40a009f60275ef64bfc9de5da066
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Anas Nashif
74df249dd8 move net/buf test under tests/
This test should be under tests and is not a sample.

Change-Id: Ibb42207f72554516a650625a2cf4cc9cb7a0b021
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00
Jukka Rissanen
bef69b7b96 net: apps: Add the non link local IPv6 address in routes
For this demo app, set the 2001:db8::/64 address in routing
table. This way we will be able to pass data using these
addresses. Something like this should not be done in real
networking environment.

Change-Id: I1764d5ae09ab95dd580c6b48d6f368bfe283a6a3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
5e16d7a355 net: apps: Make echo-client to timeout packet receive
The echo-client will timeout the packet receive after 5 seconds.
This way we at least send something instead of waiting forever
if the packet is lost.

Change-Id: Idc332965786797df4ed04dc8b3ef49af32a3f436
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
9e79aa6f9d net: apps: echo-server refactoring to work in microkernel
The echo-server uses only one code base for both microkernel
and nanokernel.

Change-Id: I7abdf76dc13c31e4f91d0fd9d3b870ffe20ac71b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
40bef01a5f net: apps: echo-client refactoring to work in microkernel
The echo-client uses only one code base for both microkernel
and nanokernel.

Change-Id: Ieaf9a969319537286181ba333e3a05bfa0e9363a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
de767512d7 net: apps: Refactor echo-client compilation
Separate setup for different low level bearer. By default the
Makefile will create version suitable for qemu testing using
slip. If one writes "make NET_IFACE=802154" then IEEE 802.15.4
radio specific settings are activated.

Because echo-client does not contain any processor specific
settings, remove the ARM config files and rename the x86
specific ones.

Change-Id: I0608b6172bdd044dd49dedf86477ef8a31391a23
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
396766531e net: apps: Refactor echo-server compilation
Separate setup for different low level bearer. By default the
Makefile will create version suitable for qemu testing using
slip. If one writes "make NET_IFACE=802154" then IEEE 802.15.4
radio specific settings are activated.

Because echo-server does not contain any processor specific
settings, remove the ARM config files and rename the x86
specific ones.

Change-Id: I2caf26979f32496c6efb4dd1f625a60e3e5f6744
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Ravi kumar Veeramally
a4963cea35 net: apps: Update echo-server and echo-client IPv6 address
Address configurations for different Kconfig options is difficult
to test under different environments. Make it simple at the moment.

Change-Id: I689649b11b4ccb1cf1ff0e90720fa03b6dc3656b
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:25:32 -05:00
Ravi kumar Veeramally
838961af9a net: apps: Modify echo-client to send data only after reception
Modify echo-client to send packet after packet received from
server and wait unlimited ticks. Current behaviour flood messages
to server irrespective of reception at server end. Modified
behavior only for nanokernel at the moment.

Change-Id: I6aa20c5b9fc9d6d1cf8f996e90735f5d2b986e5a
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
6956fe1670 net: samples: Fix echo-client compile error for microkernel
Change-Id: Id1a40244543744b60971dd6321edf1aadd02108a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Ravi kumar Veeramally
0a97b09b0e net: samples: Fix BOARD to qemu_x86
Emulation is not supported on basic_minuteia, only qemu_86
supports emulation.

Change-Id: Id1adc6db02aa22c86207db77fb16ac7548e09dac
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:25:18 -05:00
Peter Mitsis
d63a4f7bf7 nano_timers: Simplify nano_xxx_timer_test() API family
Simplifies the nanokernel timer API so that the timeout parameter must be
specified when invoking nano_isr_timer_test(), nano_fiber_timer_test(),
nano_task_timer_test() and nano_timer_test().

This obsoletes the following APIs:
	nano_fiber_timer_wait()
	nano_task_timer_wait()
	nano_timer_wait()

Note that even the though the new API requires that the timeout parameter
be specified, there are currentl only two acceptable values:
	TICKS_NONE and TICKS_UNLIMITED

Theoretically, the current implementation would allow one to supply a
finite positive value for the timeout and the system would wait up to
that many ticks for the timer to expire. However, it is thought that
that unnecessarily complicates the nanokernel timer model and so it is
left as an unsupported option.  Should that change, then that feature
could be enabled by updating the documentation.

Change-Id: I8835c5342ab5025d6f70fdfbed54a50add7568d7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:15 -05:00
Peter Mitsis
54b782a88b nano_sema: Simplify nano_xxx_sem_take() API family
Changes the nanokernel semaphore API so that the timeout parameter must be
specified when invoking nano_isr_sem_take(), nano_fiber_sem_take(),
nano_task_sem_take() and nano_sem_take().

This obsoletes the following APIs:
	nano_fiber_sem_take_wait()
	nano_fiber_sem_take_wait_timeout()
	nano_task_sem_take_wait()
	nano_task_sem_take_wait_timeout()
	nano_sem_take_wait()
	nano_sem_take_wait_timeout()

Change-Id: If7a4bce1bd8ec8d6410d04f3c16ff1922ff0910e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:14 -05:00
Anas Nashif
10bb38c186 Use SoC instead of platform.
Change terminology and use SoC instead of platform. An SoC provides
features and default configurations available with an SoC. A board
implements the SoC and adds more features and IP block specific to the
board to extend the SoC functionality such as sensors and debugging
features.

Change-Id: I15e8d78a6d4ecd5cfb3bc25ced9ba77e5ea1122f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif
dcf046c72d rename basic_atom with minnowboard
Use a real board name that can run this kernel instead of a generic
name. Basic functionality exits on this board with Zephyr.

Setup of the board is mostly similar to what we have in galileo (EFI
based)

Change-Id: Ic8554f26dcac0dbbbb6d35d863482f6207dc63c5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif
c740608ce5 Use BOARD instead of PLATFORM_CONFIG
Change-Id: I14db0087cd705df0db8a911071bc3949b5c79314
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Peter Mitsis
40eba989e2 semaphore: Simplify task_sem_take() API family
Changes the semaphore API so that the timeout parameter must be specified
when invoking task_sem_take() thereby obsoleting the following APIs:
	task_sem_take_wait()
	task_sem_take_wait_timeout()
	_task_sem_take()

Change-Id: I746d5c966a3b81ffe014333af51aa10ea8a63263
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Anas Nashif
f6f81868f8 build: Remove PROJECTINCLUDE from application makefiles
PROJECTINCLUDE is not required in app makefiles.

Change-Id: I3751b7c51c453dfe47d207bb11d171138668c4e7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:04 -05:00
Sergio Rodriguez
2e2ad8166e qemu: Creation of QEMU specific platforms
Setting up new platforms to handle emulation, and make them the only
ones able to run on QEMU from the Makefile "qemu" target to avoid
confusion with other platforms. We have now platform qemu_x86 and
platform qemu_cortex_m3, also modification to the sanity checks to have
qemu support only on those platforms

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I9291918a1d58fea4f37750ada78234628f9a5d98
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:56 -05:00
Jukka Rissanen
36c372d8cd net: 802.15.4: Loopback test app needs bigger TX fiber stack
Because of the way the loopback tester works, it needs much
bigger stack when sending packets in TX fiber.

Change-Id: I360f0cf1f35e654cb139565f19f24628fb5ab5ee
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:51 -05:00
Ravi kumar Veeramally
ef017fe761 net: apps: Fix incorrect ip buf app data length
ip_buf_appdatalen should be user_data->expecting otherwise
it is zero.

Change-Id: Iedb61a7f0e3516a5643da04b5963a2e241fd8bc9
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:24:47 -05:00
Ravi kumar Veeramally
743de006ad net: apps: Fix function name in dtls-client
Change the init function name to have client string in it,
it is more logical that way.

Change-Id: Ie282151562620858dc78563f2a4e63f7fb4fc472
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:24:47 -05:00
Jukka Rissanen
809f8ca16e net: apps: Fix compile error of coap-observe-client
Include path was missing.

Change-Id: I29c1b31143fe4d03cde5bd0cd63319960b817322
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:46 -05:00
Jukka Rissanen
0179583391 net: Fix the include paths in Contiki sources
Fix the include paths in Contiki sources so that we do not
have to create links to include directories during compilation.

Change-Id: I9316f1e90474e0ee563557deadd0bdc321cbb0fa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:46 -05:00
Jukka Rissanen
2272312b8d net: Refactor code to use new generic net_buf API
Change-Id: Id008bbf43062ca0641a76edaabef47c650287444
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:46 -05:00
Jukka Rissanen
736e8b1bf9 net: test: Remove the test_15_4 testcase temporarily
The test causes random failure so remove it temporarily.

Change-Id: I0b74877ad27d673099d0eecb191b6978bf9b40ee
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:40 -05:00
Johan Hedberg
b620f6a5ae net: samples/buf: Fix Kconfig option name
Change-Id: Ib120b2a746aa319b7c0ea943e23a83b45aefaf31
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:40 -05:00
Jukka Rissanen
bd5d503fc6 net: Rename samples/network to samples/net
Networking code is in net directory in other parts of the
code base so rename network -> net in samples directory.

Change-Id: I0ca0188c6844b0957270398d08b85a3153819e97
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:39 -05:00