Commit graph

2626 commits

Author SHA1 Message Date
Jukka Rissanen 2486694eb9 net: http: Create HTTP library that uses net-app
Create http library that uses net-app instead of net_context
directly. The old HTTP API is deprecated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Youvedeep Singh 3a179e29b0 samples: boards: nrf52: test demo for nrf52 power management
This sample tesecase provides sample code :-
1. Triggers Low Power tasks into nrf52 SOC (CONST LAT and LOW PWR)
2. Triggers System Off state.
3. Wake up device through port Event by GPIO (Button 1).

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-06 09:29:10 -05:00
Jukka Rissanen 795bffbee2 samples: net: echo-client: Fix compile warning
This is similar fix as in commit 643cc4a22c but this one fixes
the thread parameter in UDP DTLS thread.

Fixes this function parameter datatype warning:

expected ‘k_thread_stack_t * {aka struct _k_thread_stack_element *}’
 but argument is of type ‘u8_t * {aka unsigned char *}’

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-03 10:49:33 -04:00
Savinay Dharmappa 4cec15270d sample: subsys: logging: kernel_event_logger: Add sample application
patch adds a sample application to demonstrate use of kernel event
logger feature.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-11-02 22:22:54 -04:00
Anas Nashif 373b6bed8b samples: remove ieee802154 sample, we have echo server/client
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-02 15:53:04 -04:00
Jukka Rissanen 862ddb17ab samples: net: coaps_server: Fix coap packet parsing
The length and the start of the coap payload was not correct
because the received packet did not had IP and UDP header in place.

Fixes #4630

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-02 14:43:10 +02:00
Leandro Pereira da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira adce1d1888 subsys: Add random subsystem
Some "random" drivers are not drivers at all: they just implement the
function `sys_rand32_get()`.  Move those to a random subsystem in
preparation for a reorganization.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Anas Nashif 0fb51fa849 headers: fix global includes for various source files
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Anas Nashif 9b7abb9d8c samples: bluetooth: add nrf52_pca10040 to beacon sample
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Michael Scott 98d8c6a665 net: lwm2m: fix all return values from resource callbacks
Previously, post_write and execute callbacks returned 1 when handled
and 0 for error condition.  However, this wasn't detailed enough and
the engine can't propagate any sort of error back to users -- so it
doesn't even check the return values in many cases!

Let's adjust the resource callback functions of all objects and the
lwm2m_client sample to return 0 for success or a valid error code.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Michael Scott ccbd696706 net: lwm2m: remove predefined firmware buffer from firmware_pull
Now that we can access resource data in the lwm2m subsys, let's use
the user provided firmware push buffer (5/0/0) to also store the
firmware pull data.

This way the size of the firmware pull buffer is completely up to the
application.

NOTE: This patch adds a 64 byte firmware buffer to the lwm2m_client
sample for this purpose.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Michael Scott 1bab82f8f0 samples: lwm2m: remove large buffer size requirement
Now that the LwM2M library can parse across multiple fragements,
let's remove the larger than normal buffer size setting.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Anas Nashif 780324b8ed cleanup: rename fiber/task -> thread
We still have many places talking about tasks and threads, replace those
with thread terminology.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-30 18:41:15 -04:00
Andrei Emeltchenko 2d822f1504 samples: http_server: Add netusb configuration
Add configuration to http_server sample making it possible to work
with USB Device stack with Ethernet ECM protocol.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-30 11:50:42 -04:00
Andrei Emeltchenko c4a3d6817c samples: echo_server: GPIO should be selected in the board configs
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-30 08:30:48 -04:00
Paul Sokolovsky 44e25bc53c Bluetooth: ipsp: Add detailed instructions
Given that 6lowpan/BLE support is still work in progress, uses
debugging interfaces to setup, has known issues, and otherwise
not widely known or adopted, provided detailed instructions,
including reasonable diagnosing steps on how to set up and test
such a connection.

Tested using 96b_carbon.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-30 08:10:35 -04:00
Andrei Emeltchenko 66df6f1130 net: sample: Add USB Ethernet stick configuration
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-28 14:38:19 -04:00
Andrei Emeltchenko 61202e898e usb: Add sanity_check configuration for netusb
Add netusb and composite netusb build check configurations.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-28 14:38:19 -04:00
Andy Ross 4a8a24fe39 Revert "cdc_acm : Restrict writing more than 4 bytes into TX USB Endpoint."
This reverts commit 1da0a9eebd.

The workaround caused a severe performance penalty, and only worked
for USB packets of 4-15 bytes in length (16+ byte packets weren't
subject to the hardware bug).  Single-byte packets (very common for
cdc_acm serial port transfers) would still be duplicated sometimes.

The upcoming DMA implementation does not share the performance
penalty, and also is not subject to the bug for those sizes of packets
(though it DOES still have a problem with single-byte packets!).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-10-28 14:38:19 -04:00
Tomasz Bursztyka 1b77ee12ea samples/net: Reducing prj*.conf files by relevantly removing 6Lo option
If NET_L2_IEEE802154 and NET_IPV6 are enabled:
- NET_6LO is enabled
- NET_L2_IEEE802154_FRAGMENT is enabled

Thus removing setting this config options to yes where applicable.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-28 14:28:02 -04:00
Marti Bolivar 306c717b9e samples: drivers: add WS2812 sample application
This is similar to the LPD8806 sample, but uses the WS2812 driver
instead. The app configuration is a bit more finicky, so try to
provide helpful references. This could be made more beginner-friendly
with the addition of timing diagrams, etc., but this should be enough
for an experienced developer to use.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Marti Bolivar 3e674eac98 samples: drivers: add LPD8806 sample application
This sample displays the colors red, green, and blue on consecutive
LEDs in an LED strip, moving the starting point where red begins
further down the strip at each time step. The color band wraps around
to the beginning when it reaches the end.

Since this is the first application in samples/drivers to have
documentation, add samples/drivers/drivers.rst as well, and include it
in the top-level toctree from samples/samples.rst.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Paul Sokolovsky 50d7ca11bc samples: echo_server: Clean up frdm_k64f config
Remove CONFIG_NET_L2_ETHERNET, as it's automatically set by the
board. This effectively makes prj_frdm_k64f.conf fairly portable,
e.g. the same config can be used for frdm_kw41z whcih uses 802.15.4
connectivity instead.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-28 09:24:58 -04:00
Michael Scott 907e7671e9 samples: lwm2m: reduce footprint of lwm2m conf
LwM2M is intended for constrained devices.  The default samples
settings are quite large by that standard and can be reduced to
reflect actual usage.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-26 09:25:56 +03:00
Michael Scott f34d0ebb8a samples: lwm2m: combine prj_*.conf files
After the LwM2M sample was introduced several HW related defaults were
added to Kconfig.  We no longer need separate prj*.conf files for K64F
and qemu_x86.  Let's combine them into a single prj.conf file and
adjust documentation.

NOTE: This also adjusts README.rst

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-26 09:25:56 +03:00
Kumar Gala c1881b22fe samples: net: wpanusb: Fix build error due to missing USB device vid/pid
We removed the default values for:
* CONFIG_USB_DEVICE_VID
* CONFIG_USB_DEVICE_PID

So put some dummy values in the sample.yaml to get things building
again.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-25 11:52:50 +02:00
Jukka Rissanen 643cc4a22c samples: net: echo-client: Fix compile warning
Fixes this function parameter datatype warning:

expected ‘k_thread_stack_t * {aka struct _k_thread_stack_element *}’
 but argument is of type ‘u8_t * {aka unsigned char *}’

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-24 11:41:40 -07:00
Jukka Rissanen 62fb302396 samples: net: echo-client: Fix DTLS compilation
If DTLS was enabled, then certifacate setup function was missing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-24 11:41:40 -07:00
Johan Hedberg 5640b631b4 samples: mesh_demo: Enable relay by default for the micro:bit
The relay functionality was supposed to be always enabled rather than
always disabled on the micro:bit.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-23 12:39:52 +02:00
Adam Podogrocki 61467e019e iwdg: the sample of the use of STM32 Independent Watchdog
JIRA: ZEP-2347

Change-Id: I808e9f110681735cae45d14c5802636012f018cc
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-10-23 09:51:16 +02:00
Andrew Boie 21a7a0f576 Revert "samples: MPU: updated the memory domain test for x86."
This reverts commit 35a4c679b4.
2017-10-20 15:02:59 -04:00
Adithya Baglody 35a4c679b4 samples: MPU: updated the memory domain test for x86.
GH-3852

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-10-20 10:39:51 -07:00
Anas Nashif 321e6c2701 samples: echo client/server: test more configurations
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-20 13:22:25 -04:00
Anas Nashif 1c60c00504 samples: echo_server: remove unrelated CONFIG_ARC_INIT
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-20 13:22:25 -04:00
Jukka Rissanen 6a0c5dede7 samples: net: ieee802154: Update config to sane values
The IEEE 802.15.4 UART pipe config files in
echo_server/prj_qemu_802154.conf and echo_client/prj_qemu_802154.conf
did not had proper configuration options set. This prevents
qemu<->qemu communication between the echo-server and echo-client.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-20 12:55:55 -04:00
Chunlin Han c7a55004bd samples: fix mem_domain_apis_test doesn't be built during sanitycheck
Use platform_whitelist to specify supported boards to make sure
mem_domain_apis_test sample will be built during sanitycheck.

Signed-off-by: Chunlin Han <chunlin.han@linaro.org>
2017-10-19 09:41:27 -04:00
Andrei Emeltchenko 45c4d07287 usb: Add missing tag to sanity check configuration
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-19 09:30:58 -04:00
Andrei Emeltchenko 44a3cca2e2 usb: Remove default Vendor and Product ID
Vendor ID and Product ID should be assigned on build time by
respective process.

For sanity check we assign some random values which are only used for
build tests and should not be used for real products.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-19 09:30:58 -04:00
Johan Hedberg ee107baad9 samples: mesh_demo: Use second button to change target address
It's been observed that that the relay toggling functionality is not
very useful, and that it's better left enabled always. Change the
purpose of the second button to instead modify the target address that
messages sent through the first button get directed to. By default the
destination is the group address, i.e. all nodes receive the message.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-18 16:08:22 -04:00
Paul Sokolovsky 5cbfa397c5 samples: sockets: dumb_http_server: Use big payload by default
This sends out 2KB+ payload (i.e. guaranteedly more than 1 network
packet). When this sample was initially written, using such payload
quickly let to a deadlock somewhere in the network stack. However
as of now, running with such payload can sustain testing with
"ab -n10000" (10000 consecutive HTTP requests using Apache Bench),
so set is as a default, to serve as a mark point against possible
future regressions.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-18 12:38:36 -04:00
David B. Kinder 4600c37ff1 doc: Fix misspellings in header/doxygen comments
Occasional scan for misspellings missed during PR reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 19:40:29 -04:00
Michael Scott 1965e5e9fc net: lwm2m: add RD client callbacks for app
Applications may want to be notified when various events
happen in the LwM2M rd client.  Let's implement an event
callback which sends: connect, disconnect and update events.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
Robert Chou b93eb8dee1 net: lwm2m: add firmware push support
1. Add handling block1 option in handle_request(). The basic idea is
   to declare structure block_context at compiled time and use "token"
   as a key to pick up the on-going block cotext. It should be able to
   support multiple blockwise transfer concurrently
2. Use write callback implemented in lwm2m_obj_firmware to deal w/ the
   update state transition and than call the callback registered by the
   application
3. move default_block_size to lwm2m_engine.c to share between
   lwm2m_engine and lwm2m_obj_firmware_pull

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
[michael.scott@linaro.org: rebased on LwM2M net_app changes.]
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
Robert Chou d9f5fe7455 net: lwm2m: add state machine for firmware pull update
1. Parse firmware pull URI
2. Add lwm2m_firmware_get/set_update_cb() for application to register
   callback. This is because we want to check the update_state before
   we pass to the application
3. Add lwm2m_firmware_get/set_update_result() and
   lwm2m_firmware_get/set_update_stat() to manage the state transition
   as well as the sanity check

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
[michael.scott@linaro.org: rebased on net_app framework and
lwm2m_message refactoring.]
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
David B. Kinder ee71332b99 doc: fix doc misspellings
Found some spelling issues missed during regular PR review

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 14:31:52 -04:00
Jukka Rissanen 6f41e3a191 samples: net: http_client: Disable OPTIONS method
As many HTTP servers do not support OPTIONS method, disable it
by default.

Fixes #4325

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-17 13:52:26 -04:00
Jukka Rissanen e5958d3a8d sample: net: mdns: Add mDNS responder application
This application does not do anything itself, it just waits
mDNS queries and responds to them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-17 08:36:39 -04:00
Harry Jiang 17404abed3 samples: environmental_sensing: fix the data type for read_u32()
Signed-off-by: Harry Jiang <explora26@gmail.com>
2017-10-17 09:10:26 +03:00
Paul Sokolovsky a39ec5f72c drivers: slip: Rework logging to follow conventions
Previously, there was boolean CONFIG_SLIP_DEBUG, which effectively
switched between "logging off" and "debug-level logging". Instead,
switch to CONFIG_SYS_LOG_SLIP_LEVEL (the naming of the option follows
existing conventions) which allows to select any of the standard 5
logging levels.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-16 12:31:17 -04:00
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