Commit graph

861 commits

Author SHA1 Message Date
Tomasz Bursztyka 3b0769889b net/samples: Add static ipv4 addresses for arduino 101 echo apps config
Jira: ZEP-1444

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

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

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

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

           [*] TI CC2520 Driver support  ----

           [ ] TI CC2520 Driver RAW channel  --->

Make RAW channel depends on TI CC2520.

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

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

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

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

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

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

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

Tested on Atmel SMART SAM E70 Xplained board

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

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

Jira: ZEP-1884

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

The README file is also updated by this patch.

Jira: ZEP-1543

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

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

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

Jira: ZEP-1878

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

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

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

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

Jira: ZEP-1855

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

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

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

Jira: ZEP-1169

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

Jira: ZEP-1824

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

Jira: ZEP-1824

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

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

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

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

Jira: ZEP-1701

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

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

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

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

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

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

Jira: ZEP-1754

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

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

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

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

Content might be also published for a given subject.

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

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

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

Jira: ZEP-1012

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

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

Coverity-CID: 163115

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

Coverity-CID: 163117

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

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

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

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

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

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

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

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

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

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

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

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

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

Jira: ZEP-1732

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

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

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

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

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

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

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

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

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

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

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

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

wireshard 154.pcap

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

Jira: ZEP-1774

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

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

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

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

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

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

Jira: ZEP-1539

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

- client_id
- will_topic
- user_name
- topic

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

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

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

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

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

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

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

Jira: ZEP-799

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

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

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

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

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

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

Jira: ZEP-1538

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Jira: ZEP-827

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

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

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

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

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

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

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

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

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

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

Jira: ZEP-1656

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

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

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

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

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

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

- Delete unused defines

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

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

The following MQTT API routines are exercised in this sample:

- mqtt_init
- mqtt_tx_connect
- mqtt_tx_pingreq
- mqtt_tx_publish
- mqtt_tx_disconnect

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

- struct mqtt_ctx
- struct mqtt_connect_msg
- struct mqtt_publish_msg

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

A README file is also included in this patch.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Jira: ZEP-1638

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

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

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

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

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

Jira: ZEP-1616

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

Origin: Original

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

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

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

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

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

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

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

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

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

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

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

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

Jira: ZEP-1617

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

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

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

Coverity-CID: 157574

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

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

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

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

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

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

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

Coverity-CID: 157590

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

See commit 8f96628064.

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

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

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

Jira: ZEP-1457

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

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

This commit fixes the above described issues.

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

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

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

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

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

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

Jira: ZEP-1574

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

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

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

Warnings like:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

 CONFIG_CONSOLE_SHELL=y

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

 #include <shell/shell.h>

instead of

 #include <misc/shell.h>

Updated documentation as well.

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

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

Jira: ZEP-1448

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

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

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

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

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

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

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

Jira: ZEP-1427

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Jira: ZEP-1233

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

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

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

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

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

Jira: ZEP-1357

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

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

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

The dns sample application is also updated.

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

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

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

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

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

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

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

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

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

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

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

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

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

	NET_BUF_POOL_DEFINE(pool_name, ...);

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

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

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

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

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

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

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

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

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

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

TCP support is missing from this version.

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

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

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

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

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

export QEMU_EXTRA_FLAGS="-s -S"
make qemu

Was tested with echo_server

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Configuration variables at the conf files are also homogenized.

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

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

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

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

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

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

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

Change-Id: Ie8e13e5f6091a279b62b6d8b0b3928a5187e75b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:51 +02:00