Commit graph

861 commits

Author SHA1 Message Date
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