Commit graph

861 commits

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