Commit graph

2626 commits

Author SHA1 Message Date
Jukka Rissanen 8b6a7690ef samples: net: echo_client: Print the used protocol when sending
Useful when debugging what protocol is being used when sending
TCP data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-16 16:36:01 +03:00
Jukka Rissanen f766ba4171 samples: net: echo_client: Connect both IPv4 and IPv6 before sending
Make sure we are connected before starting to send IPv4 and IPv6 TCP
data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-16 16:36:01 +03:00
Robert Chou a2af43e270 net: samples: fix early unref issue for coap_client/server
Explicitly call net_pkt_ref()/net_pkt_unref() to avoid packet being
freed after calling net_context_sendto() at retransmit_request().
Also, do not return when net_context_sendto() returns error. Instead,
we should keep retrying.

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-16 12:38:28 +03:00
Robert Chou d2e98c86fa net: samples: fix malformed payload when coap_client/server retransmit
Original coap_client implementation does not setup "appdatalen" of
net_pkt correctly and does not strip the IP + UDP headers when doing
the retransmit. This will result in malformed coap packet. Fix it by
adding a strip_headers() function to set appdatalen and get rid of
IP + UDP headers.

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-16 12:38:28 +03:00
Paul Sokolovsky de6fafb701 samples: net: sockets: Print incoming connection number
This helps to debug issues with mass connection handling (e.g. when
issues happen at ~500th connection).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-16 11:01:06 +03:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Andrew Boie 8bfac9b6c3 philosophers: run with threads in user mode
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-13 12:56:14 -07:00
Johann Fischer 5ab2cb96eb samples: cdc_acm: add composite configuration
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-13 09:18:14 -04:00
Robert Chou 4869c16eae net: samples: fix coap_client early unref packet issue
1. After calling sendto(), the packet will be unreferenced.
   Call coap_pending_cycle() to make sure the packet is referenced until
   we got the response from the peer or retransmission timeout.
2. In retransmit_request(), we rearrange the order to avoid the issue.
3. Remove IPv4 configuration for source code is expecting IPv6
4. Correct a typo in README.rst
5. Initialize the interface w/ IPv6 address

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-13 14:38:18 +03:00
Robert Chou 4fbf721390 net: sample: correct coap-server ETSI TD_COAP_BLOCK_03/04 testcases
When testing against etsi_coaptest.sh, test cases TD_COAP_BLOCK_03/04
will get stuck. This is because these testcases send out a blockwise
transfer but with an empty payload. Although this should be a legit
request, large-update/create handlers did not check "MORE" flag in
block1 option and always return an error when request comes with empty
payload.

Corrected as below
1. Initialize coap_block_context when first block arrives.
   (SIZE1 option is not always available. In the case that SIZE1 is
    unavailable, the zoap_block_context will be re-initialized each time
    a new block has arrived)
2. Check "MORE" flag of block1 option. If it's the last block, then
   an empty payload should be allowed.
3. Response w/ 2.04 CHANGED when the last block has arrived for
   large-update
4. Response w/ 2.02 CREATE when the last block has arrived for
   large-create
5. Remove adding block2 option to the response since we are not sending
   back any data to the caller

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-13 13:50:28 +03:00
Tomasz Bursztyka 4f0b25bef1 samples/wpan: Use set_filter() instead of former API function
Replace set_ieee_addr/set_shord_addr and set_pan_id relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Andrzej Puzdrowski a568e1399f sample: drivers: soc_flash_nrf5: Test of write-block-size get API
Added example code of using the new API for retrieving write-block-size.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-10-11 11:19:15 -05:00
Marti Bolivar 1047be9dbe samples: flash_shell: update to keep up with flash driver changes
Keep the flash shell up to date with the latest flash driver updates.

- Get the driver name from soc.h
- Add a write_block_size command
- Implement flash_shell_page_layout() using flash_page_foreach()

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-06 22:12:23 -04:00
Ravi kumar Veeramally b4dbd50b8d net: samples: Add leds demo app over RPL and CoAP
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally c30f692af0 net: samples: Modify coaps_client to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally 7519240502 net: samples: Modify coaps_server to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally bde8c6d616 net: samples: Modify zoap_client to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally 3e4a70669a net: samples: Modify zoap_server to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally e6bda22710 net: samples: Modify leds_demo to use new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Michael Scott 41897d7e19 samples: net: irc-bot: fix help text buffer size
At 32 bytes the snprintk call to fill the help buffer was most often
running out of room and returning an error.  Let's expand it to 64.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 201076254a samples: net: irc-bot: handle private messages in some commands
Users can private message the bot and the bot should respond directly
back to that user rather than rudely ignoring them.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 61c8c3fc7a samples: net: irc-bot: establish a static global for nickname
Let's create a static global var for nickname so that we can use it
later without having to pass it all the way through callbacks, etc.

Also limit the size to 16 bytes as IRC servers will truncate anything
beyond.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 2eb4a37bac samples: net: irc-bot: remove use of zirc and zirc_chan
These structures were originally intended to prototype an IRC library
which would be later moved into the subsys/net/lib/irc folder.

Unfortunately, that effort has faded and they make this code much more
complex than necessary.  Let's remove them in favor of simplicity.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 45561c7310 samples: net: irc-bot: move initialite_hardware() code to main()
The code is easier to follow this way.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 34ca5ee67b samples: net: irc-bot: declare banner text at the top
For style points let's declare the text shown at the beginning
of main() function to the top of our source as APP_BANNER so that
it's obvious and presents nicely.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott b5617b1106 samples: net: irc-bot: fix cmd parsing across multiple buffers
Let's simplify the parsing function which scans incoming traffic
for carriage returns and let the net_pkt_read() function cross
multiple buffers if needed.  Also, gracefully skip lines which
are longer than the command buffer.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 3e1e2d53ec samples: net: irc-bot: clean up prj.conf
Several settings were out-dated or now enabled elsewhere.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 334667342c samples: net: irc-bot: add support for CONFIG_NET_CONTEXT_NET_PKT_POOL
Some L2 layers such as bluetooth need to have extra buffer pools to
hold copies of packets for use with TCP.  Let's add support for that
so that future enablement of other boards won't get bitten.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 86c426d3e8 samples: net: irc-bot: migrate from NET_LOG to SYS_LOG
Let's migrate from using NET_LOG_* functions to the SYS_LOG
facility which allows for granular control over the display
of info, debug and error messages unique to the file that
you're in.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott 80bad32828 samples: net: irc-bot: migrate to net_app API
Let's remove all of the extra coding to handle DHCP, DNS and event
management.  This is all handled by the net_app API.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Tomasz Bursztyka 10904a0d29 net/samples: Build cc2520 frdm's common code only when relevant
If cc2520 is not selected, then won't be any need for that part.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-06 18:30:18 -04:00
Johann Fischer 927cdf9c32 samples: usb: set default log levels in mass sample to error
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-05 12:09:59 -04:00
Tomasz Bursztyka 0576a393f2 samples/net: Let's merge ieee802154 qemu and hw tests into one
There is now only samples/net/ieee802154 for low level IEEE 802.15.4
test.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Tomasz Bursztyka d4eeaff93c samples/net: Removing config support for arduino_101 with CC2520
It's useless now, arduino_101 has proven not working very well with x86
gpios and CC2520 never got to work properly there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Tomasz Bursztyka 91df111386 samples/net: Getting rid of common ieee802154 settings altogether.
Only ieee802154 should have been using it, but it ended in various
samples that did not require it anymore once they've been using
net_app. Unlike former samples settings, net_app settings are tied to
net_app, so let's just forget about all of it and silently use net_app.
If something goes wrong in setting net options, it will be a unique
place.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Paul Sokolovsky c80e9d00da samples: net: echo_client: Consistently enable net_app for all configs
This app now depends on net_app API, so it must be enabled for all
project configs we have.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-04 10:46:12 +03:00
Aska Wu 89f28ac7c8 net: sample: Add sntp client sample
This sample demostrates how to use SNTP client library to get the
current time from SNTP/NTP server.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-10-03 15:29:27 -04:00
Anas Nashif 71a927955e usb: move headers to include/usb/class
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif 18a33edd39 usb: fix local includes and add usb namespace
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif fde34dd54b usb: fix header by adding subsystem prefix
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif 95d4ebbcd9 samples: net: use 'run' target in common Makefile.ipstack
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 10:27:17 -04:00
Chunlin Han fe48e9efde sample: demonstrate the usage of memory domain APIs
The demo application to demonstrate the usage of memory domain APIs.

Signed-off-by: Chunlin Han <chunlin.han@linaro.org>
2017-09-29 16:48:53 -07:00
Johan Hedberg d712a4e1a3 Bluetooth: Mesh: Remove local network interface Kconfig option
From section 3.4.5.3 in the Mesh Profile Specification 1.0:

    "A node shall implement a Local Network Interface."

Removing the Kconfig option also helps clean up quite a lot of code.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-27 16:33:06 +03:00
Johan Hedberg 8f168c85f7 samples: microbit/pong: Fix incorrect placement of parenthesis
The code was causing only one byte of data to be placed in timeout
instead of sizeof(timeout) as intended.

Coverity-CID: 170744

Fixes #4057

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-26 12:55:14 +03:00
Paul Sokolovsky ef39533365 samples: sockets: Add a dumb HTTP server example
It's dumb, because it doesn't really parse HTTP request, just always
sends the same page in response. Even such, it's useful for socket
load testing with tools like Apache Bench (ab) and for regression
checking in the net subsystem.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-09-22 08:24:36 -04:00
Luiz Augusto von Dentz 9b5d3f174f Bluetooth: ipsp: Add dedicated conf file for CONFIG_NET_L2_BT_ZEP1656
CONFIG_NET_L2_BT_ZEP1656 shall only be used with hosts that are known to
not comply with RFC 7668.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Luiz Augusto von Dentz a4e176b6a3 Bluetooth: ipsp: Add note about the Linux 4.12 kernel release
Since 4.12 Linux kernel has fixes required to comply to RFC 7668.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Luiz Augusto von Dentz b81ab53f89 Bluetooth: ipsp: Add CONFIG_NET_APP_BT_NODE=y to prj_dbg.conf
CONFIG_NET_APP_BT_NODE is required in order for the Bluetooth L2 driver
to register IPSS service.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Andrei Emeltchenko 54831ec5c7 usb: webusb: Move USB version definition to right place
Make it possible to reuse definitions from other samples.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 13:10:04 -04:00
Andrei Emeltchenko 4efaefba5c usb: Allow to select configuration for composite devices
Composite multifunction USB devices should be able to know about
configuration change, implement it through existing callback.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00
Michał Kruszewski 77824a548d samples: net: Add documentation to prj_qemu_cortex_m3.conf file.
Add information that IP addresses in prj_qemu_cortex_m3.conf file for
echo_client are set that qemu<->qemu communication could be tested.

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

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

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-09-19 17:39:44 +03:00
Luiz Augusto von Dentz 154f32d9ca Bluetooth: ipsp: Remov ipss.c
This file is no longer needed as IPSS service is already enabled with
CONFIG_NET_L2_BT.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-18 10:21:11 -04:00
Michael Scott 33c79033d0 net: lwm2m: move library internals to net_app APIs
This is the final stage of moving the LwM2M library internals to
the net_app APIs.  This means we can support DTLS and other
built-in features in the future.  All of the logic for
establishing the network connection is removed from the sample
app.

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

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

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

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-17 18:02:18 -04:00
Carles Cufi 43fa93f682 samples: bluetooth: hci: Fix TX memory leak
Whenever a buffer is sent to the driver via bt_raw using bt_send() the
buffer might not be consumed if an error is returned. In that case
unreference the buffer to avoid leaking the already allocated net_buf.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-09-13 14:17:32 +02:00
Anas Nashif f7b2484219 samples: add missing sample.yaml and fix build
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 17:21:08 -07:00
Michael Scott f3454769db samples: lwm2m: remove unused NET_L2_BT settings
Currently, we don't have a .conf which enabled BT.  This will be
re-enabled at some future date after migrating to the full net_app
APIs by setting CONFIG_NET_APP_BT_NODE=y.

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

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-12 20:37:48 +03:00
Anas Nashif 1e8afbfe5a cleanup: remove lots of references to unified kernel
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 12:37:11 -04:00
Jukka Rissanen e71a31e22f net: Wrong networking defines used in the code
There were bunch of config options in tests/net, net-shell and
wpan_serial sample, and those options had wrong name so they
were ignored by the code.

Fixes #1428

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-12 08:37:53 -04:00
Marti Bolivar 219b3cd067 samples: drivers: add flash_shell
This is a simple shell module that allows arbitrary boards with flash
driver support to explore the flash device.

- Reading, erasing, and writing by device offsets are supported in all
  cases.

- If the flash page layout is available, it can be printed, and I/O
  can also be done to a specified page as well.

One known issue is that writing to flash on targets that require
doubleword-sized writes (e.g STM32L4) will fail since the number of
arguments required exceeds ARGC_MAX in shell.c. Addressing that is
left to future work.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-09-11 11:41:57 -04:00
Andrzej Puzdrowski 4255766ba7 samples: drivers: soc_flash_nrf5: Get flash page layout sample
Added sample code for testing and displaying the flash layout using
the recently introduced API.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-09-11 11:41:57 -04:00
Sebastian Bøe 76537ad1dd samples: Add bbc_microbit to hci_uart's whitelist
bbc_microbit has been observed to regress on this sample and is
therefore a good candidate for CI.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-09-07 07:04:22 -05:00
Punit Vara 3dd100a750 samples: bmm150: Add sample application for BMM150 sensor
To test BMM150 geomagnetic sensor driver in polling mode,
sample application added by this patch can be used.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-05 07:56:41 -04:00
Carles Cufi 80e0f7939e Bluetooth: controller: Add DTM HCI commands
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-09-04 06:08:09 -04:00
Anas Nashif 62f8d4d792 samples: grove: set min_flash filter
This sample does not fit in < 32Kb when built with asserts enabled.

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

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

Jira : ZEP-2525

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

Jira: ZEP-2560

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

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

Jira: ZEP-2566

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

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

Coverity-ID: 174408
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-22 08:19:54 -04:00
Vinayak Kariappa Chettimada 6a39ed084f Bluetooth: controller: Add Minimum Number of Used Channels Proc
Add implementation to support Bluetooth 5.0 Minimum Number
of Used Channels Procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-08-21 08:41:56 -04:00
Paul Sokolovsky 756e729c00 samples: net: echo_async: Add IPv6 support
The main reason is allowing to run on 6LoWPAN devices, though also to
demonstrate IPv6 support with BSD Sockets in general.

Tested on 96b_carbon.

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

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

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

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-08-18 10:53:25 +03:00
Tomasz Bursztyka 087354019f samples/crypto: Add mbedtls shim driver support
Normalizing variables names and make sure tag handling behavior, which
might be different among backends, does not make the test failing.

Also, improving debug logs in case of error.

Change-Id: Ic317948aab459bfa75c9a72ac48cb2d12a0d0706
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 22:20:23 -04:00
Tomasz Bursztyka 422a769cc2 samples/crypto: Check error code everytime and improve logging
If the encryption/decryption failed there is no need to procceed
further.

Change-Id: If450e40ed6fd601b698b74c56ae21fc7f903d087
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 22:20:23 -04:00
Tomasz Bursztyka 0cefc6947c samples/zoap_server: Fix unchecked return value
Coverity-CID: 174413

Jira: ZEP-2523

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

Also, added some articles to docs.

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

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-17 10:24:05 -04:00
Ricardo Salveti 4ff2c33451 Bluetooth: samples/hci_spi: increase BT_RX_BUF_COUNT to 10
Default BT_RX_BUF_COUNT value is not enough when transfering a large
amount of data (e.g. heavy network traffic over BT 6LoWPAN). Increase
BT_RX_BUF_COUNT from default value 3 to 10.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-08-17 08:20:18 +03:00
Paul Sokolovsky 7ef28df980 Bluetooth: samples: ipsp: Fix crash on TCP connection closure
Be sure to check for NULL pkt in receive callback, which means TCP
EOF. The fix ported from echo_server sample.

Jira: ZEP-2423

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-16 23:40:11 +03:00
Paul Sokolovsky e314de5d53 samples: net: sockets: Add READMEs for echo/echo_async samples
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-16 16:09:05 -04:00
Andrew Boie ba95aa00e0 cpp_synchronization: fix main() definition
C++ standard mandates that main() return an 'int' even though
Zephyr does not use it. Fix build error with XCC compiler.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-16 10:59:10 -07:00
Marti Bolivar cf9a5e352f doc: 96Boards Carbon: add Bluetooth setup docs
Add cross-referenced information on the 96b_carbon and
96b_carbon_nrf51 pages which disambiguates between the two "boards".
Also describe how to flash 96b_carbon_nrf51 with
samples/bluetooth/hci_spi and 96b_carbon with samples/bluetooth/ipsp
to support a Bluetooth HCI stack on 96Boards Carbon (the physical
board).

While we're here, make the documentation page for 96b_carbon match the
format in doc/templates/board.tmpl.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-08-15 22:58:02 +03:00
Marti Bolivar 7394401baf Bluetooth: ipsp: use sys_log
Various of the printk messages in this sample app don't have
newlines. Let's fix the output by moving to SYS_LOG_xxx() macros
instead, which don't need them anyway.  This also makes it easier to
tell errors apart from other messages, etc.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-08-15 22:58:02 +03:00
Ricardo Salveti 8dbb388000 samples: Bluetooth: add HCI SPI raw handler sample
Add a sample application that allows a Zephyr-based Bluetooth
controller to interface with an HCI driver via SPI. This sample
implements the same BT SPI protocol already as Zephyr's HCI SPI
driver.

Currently, the sample only supports the legacy SPI API.

Provide a single configuration file, avoiding board-specific
files. Some board-specific configuration information must be provided
via other means:

- CONFIG_BT_CONTROLLER_TO_HOST_SPI_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_PIN

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-15 22:58:02 +03:00
Gil Pitney 4f67a6c76d cc3200: Remove TI cc3200 SOC and LaunchXL board support
Per ZEP-1958, Phase 2 of adding CC3220sf LaunchXL support,
was to "deprecate the CC3200 launchxl support in Zephyr
(redundant to the CC3220)."

Effectively, the CC3220 SOC replaces the CC3200.

This patch removes the following:
* the imported CC3200 SDK
* CC3200 SOC, board, DTS files.
* adjusts other files where cc3200 was mentioned.

Also, it fixes explicit references to CC3200 in generic
CC32xx driver files.

Jira: ZEP-1958

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-08-15 11:02:48 -05:00
Carles Cufi d5c13a7530 Bluetooth: controller: Rename Kconfig prefix
Rename the BT_CONTROLLER prefix used in all of the Kconfig variables
related to the Bluetooth controller to BT_CTLR.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-08-14 15:44:56 +03:00
Jukka Rissanen 7886336593 net: app: Fix for net_app_get_net_buf()
The documentation says that the API will automatically append the
net_buf fragment to the end of network packet fragment chain.
This was not the case and current only user for this API in
echo-server sample appended the fragment itself. The fix is to
automatically append the fragment to the end of fragment chain.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-14 10:04:03 +03:00
Maureen Helm a580bc5b2e samples: rgb_led: Add support for hexiwear_k64
The hexiwear_k64 board can drive the leds with a pwm, so update the
rgb_led sample to work with this board.

Jira: ZEP-2025

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-08-09 18:13:29 -04:00
Maureen Helm 3b5577d102 samples: fade_led: Add support for hexiwear_k64
The hexiwear_k64 board can drive the leds with a pwm, so update the
fade_led sample to work with this board.

Jira: ZEP-2025

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-08-09 18:13:29 -04:00
Maureen Helm 28bf1a554a samples: blink_led: Add support for hexiwear_k64
The hexiwear_k64 board can drive the leds with a pwm, so update the
blink_led sample to work with this board. Reduces the maximum blinking
frequency from 500 Hz to 64 Hz because your eye can't distinguish these
higher frequencies (the led appears solidly on). Increases the minimum
blinking frequency from 0.5 Hz to 1 Hz because the mcux pwm driver can't
handle frequencies less than 1 Hz.

Jira: ZEP-2025

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-08-09 18:13:29 -04:00
Leandro Pereira d89e7e4e45 samples: drivers: gpio: Make the sample work with ESP32
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-09 12:26:14 -07:00
Michel Jaouen 6e2ba2c9e1 mpu_stack_guard_test: update log in README.rst
Following test changes, log info have changes and previous log info
with stack guard present shows an mpu error not caused by a stack
overflow caught by mpu stack guard feature.

Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2017-08-09 13:36:09 -05:00
Michel Jaouen 3e6965d188 mpu_stack_guard_test: add more thread for test
This test launches several threads. Only last thread will overflow the
stack and an mpu exception will occur. The other threads are regulary
suspended, this triggers access to kthread structure. This tests is
failed on st and nxp platform, if 32 bytes alignement is not set.

Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2017-08-09 13:36:09 -05:00
Jukka Rissanen 55b8edc88e net: Fix LLVM compiler warnings
Jira: ZEP-2488
Jira: ZEP-2486
Jira: ZEP-2485
Jira: ZEP-2482
Jira: ZEP-2480

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

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

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

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

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

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

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

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

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

Coverity-CID: 157607

Jira: ZEP-2467

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-08 12:31:08 -04:00
Vincenzo Frascino 5398ef4d85 samples: mpu_test: Add Allow Flash Write config
This patch adds a configuration file that tests Flash writes with MPU
enabled.

[david.brown: Put options in prj.conf with comments as per review
 feedback]

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: David Brown <david.brown@linaro.org>
2017-08-08 11:20:46 -05:00
Johan Hedberg 51252bdea4 Bluetooth: samples/mesh_demo: Fix tune generation with sharp notes
The parsing of strings with sharp notes (e.g. "100C#") was incorrectly
implemented. Now it should be correct. Additional benefit is that this
should fix Coverity CID 173632.

Jira: ZEP-2467

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-08 13:10:29 +03:00
Jukka Rissanen 0c243dfe8c samples: net: Remove IEEE 802.15.4 sample setup
The IEEE 802.15.4 settings are applied automatically by
net_app_init() function is is enabled by default.

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

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-07 21:52:51 -04:00
Anas Nashif f461ee4df5 samples: fixed tc syntax
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-07 21:43:51 -04:00
Johan Hedberg bf8e504588 Bluetooth: Mesh: Fix duplicate const declarations
Remvoe duplicate const declarations which may cause compiler warnings.

Jira: ZEP-2442

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-07 19:18:02 +03:00
Paul Sokolovsky 5245a686fc samples: net: sockets: Switch to net_app auto-init
Don't call net configuration explicitly, instead rely on net_app
auto init service.

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

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-07 10:13:47 +03:00
Luiz Augusto von Dentz e57b7ec4ba Bluetooth: ipsp: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz 7d9e0184d9 net: led_demo: Remove dependency on ipss sample service
The led demo does not even enable Bluetooth by default, and in case a
custom enables it shall use CONFIG_NET_APP_BLUETOOTH_NODE.

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

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

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

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

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

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

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

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

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

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Punit Vara da163e3bfc samples: Add sample for APDS9960 sensor
Sample can be used to test ambient light, RGB and proximity
functionality of APDS9960 sensor in polling mode.

Remove old sample which is not using sensor API.

ZEP-1552

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-08-03 15:29:35 -05:00
Anas Nashif 3ac7b3a229 doc: qemu target was deprecated, use 'run'
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-03 11:48:55 -04:00
David B. Kinder 62a0cd246d doc: fix uses of back quotes in documentation
ReST defines interpreted text roles where text enclosed by single quotes
can be "intrepreted", for example :ref:`some name` becomes a link to
a label anywhere in the doc set named "some name", :c:func:`funcname()`
becomes a link to the API documentation for "funcname", and
:option:`CONFIG_NAME` becomes a link to, in our case, the documentation
for the generated Kconfig option.

This patch fixes uses of `some name` (without a role) by either adding
an explicit role, or changing to ``some name``, which indicates inline
code block formatting (most likely what was intended).

This is a precursor to changing the default behavior of interpreted
text to treat `some name` as :any:`some name` (as configured in
doc/conf.py), which would attempt to create a link to any available
definition of "some name".

We may not change this default role behavior, but it becomes an option
after the fixes in this patch.  In any case, this patch fixes incorrect
uses of single-quoted text (possibly introduced because GitHub's
markdown language uses single-quoted text for inline code formatting).

Jira: ZEP-2414

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-08-03 11:08:23 -04:00
Johan Hedberg 0be8414e2f Bluetooth: samples/mesh: Increase GATT TX buffer count
Count of 4 seems to cause deadlocks with some Android phones due to
other GATT activity in addition to Mesh related data.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-03 13:10:30 +03:00
David B. Kinder e9a3411651 doc: spelling fixes in docs
regular scan through docs and KConfig files for spelling issues
and UTF-8 characters

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

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

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

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

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

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

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

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

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

Jira: ZEP-2236

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

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

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

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

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

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

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

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

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

jira:ZEP-2261

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-07-27 14:09:40 -04:00
Johan Hedberg ee3b715d1d Bluetooth: samples/mesh: Update generic nRF51 16k configuration
Update the configuration with the latest fine-tuning that was already
present in microbit.conf.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-27 13:51:34 -04:00
Johan Hedberg 28ce610a06 Bluetooth: samples/mesh: Disable unnecessary debug logs
There's no need for debug logs by default in the mesh sample, and it
just contributes excessively to the ROM footprint.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-27 13:51:34 -04:00
Wojciech Bober ac9a8804b9 net: http_server: Enable Bluetooth stack if configured
This PR enables Bluetooth stack if Bluetooth L2 is
compiled in.

Change-Id: I8f8127031140f0603615af44e0809d203db32f48
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-07-27 16:51:55 +03:00
Anas Nashif 977537107e samples: mesh: build sample where they fit
Not easily done using RAM/ROM filters, configurations need to be adapted
to make this fit on more devices. Limit the target platforms now while
we figure out configurations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-27 07:47:53 -04:00
Anas Nashif ca0ad13a61 net: enable SLIP only on QEMU targets
In many networking tests we had to configure SLIP in the prj.conf
leaving those configurations Qemu specific. This change enables SLIP for
QEMU targets automatically and allows reuse of prj.conf for multiple
boards.

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

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

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

Adjust irc_bot sample to reflect those changes.

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

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-07-25 18:01:32 -04:00
Johann Fischer bc2454fa9e samples: usb: add usb.rst and README.rst for CDC ACM sample
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-23 07:41:57 -04:00
Johann Fischer 1ff51986e5 samples: cdc_acm: use Arduino 101 as default board
Be consistent with other usb samples and use Arduino 101
as default board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-23 07:41:57 -04:00
Paul Sokolovsky 4732452a42 samples: bluetooth: ipsp: Bump max number of contexts
This sample includes builtin UDP and TCP echo servers, max
MAX_CONTEXTS=3 as set previously, they just didn't work.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-22 10:33:29 +03:00
Johan Hedberg 0ec2630882 Bluetooth: Mesh: Add initial implementation
Add an initial implementation for the Bluetooth Mesh Profile
Specification. The main code resides in subsys/bluetooth/host/mesh and
the public API can be found in include/bluetooth/mesh.h. There are a
couple of samples provided as well under samples/bluetooth and
tests/bluetooth.

The implementation covers all layers of the Bluetooth Mesh stack and
most optional features as well. The following is a list of some of
these features and the c-files where the implementation can be found:

 - GATT & Advertising bearers (proxy.c & adv.c)
 - Network Layer (net.c)
 - Lower and Upper Transport Layers (transport.c)
 - Access Layer (access.c)
 - Foundation Models, Server role (health.c & cfg.c)
 - Both PB-ADV and PB-GATT based provisioning (prov.c)
 - Low Power Node support (lpn.c)
 - Relay support (net.c)
 - GATT Proxy (proxy.c)

Notable features that are *not* part of the implementation:

 - Friend support (initial bits are in place in friend.c)
 - Provisioner support (low-value for typical Zephyr devices)
 - GATT Client (low-value for typical Zephyr devices)

Jira: ZEP-2360

Change-Id: Ic773113dbfd84878ff8cee7fe2bb948f0ace19ed
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-20 09:30:44 +03:00
Paul Sokolovsky 0e5c365f9a samples: net: sockets: Move socket sample(s) under a subdir
It's expected that there will be few socket-based samples, so move
tehm under samples/sockets/ to not clutter the main dir.

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

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

Jira: ZEP-2359

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-18 09:33:46 +03:00
Luiz Augusto von Dentz ca9c8a2627 Bluetooth: ipsp: Remove requirements section
All supported driver are HCI based so there is no need have it state on
the README.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-17 17:45:46 +02:00
Johann Fischer a8d7659a63 samples: dfu: fix usb configuration descriptor length
The macros for calculating the length of the configuration
descriptors have been interchanged, fix it, and use the
correct macro for the length of the DFU mode configuration
descriptor.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-15 11:26:40 +03:00
Robert Chou 33c54ee6fd net: zoap: advance block context by checking M bit from block option
According to RFC7959 page 30, "The end of a block-wise transfer is
governed by the M bits in the Block options, _not_ by exhausting the
size estimates exchanges."

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

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-07-14 11:06:54 +03:00
Luiz Augusto von Dentz 94409a14ae Bluetooth: ipsp: Disable debug options
This disable debug options in order for the image to fit in boards
such as arduino_101 and quark_se_c1000_devboard.

For convenience this adds another configuration file with as it was
available previously which can be build using:

make CONF_FILE=prj_dbg.conf

JIRA: ZEP-2378
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-12 17:37:45 +03:00
Erwin Rol 507add28c9 samples: net: http_server: Add olimex_stm32_e407 project config file
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2017-07-12 12:53:51 +03:00
David B. Kinder eeed8ce179 doc: fix wiki board references in non .rst files
Some README files referenced wiki articles that have been
moved to the doc area on the website.

Fixes #668

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

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

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

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

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

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

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

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-07 09:01:01 -05:00
Erwin Rol 3ff4d7409f samples: random: Add sentinel to check for buffer overflows
Initialize the buffer to 0 and read one byte less than the
buffer size. The result should be that the last byte of
the buffer always stays 0. This way it is possible to verify
it the driver does not write outside the buffer.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2017-07-07 07:27:39 -05:00
Jukka Rissanen 6ce9d8e882 samples: net: zperf: Add net tag
This sample app should be tested whenever net tag is specified.

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

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

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

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

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

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

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Carles Cufi c170855825 Bluetooth: hci_uart: Set the UART TX size correctly
Since the controller comes with a transmit buffer size that mirrors the
maximum size of a transmit packet, use that to size the buffers that are
used in the hci_uart application to receive packets from the Host over
the UART.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-05 16:59:31 +02:00
Anas Nashif 8aac831e3c samples: mqtt_publisher: fixed typo
Also fix console syntax adding prompt: $

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-04 16:52:40 -04:00
Johan Hedberg 30beef9419 Bluetooth: GATT Introduce BT_GATT_CCC_MAX helper define
The worst-case maximum number of CCC entries we need is actually
MAX_CONN + MAX_PAIRED. Provide a helper define for it and use it
whenever appropriate.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-04 17:30:40 +03:00
Anas Nashif 07c0d3d0f0 samples: ipm_mailbox: fix thread creation
We have been starting the same thread twice. Introduced when we moved
from k_thread_spawn.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-03 20:57:44 -04:00
Neil Armstrong 395daba0d4 samples/spi: Enable test on STM32 SoCs
Add support for the STM32 SoCs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Neil Armstrong 394aa8127a samples/spi: Permit specifying low test frequency
The STM32 lower frequency is different, let us specify a different one.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Neil Armstrong 9eb865e03a samples/spi: Make async test optional
Handle the case when the async transceive call returns ENOTSUP.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Vinayak Kariappa Chettimada 6cc00f0ee3 Bluetooth: samples: scan_adv: Select BROADCASTER and OBSERVER
Explicitly select CONFIG_BLUETOOTH_BROADCASTER and
CONFIG_BLUETOOTH_OBSERVER in the scan_adv sample.

If the Controller is included without connections support
then only broadcaster support is compiled in by default,
hence add broadcaster and observer role support explicitly
in the prj.conf file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-06-30 13:42:33 +03:00
Jukka Rissanen 439ceb99c1 samples: net: https: Increase the RAM for client and server
Next two commits will increase the mbedtls ram usage a bit and
https client and server sample test will fail.

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

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

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

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

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

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

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Kumar Gala c84e90e7de samples: nfc_hello: limit to uarts that support interrupts
We get some failures to build if we don't filter this test to only
boards that support uart interrupts.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 14:55:43 -04:00
Kumar Gala fbd1bc2a93 samples: hello_world: remove min_ram requirement
The hello_world sample builds everywhere so remove the min_ram
requirement from samples.yaml.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 11:48:34 -04:00
John Andersen 913e2cdb24 samples: net Documented QEMU_INSTANCE usage
Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
John Andersen 06b92c6611 samples: net: Multiple instances of QEMU
Makefiles which start QEMU (make run) have been changed to operate
off of the QEMU_INSTANCE variable. QEMU_INSTANCE is simply appended
to the pid and sock file names. This makes us able to run multiple
QEMU Zephyr instances of the same sample.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
Kumar Gala 21cf3a6344 samples: Fix filtering on UART_CONSOLE
There were a few different issues with the UART_CONSOLE filtering:
* Filter was incorrect - UART_CONSOLE should be CONFIG_UART_CONSOLE
* platform_exclude was used for drivers that had a #error for lack of
  interrupt support.  We can now use CONFIG_SERIAL_SUPPORT_INTERRUPT in
  the filter for that.  This catches all the various drivers that needed
  don't support uart interrupts, not just the onces that had a #error

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 07:07:31 -04:00
Johann Fischer 08df5961b3 arch: intel_quark: use DW device driver when USB is selected
This patch allows more generic USB configuration in the samples
and removes platform dependent driver configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-28 15:14:15 -04:00
Anas Nashif d1e562c924 tests: replace filters in testcase files
Where possible, replace the use of filter with newly added keywords.
This will speed things up and in some cases add more coverage due to bad
filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:51:40 -05:00
Paul Sokolovsky d950ec2981 samples: net: Add socket-based echo server example
The example source code is POSIX-compatible (modulo include files),
i.e. can be built and behaves the same way for Zephyr and a POSIX
system (e.g. Linux). Makefile.posix is available for the latter.

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

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

Fixes #596

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

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

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

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

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-23 16:03:21 -04:00
Anas Nashif 3afb47887f samples: hci_uart: optimize testcase definition
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-22 09:22:48 -04:00
Anas Nashif dc36e905b6 samples: environmental_sensing: update filtering
Build only for arduino 101 and update title and description.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-22 09:22:48 -04:00
Carles Cufi 634d3b46a9 Bluetooth: Set hci_uart RAM config to fit privacy
With the introduction of privacy, the system workqueue is now being
linked into the image, growing the RAM footprint considerably.

In order for the sample to fit in QFAA and QFAB variants of the nRF51
(16KB of RAM) we reduce the workqueue stack size to 512 since the RPA
update mechanism doesn't use more than 340 bytes and we stick to 16
connections maximum.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-06-22 14:40:23 +03:00
Johann Fischer aea4c31722 samples: wpanusb: remove unnecessary condition for ccflags
The condition in src/Makefile is not necessary since the
net_private.h is always included from wpanusb.c and is not
dependent on the transceiver.

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

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

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
David B. Kinder a741c00a08 doc: fix references to moved files
Some recent PRs moved sample files to a new location

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-20 18:26:53 -04:00
Anas Nashif 1618013e52 doc: add MPU samples to index
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-20 10:40:16 -04:00
Anas Nashif e3806d9766 Revert "Kconfig: Source Kconfig from Zephyr application directory."
This reverts commit 83edd615ca.

Causes the documentation build to fail on Kconfig parsing, needs fixing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-20 10:40:16 -04:00
Michał Kruszewski 83edd615ca Kconfig: Source Kconfig from Zephyr application directory.
Enable application specific configuration to be easily included
and manageable via Kconfig. Add sample.

Signed-off-by: Michał Kruszewski <mkru@protonmail.com>
2017-06-20 08:48:36 -04:00
Sharron LIU f6bc86db50 samples: appdev: static_lib: added "make flash"
ISSM team wanted to integrate
"samples/application_development/static_lib" app
into their IDE. Al-ashi, Mahmoud <mahmoud.al-ashi@intel.com> found
it failed to "make flash" this app.

Also this patch added "make flash" build targets.

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-06-20 08:30:26 -04:00
Anas Nashif 4ad2746088 samples: demonstrate the use of KBUILD_ZEPHYR_APP
Jira: ZEP-2280
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif c2a2cfc8c8 samples: move app developemnt samples samples/appdev
Move all application development and build related samples into one
folder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif 5c3c323069 samples: move all MPU samples into one directory
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif 19e78bcfe1 samples: move quark se power samples to boards/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif f7c226400d samples: move environment sensing to boards
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif 397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05:00
Geoffrey Le Gourriérec 1975ce4f7c samples: gpio: Add support for SensorTag board.
Add extra #defines in samples/drivers/gpio to test
TI SensorTag board.

Signed-off-by: Geoffrey Le Gourriérec <geoffrey.legourrierec@smile.fr>
2017-06-16 16:18:12 -04:00
Johan Hedberg 9703927f84 net: buf: Move net_buf_pool objects to dedicated linker area
Moving the net_buf_pool objects to a dedicated area lets us access
them by array offset into this area instead of directly by pointer.
This helps reduce the size of net_buf objects by 4 bytes.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-06-16 17:05:06 +03:00
David B. Kinder cbec29ab95 doc: change UTF-8 chars to sphinx inline replaces
Avoiding use of UTF-8 characters (trip up some tools)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-16 07:35:11 -05:00
Luiz Augusto von Dentz 79af35991b Bluetooth: GATT: Add bt_gatt_register_service
This adds bt_gatt_register_service using bt_gatt_service which contains
the attribute array that is then added to the database saving a pointer
in each and every attribute declared.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz d837a6ec4b Bluetooth: GATT: Add GAP service by default
GAP is mandatory service and now that the db can only be build
dynamically there is no reason to keep the applications registering it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00