Commit graph

2626 commits

Author SHA1 Message Date
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
Luiz Augusto von Dentz b3cfabab63 Bluetooth: Remove CONFIG_BLUETOOTH_GATT_DYNAMIC_DB
Removes CONFIG_BLUETOOTH_GATT_DYNAMIC_DB in preparation to the
introduction of bt_gatt_unregister.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Aska.Wu 2970e8beae samples: coaps_server: add prj_frdm_k64f.conf
Be able to test coaps server on frdm k64f board.

Jira: ZEP-1878
Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-06-14 09:51:34 +03:00
David B. Kinder d1bdb3e092 doc: fix board/sample broken links
Some files have moved from their original location, or are no longer
available.  For the mbedtls samples, tweak the link to point to a page
where links for current and previous downloads can be found.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-13 20:49:13 -04:00
Andrew Boie fed3331c9f mpu_stack_guard_test: use k_thread_create()
Issue: ZEP-2270
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-13 11:04:05 -05:00
Leandro Pereira cf05b11924 samples: net: Do not assume TCP connection was successful
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-13 10:33:41 +03:00
David B. Kinder 342bdda760 doc: spelling fixes in samples/ and boards/
regular spelling check on .rst files

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-12 18:28:08 -04:00
Jukka Rissanen 57df515028 samples: net: echo-client: Fix compile error
This commit fixes compile error caused by commit 39962dc9
"samples: use k_thread_create()"

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-12 18:01:50 -04:00
Andrew Boie e87eacacfa samples: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Jukka Rissanen e90f4e1486 sample: net: Add https-client sample application
This https-client sample starts to send HTTP GET/HEAD/POST
requests same way as http-client, to https server that can
be found in net-tools repository.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-09 09:56:21 +03:00
Jukka Rissanen 393ab90785 samples: net: Fix README.rst file documentation
Various network samples contained QEMU slip setup instructions
or those instructions were missing. A reference doc in
doc/subsystems/networking/qemu_setup.rst file already has the
setup instructions for QEMU. So add a reference to that file
in samples/net/*/README.rst files and remove unnecessary slip
setup instructions in relevant files.

Fix various typos in readme files at the same time.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-09 09:55:37 +03:00
Anas Nashif 3405607d9e license: add missing licenses and copyright
We were missing license boilerplate in many files, add them

Jira: ZEP-1464

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-08 10:41:56 -04:00
Sharron LIU c282811983 samples: static_lib: conditional assign BOARD (?=)
The sample app "static_lib" is very important to Zephyr user, which
demonstrate how to build and link a static lib.
ISSM team wanted to integrate this app in their IDE for quark platforms.
However they find the in "static_lib/hello_world/Makefile" BOARD is
hardcoded as qemu_x86.

This patch supports other BOARD passed from build command.
I have verified this app working fine @Arduino101.

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-06-08 07:55:25 -05:00
Sharron LIU 3970cd4a87 samples: fixed typo in README.rst
Per ISSM team feedbacks:
“demostrating” >> “demonstrating”
“demonstates” >> ”demonstrates”

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-06-07 22:53:54 -04:00
Andrew Boie 489d7475f8 samples: restore cpp_synchronization test
Issue: ZEP-2172
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-06 20:37:11 -04:00
Leandro Pereira cb0f81f25f samples: dns_resolve: Clarify documentation about DNS configuration
Add clarification that the DNS server configuration must be edited in
the respective prj.conf file.

JIRA: ZEP-2040
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-03 15:02:14 -04:00
Florian Vaussard 5671c15fee samples: blink_led: Add support for STM32F412
The STM32F412 has PWM output capabilities. Add support to the blink_led
samples.

Tested using a Nucleo STM32F412ZG board (PWM output on pin 28 of the
CN11 Morpho connector and pin 29 of the CN10 Zio connector).

Change-Id: I75fb986fa97bd1c07c6375938430e7963297cd9d
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-06-02 14:11:13 -04:00
Florian Vaussard acdbf7d093 samples: blink_led: Add support for STM32F413
The STM32F413 has PWM output capabilities. Add support to the blink_led
samples.

Tested using a Nucleo STM32F413ZH board (PWM output on pin 28 of the
CN11 Morpho connector and pin 29 of the CN10 Zio connector).

Change-Id: I3b25b09cab54265b28088ac9681aec588d9d48b5
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-06-02 14:11:13 -04:00
Jukka Rissanen 3616ec145b samples: net: http_client: Increase the number of buffers
The number of RX and TX buffers is increased to 64 as the
earlier limit can cause memory exhaust in some cases.

Jira: ZEP-2223

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-02 12:43:52 +03:00
Jukka Rissanen bad6e28827 samples: net: dtls_client: Fix Coverity warning
This fix is basically a no-op as the rx_buf pointer cannot be null
in practice, but in order to avoid Coverity complaining about
it add some null pointer checks to the UDP handling code.

Coverity-CID: 170124
Jira: ZEP-2235

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-02 12:34:50 +03:00
Tomasz Bursztyka cced7fd47a api/spi: Change transceive functions signature
Instead of NULL terminated buffer arrays, let's add a parameter for each
that tells the number of spi_buf in it.

It adds a little bit more complexity in driver's side (spi_context.h)
but not on user side (bufer one has to take care of providing the NULL
pointer at the end of the array, now he requires to give the count).

This will saves a significant amount of bytes in more complex setup than
the current dumb spi driver sample.

Fix and Use size_t everywhere (spi_context.h was using u32_t).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-06-01 10:49:30 -04:00
Jukka Rissanen 7d13261bd9 samples: net: zperf: Fix llvm compiler warnings
Jira: ZEP-1884

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-01 10:30:21 -04:00
Leandro Pereira 7a972c0229 samples: mqtt_publisher: Try connecting a few times before giving up
Waiting for an NET_EVENT_IF_UP before trying to connect isn't sufficient
in some cases; for instance, on devices using the MCUX HAL, such as the
FRDM-K64F, the interface will have the NET_IF_UP flag set even though
the link negotiation didn't yet complete.

Executing this sample on such board will produce the following output.
Notice the "Enabled 100M..." message right after trying to connect.

    [dev/eth_mcux] [DBG] eth_0_init: MAC 00:04:9f:6f:91:da
    net_context_connect error Is the server (broker) up and running?
    [publisher:247] network_setup: -60 <ERROR>

    Bye!  [dev/eth_mcux] [INF] eth_mcux_phy_event: Enabled 100M
    full-duplex mode.

Even though the returned error is ETIMEDOUT, increasing
net_context_connect()'s timeout parameter to several seconds isn't
sufficient; other steps performed by network_setup() after the link has
been fully established are necessary.  As a stopgap measure, try
connecting a few times before giving up (more than one connection
attempt should be made by application in most cases, anyway.)

It might be the case that we need events to monitor ethernet link
(re)negotation in addition to the NET_IF_UP bit.

Jira: ZEP-2036
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-31 17:16:28 -04:00
Johan Hedberg d2ba7950c5 samples: boards/microbit: Use 250 ticks per second for smooth display
To avoid display flickering, use 250 ticks per second instead of the
default 100.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 12:29:11 +03:00
Johan Hedberg a90735d64c samples: microbit/pong: Disable advertising when connected
The state machine of the game assumes that the user needs to
explicitly re-select multiplayer game when disconnected. We need to
therefore make sure that advertising stays off as soon as the first
connection happens.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 10:11:09 +03:00
Johan Hedberg eb89db26b5 samples: microbit/pong: Fix disabling sound when ending game
Occasionally the sound might stay enabled for the restart timeout (2
seconds) if the ball would hit the wall right before missing the
paddle. Ensure that it's disabled whenever the game ends.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 10:11:09 +03:00
Jukka Rissanen 35ef580389 samples: net: coaps_client: Fix testcase.ini
The platform list was incorrectly set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 17:35:20 -04:00
Jukka Rissanen 5a0b4976d9 samples: net: coaps_client: Fix compile issues
The coaps_client was bit rotted and did not compile
correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 17:35:20 -04:00
Jukka Rissanen e7c52a492f samples: net: mbedtls_dtlsclient: Fix testcase.ini
The platform list was incorrectly set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:51:35 +03:00
Jukka Rissanen 27990f77e1 samples: net: mbedtls_dtlsclient: Fix compile issues
Some net_pkt API changes were not done for this sample.

Jira: ZEP-2072

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:51:35 +03:00
Jukka Rissanen eeaa29666b net: http: Handle HTTPS connection closing gracefully
If the HTTPS connection is closed, then properly handle call to
HTTP parser init in case of error and also remove any pending
data that belong to old connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:50:33 +03:00
Johan Hedberg 1bb9a04912 samples: microbit/pong: Fix refreshing display upon disconnect
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg 190b0d1a10 samples: microbit/pong: Filter out spurious button presses
The buttons on the microbit cause quite easily "ghost" key presses.
Add a simple filter that ignores button presses from the same button
that happen less than 100ms from each other.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg 0b16e8ada5 samples: microbit/pong: Increase ISR stack size
The stuff that the GPIO button callback does (in particular the printk
calls) requires more stack space from the ISR stack. Increase it to 1k
from the default 640.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg 3357813373 samples: microbit/pong: Analyze kernel stacks periodically
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Luiz Augusto von Dentz f8c4a34663 Bluetooth: ipsp: Enable CONFIG_BLUETOOTH_SHELL
This enabled testing CONFIG_BLUETOOTH_SHELL with configuration other
than btshell and enables ipsp sample to use bt shell module which
allows to disconnect, print metrics, etc.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-29 10:42:21 +03:00
Vincenzo Frascino 68f3b71b5d arm: core: mpu: Add core support to NXP MPU
This patch add arm core MPU support to NXP MPU driver.

With this feature it is now possible to enable stack guarding on NXP
MPUs.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-05-28 09:18:54 -05:00
Johan Hedberg 9516d63836 Bluetooth: Remove support for NBLE
NBLE has been deprecated for a few releases now and can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-25 09:03:16 -07:00
John Andersen 7985e917c9 samples: net: mqtt_publisher: fixed formatting
README.rst had formatting which was making things disappear in the
online documentation.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-05-25 18:48:49 +03:00
Johan Hedberg 9e2fb2f3ad samples: microbit/pong: Add basic sound support
Add beeps whenever the ball hits the walls or the paddle. Requires a
piezo buzzer connected to pin 0.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07:00
Johan Hedberg 5e59f13ca3 samples: microbit/pong: Add BLE-based multiplayer support
Add support for connecting two micro:bit devices to play pong between
themselves.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07:00
Johan Hedberg 9a7cb7134a samples: microbit/pong: Add initial draft of a pong game
Add initial draft of a pong game using the display on the micro:bit
and its two buttons. This draft only supports a solo game where the
ball bounces from the "roof" and lets the player play against himself.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07:00
Jukka Rissanen 11aee50eef sample: net: http: Add Basic auth support to server sample
Basic auth support was missing from HTTP server sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-23 18:01:04 +03:00
Tomasz Bursztyka 0938ccbbc1 samples/spi: Add a quick test for spi_release() API function
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka d9007a09f8 samples/spi: Add an asynchronous call test
This gives a quicke example on how to use SPI asynchronous calls with
kernel's k_poll API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka 761a1d9429 api: Add asynchronous call support to SPI API
Adding a struct k_poll_signal parameter to driver's API unique
exposed function.

If not NULL, the call will be handled as asynchronous and will
return right after the transaction has started, on the contrary
of current logic where is waits for the transaction to finish
(= synchronous).

In order to save stack, let's move the device pointer to struct
spi_config. So the call is still at a maximum of 4 parameters.

Adapting spi_dw.c and spi driver sample to the change so it still
builts.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka cd54dc66f2 samples: Add an SPI driver test application
This application intents to test an SPI driver by looping over MISO/MOSI
line where the controller will then send data to itself.

It will test various buffer tx/rx schemes.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Jukka Rissanen 63ca45b222 samples: net: http: Remove Arduino-101 config from server
There is not enough memory to run the HTTP server sample
application in Arduino-101 so remove the config file.

Jira: ZEP-2157

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-19 16:05:38 +03:00
Anas Nashif 51f9318a32 samples: lcd_hd44780: return if binding fails
Coverity-ID: 151980
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 11:19:11 -05:00
Anas Nashif 6aa77e9f3e Revert "net: zoap_server: Unify Makefile and add prj file"
This reverts commit 350d5d4d60.

This change break with many boards and leaves prj.conf unused.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 15:09:15 +03:00
Jukka Rissanen c9d21ef831 samples: net: http: Remove obsolete files from server sample
There was some left overs from earlier version of http_server
sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-18 15:07:02 +03:00
Wu Jiequan 350d5d4d60 net: zoap_server: Unify Makefile and add prj file
Modify the Makefile to unify with other sample apps and
add the arduino 101 configuration file.

Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-05-17 09:37:40 +03:00
Vincenzo Frascino 8162bb63c4 samples: mpu_test: Add controller specific write
This patch add a controller specific write function and fixes a
documentation error in the mpu_test README file.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-05-16 09:28:06 -05:00
Vincenzo Frascino 14a892f7a4 samples: Add mpu stack guard test
This patch adds the mpu_stack_guard_test to the available samples.
The purpose of this test is to exercize the thread stack guard enabled
via MPU on arm platforms.

Change-Id: I4665a20956d9e6d0dd4b5cc862e82040a53afafc
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-05-16 09:28:06 -05:00
Vincenzo Frascino 1a1df7cc64 samples: synch: Add Thread Stack Guards conf
This patch adds the Thread Stack Guards configuration option to the
synchronization sample.

This is meant to be an easy way to prove that the MPU can be dynamically
programmed on the supported platforms.

Change-Id: I77fbe6af3303ff8a2904768abd4cc9797f03c092
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-05-16 09:28:06 -05:00
Paul Sokolovsky 3cb13b9687 subsys: console: Add buffered output support to console subsystem
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-15 15:56:56 -04:00
Erwan Gouriou 19a91c0272 soc: stm32l476rg: rename SOC config flag
Rename SOC_STM32L476XX to SOC_STM32L476XG to keep flash
size information.
Aim is to be able to distinguish flash size variants of
the SoC when needed (for instance in dts/arm/st/mem.h file)

Change-Id: I834bb5b83c24c39e90c0492a2b22a7c7802de361
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-05-15 13:22:54 -04:00
Youvedeep Singh 1da0a9eebd cdc_acm : Restrict writing more than 4 bytes into TX USB Endpoint.
Sometime it is observed on the Arduino 101 that when we write more than
4 bytes into TX USB Endpoint, first 4 bytes are getting repeated
(frequency of occurrence ~1/3000).

This patch does following :-

1. In sample application "cdc_acm", it adds capability to
handle partial transfer data incase data is transferred partially
if exceeds maximum data transfer size.
2. It restricts write of more than  4 bytes into TX USB Endpoint.
This is work around to  avoid issue occarance.

Jira: ZEP-2074

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-13 15:12:27 -04:00
Jukka Rissanen a174d2eba7 net: http: Add HTTP server library support
This commit creates a HTTP server library. So instead of creating
a complex HTTP server application for serving HTTP requests, the
developer can use the HTTP server API to create HTTP server
insteances. This commit also adds support for creating HTTPS servers.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Jukka Rissanen 19868313fc net: samples: Fix the BT compilation in sample API
The CFLAGS and object path were set incorrectly for Bluetooth.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Jukka Rissanen d4c5cc10e4 net: samples: Add support to wait both IPv4 and IPv6
The net_sample_app_init() is now able to wait that both IPv4
and IPv6 addresses are setup before continuing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Carles Cufi 6c9e563c92 Bluetooth: Move common code to common/
Since more and more code is going to be reused by both the Host and the
Controller, this commit introduces a common/ folder that will contain
everything that is not tied to one of the two components but shared by
them.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-12 12:56:14 +03:00
Andrew Boie 39962dc92c samples: use k_thread_create()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 20:24:22 -04:00
Andrei Emeltchenko bca1077d3c samples: ipm_mailbox: Remove unneeded definitions
Make sample working for other architectures.
SCSS_REGISTER_BASE and SCSS_SS_STS are defined in soc.h

Change-Id: Ie477520d2fb9bfcbbb5038ff42356a56d8180a1f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-05-10 09:08:58 -04:00
David B. Kinder 2f41cb8329 doc: misspelling and UTF-8 fixes
More general spelling fixes, and cleaning up stray UTF-8 characters
such as curly-quotes, em- and en-dashes.  Use replacement strings
for |reg| and |trade|.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-05-09 20:15:49 -04:00
Johan Hedberg 18593e74e1 Bluetooth: samples: Fix passkey display
Passkeys are always 6 digits in length and should therefore be
zero-padded if necessary.

Jira: ZEP-2113

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-05 11:25:57 +03:00
Jukka Rissanen dc0fc57917 net: samples: Common application init API
This creates a common API for network sample applications for
setting up IP addresses etc. The HTTP client application is modified
to use this API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-04 15:58:45 -04:00
Jukka Rissanen 70f334d9f2 http: client: Create a HTTP library
Instead of separate sample application that does everything
related to HTTP client connectivity, create a HTTP client library
that hides nasty details that are related to sending HTTP methods.
After this the sample HTTP client application is very simple and
only shows how to use the client HTTP API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-04 15:58:45 -04:00
Carles Cufi 689bd232f8 Bluetooth: Reshuffle Kconfig options
In order to achieve proper sharing of configuration options, everything
that is common to both the Host and the Controller should now be placed
in the top-level Kconfig file, and Controller-only options are in the
controller/ Kconfig one.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-04 11:27:04 +03:00
Erwan Gouriou 7991784297 samples: sensor: hts221
This commit provides sample application for sensor hts221.
By default, it is enabled on board disco_l475_iot1

Change-Id: I535fac8a670fa89cc1cae15ea1abe9cfe4b6c56b
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-05-03 13:51:37 -04:00
Justin Watson 558281b096 arch: sam3x: update Kconfig options after move to SAM SoC family tree
The files for the Arduino Due needed to be updated to use the new
configuration when the SoC moved from the atmel_sam3 directory to
the atmel_sam/sam3x directory.

Jira: ZEP-2067

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-05-03 13:51:37 -04:00
Carles Cufi 7a0588ac9f samples: bluetooth: Set DT baud rate for nRF5x boards
Since most of nRF5x-based boards can be used either as a standalone
development kit or as a BLE controller to connect to an external host,
add DT overlays so that the baud rate is correctly set to 1Mbit/s
whenever building the hci_uart sample application.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-03 08:43:17 -05:00
David B. Kinder 1d36cfba90 doc: change gerrit references to github
We're moving the project code to GitHub folks, so change references
in the documentation from gerrit over to GitHub:
https://github.com/zephyrproject-rtos/zephyr

Change-Id: Ic491a62ed43fc799eb5698e92435cb6eb4d89394
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-28 21:21:06 +00:00
Paul Sokolovsky ddf23f3167 samples: net: dns_resolve: Clarify that DNS queries aren't immediate
The sample in its default configuration waits for DNS server
configuration via IPv4 or IPv6 specific means. Until this
information is receives, DNS querying won't even start. Make
diagnostic messages explicit of this fact, because if user
doesn't have required services available in the network, the
sample will appear to just hang.

Jira: ZEP-2061

Change-Id: I56a5b7354a2d1239a35d8334ed95a15ebd19254f
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:12 +03:00
Ravi kumar Veeramally e4d8900cc6 net: samples: Use correct API to get net pkt length
net_pkt_get_len() is the correct API to get network packet
length.

Jira: ZEP-2076

Change-Id: Ifff6f3d5df28b3684cc8bb3758f9e8bccd5d4534
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-04-28 15:01:11 +03:00
Bogdan Davidoaia efc3ba6b98 samples: net: ieee802154: add KW41Z config file
Add config file to be used for testing KW41Z's IEEE 802.15.4 driver.

Jira: ZEP-2026
Change-Id: I7042c57ad33ff72b35d24fbf28085b99b2301726
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-04-28 15:01:10 +03:00
Jukka Rissanen f7d291ea90 samples/dns: Add config file for Arduino-101 and FRDM-K64F
The dns_resolve sample application did not had project file for
two boards that the README file is talking about, so adding them here.

Jira: ZEP-2040

Change-Id: I68e825854a171b09d56df91ab80ce5d9349733f6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-28 15:01:09 +03:00
Paul Sokolovsky 25307d5331 net: net_pkt_append: Refactor to return length of data actually added
For stream-based protocols (TCP), adding less data than requested
("short write") is generally not a problem - the rest of data can
be sent in the next packet. So, make net_pkt_append() return length
of written data instead of just bool flag, which makes it closer
to the behavior of POSIX send()/write() calls.

There're many users of older net_pkt_append() in the codebase
however, so net_pkt_append_all() convenience function is added which
keeps returning a boolean flag. All current users were converted to
this function, except for two:

samples/net/http_server/src/ssl_utils.c
samples/net/mbedtls_sslclient/src/tcp.c

Both are related to TLS and implement mbedTLS "tx callback", which
follows POSIX short-write semantics. Both cases also had a code to
workaround previous boolean-only behavior of net_pkt_append() - after
calling it, they measured length of the actual data added (but only
in case of successful return of net_pkt_append(), so that didn't
really help). So, these 2 cases are already improved.

Jira: ZEP-1984

Change-Id: Ibaf7c029b15e91b516d73dab3612eed190ee982b
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:09 +03:00
Piotr Mienkowski f9a85815c2 samples: net: remove redundant Kconfig options for sam_e70_xplained
- Manual MAC address settings
- Default ETH driver initialization priority

Change-Id: I6294e2f66623087dfdc131344a94d0e9f2edc6b4
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-28 15:01:09 +03:00
Ramesh Thomas c759ed1f94 samples: power: Time is passed as milliseconds in tickless kernel
In tickless kernel mode, time parameter of _sys_soc_suspend is in
milliseconds. Based on the kernel mode use the correct
mulitplier to convert to seconds.

Jira:1821
Change-Id: Idf156f56ece79a82729ebb124d1552a5eeb69e25
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-04-27 13:46:35 +00:00
Ramesh Thomas 700712f869 samples: tickless: Enables tickless kernel option in some apps
Adds changes to enable existing kernel and timer tests and samples to
be used to test the tickless kernel feature.

Updated samples/philosophers and tests/kernel/timer/timer_api apps

Run the tests using following commands
make pristine && make BOARD=<board> CONF_FILE=prj_tickless.conf qemu
Board could be any of the following
qemu_x86
quark_se_c1000_devboard

Jira: ZEP-339 ZEP-1812
Change-Id: I1530b19b79ddeb0e2181594caf15f3ac28ff51f4
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-04-27 13:46:33 +00:00
Tomasz Bursztyka fcb4ea1383 samples/crypto: Use sys_log properly
Sys log already break a line after each line, by default, so removing
the '\n' on log messages.

Enabling support for sys log colors.

Change-Id: Ica3a601aba0bbbd2d9438b41fb7bca0aad9c05f4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:35 +00:00
Tomasz Bursztyka 50151db3c5 samples/crypto: Fix memory leaks
Don't return without freeing the session when relevant.

Change-Id: I9e5903791f8eb54026c4bb2ddda9f1fe9f3f7bb3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:35 +00:00
Tomasz Bursztyka 0b5946e4b7 drivers/crypto: Use a proper driver name for TinyCrypt shim driver
Change-Id: I526677c98fa70e46f92dbb4e4569707e1cb8469a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:29 +00:00
Kumar Gala 5899d750e8 samples: Cleanup uint types in SEGGER SystemView
Convert sample to using new u{8,16,32}_t types

Change-Id: I0f5d9ad6fecef59cd1552e48e0cf02173d631916
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-25 22:09:11 +00:00
Marc Moreno 3376c67691 samples: Add an MPU test suite
This patch contains a MPU test with a set of options to check
the correct MPU configuration against the following security
issues:
    * Read at an address that is reserved in the memory map.
    * Write into the boot Flash/ROM.
    * Run code located in SRAM.

The MPU test application uses the Zephyr shell.

Change-Id: Ib40dc76b082b800884fd636a1509a0712227d681
Signed-off-by: Marc Moreno <marc.morenoberengue@linaro.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-04-25 21:53:22 +00:00
Leandro Pereira 6ccfe5aa14 samples: Add SEGGER SystemView sample application
This sample application uses the kernel system logger already present
in Zephyr and publishes events through the SEGGER RTT protocol, so it's
available by the SEGGER SystemView application.

[1] https://www.segger.com/systemview.html?p=1731

Jira: ZEP-1463
Change-Id: If1eba4644b95175660b3040bdc4b2717b2cfc9ad
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-25 02:16:37 +00:00
Kumar Gala e547533435 samples: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08c682bfc0b80dfa88de859e90a011bcd2db2762
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:53 -05:00
Kumar Gala a509441210 net: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I4ec03eb2183d59ef86ea2c20d956e5d272656837
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:30:38 -05:00
Jukka Rissanen da6eba463d Bluetooth: ipsp: Fix compile error in sample app
Some incompatible changes were introduced when net and bluetooth
branches were changed at the same time.

Change-Id: Ifa03f85d26a63ade0fcc029377d54850c0e92451
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-21 15:44:20 +03:00
Tomasz Bursztyka e5896906f6 net: Rename all *_BUF() macros to *_HDR()
Most of these macros are not exactly exposing a buffer, but a specific
header pointer (ipv6, ivp4, ethernet and so on), so it relevant to
rename them accordingly.

Change-Id: I66e32f7c3f2bc75994befb28d823e24299a53f5c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:51 +03:00
Tomasz Bursztyka db11fcd174 net/net_pkt: Fully separate struct net_pkt from struct net_buf
- net_pkt becomes a stand-alone structure with network packet meta
  information.
- network packet data is still managed through net_buf, mostly named
  'frag'.
- net_pkt memory management is done through k_mem_slab
- function got introduced or relevantly renamed to target eithe net_pkt
  or net_buf fragments.
- net_buf's sent_list ends up in net_pkt now, and thus helps to save
  memory when TCP is enabled.

Change-Id: Ibd5c17df4f75891dec79db723a4c9fc704eb843d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Tomasz Bursztyka bf964cdd4c net: Renaming net nbuf API to net pkt API
There have been long lasting confusion between net_buf and net_nbuf.
While the first is actually a buffer, the second one is not. It's a
network buffer descriptor. More precisely it provides meta data about a
network packet, and holds the chain of buffer fragments made of net_buf.

Thus renaming net_nbuf to net_pkt and all names around it as well
(function, Kconfig option, ..).

Though net_pkt if the new name, it still inherit its logic from net_buf.
'
This patch is the first of a serie that will separate completely net_pkt
from net_buf.

Change-Id: Iecb32d2a0d8f4647692e5328e54b5c35454194cd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Kumar Gala 3c454017b4 Merge "Merge bluetooth branch into master" 2017-04-20 16:55:36 +00:00
Kumar Gala 789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Johan Hedberg c52fa3c424 Merge bluetooth branch into master
- newlib related fixes for the AT parser
 - Channel Selection Algorithm #2 support (Bluetooth 5.0 feature)
 - Better tracking of outgoing data (with callback support)
 - Various smaller cleanups & fixes

----------------------------------------------------------------
Carles Cufi (3):
      Bluetooth: HCI: Add Bluetooth 5.0 LE commands and events
      Bluetooth: HCI: Naming consistency tweaks
      Bluetooth: Use event masks instead of bits in controller and host

Johan Hedberg (8):
      Bluetooth: hci_raw: Fix ECC support
      Bluetooth: Add support for tracking transmitted packets
      Bluetooth: ATT: Enforce flow for incoming requests & indications
      Bluetooth: SMP: Track when last key distribution PDU has been sent
      Bluetooth: Introduce a timeout for synchronous HCI command sending
      Bluetooth: ATT: Fix bogus CONTAINER_OF() usage
      Bluetooth: Introduce flow control for outgoing ATT packets
      Bluetooth: ATT: Start response timer only after actual transmission

Kumar Gala (3):
      Bluetooth: AT: use explicit unsigned char to avoid array subscript error
      Bluetooth: AT: Fix building with newlib
      Bluetooth: AT: Unit: Fixup include search path

Luiz Augusto von Dentz (4):
      Bluetooth: ipsp: Add TX pools for TCP
      Bluetooth: L2CAP: Try to allocate segment from the original pool
      net: buf: Add net_buf_reset
      Bluetooth: L2CAP: Reuse request buffer to respond

Vinayak Chettimada (5):
      Bluetooth: controller: Rename channel/chnl to chan
      Bluetooth: HCI: Add Bluetooth 5.0 FeatureSet field's bit mapping
      Bluetooth: Fix missing LE conn param req bit in set LE evt mask
      Bluetooth: controller: Support BT 5.0 feature set bit fields
      Bluetooth: controller: Channel Selection Algorithm #2

 include/bluetooth/hci.h                           | 495 +++++++++++++++--
 include/bluetooth/l2cap.h                         |   2 +-
 include/net/buf.h                                 |   9 +
 samples/bluetooth/ipsp/src/main.c                 |  15 +
 subsys/bluetooth/controller/Kconfig               |   7 +
 subsys/bluetooth/controller/hal/nrf5/radio.c      |   4 +-
 subsys/bluetooth/controller/hal/radio.h           |   2 +-
 subsys/bluetooth/controller/hci/hci.c             |  95 ++--
 subsys/bluetooth/controller/ll_sw/ctrl.c          | 622 ++++++++++++++++------
 subsys/bluetooth/controller/ll_sw/ctrl.h          |  71 ++-
 subsys/bluetooth/controller/ll_sw/ctrl_internal.h |  25 +-
 subsys/bluetooth/controller/ll_sw/ll.c            |  24 +-
 subsys/bluetooth/controller/ll_sw/pdu.h           |  12 +-
 subsys/bluetooth/host/Kconfig                     |  31 ++
 subsys/bluetooth/host/at.c                        |   2 +-
 subsys/bluetooth/host/at.h                        |   2 +-
 subsys/bluetooth/host/att.c                       | 230 ++++++--
 subsys/bluetooth/host/conn.c                      | 111 +++-
 subsys/bluetooth/host/conn_internal.h             |  23 +-
 subsys/bluetooth/host/hci_core.c                  | 163 +++---
 subsys/bluetooth/host/hci_core.h                  |   3 +-
 subsys/bluetooth/host/hci_ecc.c                   |   2 +-
 subsys/bluetooth/host/hci_raw.c                   |   4 +
 subsys/bluetooth/host/hfp_hf.c                    |   2 +
 subsys/bluetooth/host/l2cap.c                     |  79 ++-
 subsys/bluetooth/host/l2cap_internal.h            |  12 +-
 subsys/bluetooth/host/sdp.c                       |   2 +
 subsys/bluetooth/host/smp.c                       | 117 +++-
 subsys/net/buf.c                                  |  12 +-
 tests/bluetooth/init/prj_controller_4_0.conf      |   1 +
 tests/unit/bluetooth/at/src/Makefile              |   2 +-
 tests/unit/bluetooth/at/src/main.c                |   2 +-
 32 files changed, 1695 insertions(+), 488 deletions(-)

Change-Id: I17f9e49e1347a38bc78be3bdcaa596e41d83da56
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-20 18:45:15 +03:00
Anas Nashif 7c81d7f981 samples: remove lsm9ds0 sample code which does nothing
This sensor is supported already with many features, using it to test
SPI and I2C is an overkill. For both basic I2C and SPI samples we have
the FRAM samples supporting both IOs.

Change-Id: I794e584bd540d5fe6353fa3370aac0f1d6d105dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-20 10:31:07 +00:00
Luiz Augusto von Dentz 617842edde Bluetooth: ipsp: Add TX pools for TCP
TCP requires buffers to be acked thus it retain a reference, but L2
driver actually consumes the buffer so it needs a context pool to store
to original ones.

Change-Id: Ie9083ab361d3674c33080f9e7e6c7248aaf7abc3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-20 08:58:09 +03:00
David B. Kinder 30450fea2a spell: fix doxygen comment typos: /boards /samples
Fix doxygen comment typos used to generate API docs

Change-Id: I248d53000d8e57b902b9a18fdcfc9e995142a8b3
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-19 18:38:19 +00:00
Anas Nashif 45a7e5d076 kernel: remove legacy.h and MDEF support
Change-Id: I953797f6965354c5b599f4ad91d63901401d2632
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-19 10:59:35 -05:00
Johan Hedberg 191cb2d0fc samples/boards/microbit: Add sound sample
Add a sample demonstrating sound output using PWM to a piezo buzzer
connected to the external edge connector port P0.

Change-Id: I8c0902fd935f2eb3b9979476a7540e7a0216ca63
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-18 01:55:10 +00:00
Maureen Helm 1928632a97 samples: nfc_hello: Add CONFIG_SERIAL=y to project conf
Most boards enable a serial driver by default, but the hexiwear_kw40z
does not because it uses Segger RTT for the console. This sample
requires a serial driver, so add CONFIG_SERIAL=y to its project conf
file.

Jira: ZEP-1391
Change-Id: Iee813d1054378040fe9ff72a3ca1ea7bd66bcdfe
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-04-14 05:56:53 -05:00
Vinayak Chettimada 9584456fc9 drivers: pwm: Add nRF5x GPIOTE based PWM driver
Add support for nRF5x series GPIOTE based PWM driver
implementation.

Provides upto 3 pins/channels using one HF timer, two PPI
channels per pin, and one GPIOTE config per pin.

Change-id: I6056b199ec2cff595ba8fea9f659a0338ed4635b
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-14 01:53:07 +00:00
Anas Nashif d3af7f75c9 Merge "Merge net branch into master" 2017-04-14 01:43:34 +00:00
Kumar Gala c7bc909914 tests/ztest: rename assert macros to be zephyr specific
ztest has a number of assert style macros and used a baseline assert()
that varies from the system definition of assert() so lets rename
everything as zassert to be clear.

Change-Id: I7f176b3bae94d1045054d665be8b5bda947e5bb0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-13 21:17:33 +00:00
Tomasz Bursztyka 3a3636ff7f net/ieee802154/samples: Add a Kconfig option to tweak the TX power
This can be useful to override the default value, for testing.

Change-Id: I23b559152c71955ff5aa6fd3643f1f40f5594194
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:46 +03:00
Jukka Rissanen 611ccaaf88 net: dns: Remove dns_client API and sample application
DNS resolving is better done with DNS resolve API so remove
the DNS client API which is quite hard to use.

Change-Id: Ide4973a5be674414ea6e04a35c938195cce40b6a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Jukka Rissanen abb24bb46b samples: net: irc-bot: Use DNS resolve API
Modify the code to use DNS resolve API instead of DNS client API
as the latter is being phased out.

Change-Id: I6a7618d770621fee1f502d2bc277a162c589108a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Wu Jiequan 432c750d36 net: coaps_server: add prj_arduino_101.conf file
In order to test the coaps_server sample app on
Arduino 101 board.

Change-Id: I7b393dac03a8020b7bd515c3b5b2fd961940bc21
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:44 +03:00
Wu Jiequan c84eff0be4 samples: net: http_server: Add bt test and arduino 101 support
Added bt test code in the http_server sample app and in order
to test on Arduino 101 board, added prj_arduino_101.conf file.

Change-Id: Ie68a81ee809e8618f70b5fab6fdbd66692401014
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:43 +03:00
Anas Nashif 259949d10e samples: console: fixed filter and add CONFIG_
The filter expects CONFIG_, otherwise it is noop

Change-Id: I2b0a02b6450287a090b69a12324fe7f7cf494999
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-11 03:14:26 +00:00
Anas Nashif dac15b9b71 samples: shell: fix testcase.ini to be more inclusive
Filter was wrong and sample was not being built on any boards. Exclude
platforms that do not support interrupt based UART drivers.

Jira: ZEP-2014
Change-Id: I84a690e7c93fae52335434830b83086019cfd00d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-11 03:14:25 +00:00
Anas Nashif c6f4476bf6 sensors: bmg160: fixed wrong Kconfig variable
Change-Id: I3e24420519535310728b3395c3c71a5fb3560f35
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-11 03:14:23 +00:00
Anas Nashif d7bc60f096 kernel: remove remaining microkernel references
Change-Id: Ie648dbaaf714316c21395bd43e555618013dbd19
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 20:21:05 +00:00
Anas Nashif 3781ed061b samples: usb: remove custom DBG macro and use sys_log
Change-Id: Icc83afe0c48ada9454104f0d1a7487027b1566b3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 16:08:01 +00:00
Sathish Narasimman 1f5a809178 Bluetooth: HFP HF: Add support for RING indication cb
This patch adds support for incoming RING indication callback to
notify application.

> ACL Data RX: Handle 256 flags 0x02 dlen 16   [hci0] 167174.600312
      Channel: 65 len 12 [PSM 3 mode 0] {chan 1}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0xef poll/final 0
         Length: 8
         FCS: 0x9a
        0d 0a 52 49 4e 47 0d 0a 9a                       ..RING...

Change-Id: I0469590a77d619f2a842df647d84f4d56dbd4883
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-04-08 20:11:54 +03:00
Luiz Augusto von Dentz 4d1115ab35 net: Enable context buffer pool in case TCP and 6LO are enabled
The context buffer pool was introduced to deal with TCP holding buffers
when 6LO may modify them, therefore it makes sense to have it enabled
by default when TCP and 6LO are enabled given that the code can deal
with NULL pool in case the application don't implement one.

Change-Id: I600ca31ab40c96ee27937c2e885e332b0cee4995
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-07 18:32:18 +03:00
Piotr Mienkowski afdb0e0a70 drivers: eth_sam_gmac: Fix initialization order
Atmel SAM family GMAC Ethernet driver is implementing zero-copy
networking. As a result it has to reserve a defined amount of RX
data net buffers before bringing up the interface. Since net buffer
pool is initialized by the network stack and this driver was bringing
the interface up in its initialization function the driver initialization
was performed, as a workaround, after network stack initialization. It
is not a clean solution. This patch fixes this by bringing the
interface up in interface initialization function. The driver itself
can now be initialized before the network stack is.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I65886fd6db6f27a10628e393cfabd8e5f78c08ff
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-07 12:35:51 +03:00
Maureen Helm 0ab8874fde samples: Add max30101 sample application
Adds a max30101 sample application that polls sensor data and prints it
to the console.

Jira: ZEP-720
Change-Id: I50f28eaf9ea2ff5bfbb9fb6922c4006d5c02e739
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-04-06 11:47:18 +00:00
Johan Hedberg d7a189d2ec drivers: display: mb_display: Unify image and string APIs
Both the string and image rendering may want to take advantage of
scrolling and sequential display capabilities. Consolidate the APIs so
that there's a single one for images (mb_display_image) and a single
one for strings (mb_display_print). Both take a duration parameter for
the per-frame duration as well as a mode parameter which specifies
sequential vs scrolling behavior as well as an optional looping flag.

Change-Id: Ia092d771e3f1b94afd494c7544dab988161c539e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-06 00:59:30 +00:00
Leandro Pereira bb4a2eef7f samples: net/nats: Fix parsing of MSG messages
This addresses the issues found by QA in ZEP-1012 and clarify the
documentated behavior as described in ZEP-1859.

Change-Id: I602e5749db7f6f44cf5be449b8e6f0d2ba66b69b
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-04-05 18:24:45 +00:00
David B. Kinder 1a9600b704 doc: add labels to sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: Ie5ff404ac23621dbcf6ca61734ed6f72832c1ce2
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 20:48:08 +00:00
David B. Kinder 0f77021ba7 doc: add labels to board-specific sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: Ib2d9b1cc4144bd84b1b89691a80dffd99212289d
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 20:47:53 +00:00
David B. Kinder 6a7527b5b4 doc: add labels to sensor sample docs for linking
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I37c654fb0bb7ebdf288af01e41ce5497969f8968
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 20:47:35 +00:00
David B. Kinder 7bc4890202 doc: add labels to net sample docs for linking
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I46cd75d714449de806a85dde08756c8e190488dc
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:52:06 +00:00
David B. Kinder b78ffc0e6b doc: add labels to basic sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I57d65a8888f78aa61d776f607a5db86bdb35726c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:51:47 +00:00
David B. Kinder 2bfff175ab doc: add labels to bluetooth sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: Ide66f75ca8fac0d5f65fbfc50dc9d130cf45b392
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:51:27 +00:00
Anas Nashif fb5e9b9283 samples: console: filter boards without console
Change-Id: Ifdf0da9295d54cd1e95386297eff2e5ef3d45858
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-04 19:18:15 +00:00
David B. Kinder 2a05cc1b54 doc: add labels to sample docs for linking
Docs need a label at the top so we can use :ref:`labelname` to
create a link to that doc from other docs.

Change-Id: I7d7b98f3a9d22350ca983b3558bf83f77fd6e379
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:09:30 +00:00
Johan Hedberg 7e5df0cc02 drivers: display: Enhance BBC micro:bit string output capabilities
Add a new mb_display_print() API which takes printf-style parameters
and outputs scrolling text instead of one character at a time. The
existing mb_display_str() API is renamed to mb_display_string() for
consistency, and now also takes printf-style parameters.

Change-Id: I59c42bcd74c62f05ecb6d097dc808b9e5c1984c5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-04 13:54:00 +03:00
Johan Hedberg 380d24de1d drivers: Add support for BBC micro:bit LED display
Adds a simple driver to access the 5x5 LED display found on BBC
micro:bit boards. The display is so limited that no effort is done to
try to integrate with the existing console (which would likely make
the display unusable). Instead, dedicated mb_display_* APIs are added
that are specific to this display.

References:

 https://www.microbit.co.uk/device/screen
 https://lancaster-university.github.io/microbit-docs/ubit/display/

Jira: ZEP-1990
Change-Id: I431b5b358b5f07592a60d3aed87eaab6ac20ce25
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-04 08:14:36 +03:00
Anas Nashif 341d926a04 doc: reduce levels in toc
The level was increased to 3 by mistake.

Change-Id: Ie62e1d1f49a6708c75e2947247279a095082d94e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-03 22:57:40 +00:00
Anas Nashif 7d5be2af73 Merge "Merge net branch into master" 2017-04-01 20:46:11 +00:00
Paul Sokolovsky 542c2b93d0 subsys: console: Add pull-style console API support.
This change introduces console_getchar() and console_getline() API
calls which can be used to get pending console input (either one
char or whole line), or block waiting for one. In this regard, they
are similar to well-known ANSI C function getchar/gets/fgets, and
are intended to ease porting of existing applications to Zephyr, and
indeed, these functions (shaped as an external module) are already
used by few applications.

The implementation of the functions is structured as a new "console"
subsystem. The intention is that further generic console code may be
pulled there instead of being in drivers/console/. Besides the
functions themselves, initialization code and sample applications
are included.

At this time, there're may limitations of how these functions can
be used. For example, console_getchar() and console_getline() are
mutually exclusive, and both are incompatible with callback
(push-style) console API (and e.g. with console shell subsystem
which uses this API). Again, the intention is to make a first step
towards refactoring console subsystem to allow more flexible
real-world usage, better reusability and composability.

Change-Id: I3f4015bb5b26e0656f82f428b11ba30e980d25a0
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-01 20:44:17 +00:00
Tomasz Bursztyka e027645c88 net/samples/ieee802154: Making hw sample simpler
- Let's use samples settings
- Enable both net and 15.4 shell modules
- Change prj_*.conf accordingly

Change-Id: If7e32a42c8dc7026d0580b1e94e819e1eda82e5b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:28 +02:00
Tomasz Bursztyka d2f8a5a27f net/samples: Add 802.15.4 link-layer security settings for the samples
And use them accordingly in the common code part.

Change-Id: Id91b76e5baea607c0d68eebcde6f84e4e35ca44c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka 7b8af87fdf samples/net: Remove the need for IEEE 802.15.4 stack in wpan serial
It can uses CONFIG_NET_APP_IEEE802154_* options instead.

Change-Id: I2501ca2015cfc1e68c6c384cb32c21084d2cb30d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka 26a4df620f samples/net: Uses CONFIG_NET_APP_IEEE802154_* options relevantly
In order to simplify when 802.15.4 is selected on these samples, let's
setup the device through a common code.

For this to work, RFD is now the default.

Change-Id: I46590864442f77d83f681cc0e854c94344648856
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka 0f18ce44f9 net: Rename Kconfig.samples and its main option for future changes
s/SAMPLES/APP for name shortening. Applying the change where relevant.

Not only IP addresse will be available as samples settings there but
also IEEE 802.15.4 channel, pan_id, and more for instance.

Change-Id: I05dd24989bd0c804d9588092d67044a3e063bc88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:26 +02:00
Maureen Helm e09dc931bf samples: fxos8700: Update doc references and sample output
Updates the fxos8700 sample documentation to include board
cross-references and sample output with temperature data.

Change-Id: I8d4e4d8d287806f5480316da09d4072fcf9c05ac
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-30 21:21:22 +00:00
Maureen Helm 07241cafce samples: Add fxas21002 sample application
Adds a fxas21002 sample application that uses the sensor data ready
trigger to periodically print gyroscope data.

Jira: ZEP-1392
Change-Id: Ic9d3803a41f2873aef470a2a73b3f1db44d39b50
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-30 21:19:54 +00:00
Anas Nashif 8c1a073bb1 samples: ipm sample using mailbox for Quark SE
re-add sample that was dropped by mistake and add a top level Makefile
for building and flashing two cores.

Change-Id: Ie22ac1efa7b5373999997489a2c866de19553128
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 15:53:28 -04:00
Anas Nashif 131cfa2043 samples: move ipm samples subsystem folder
Change-Id: I5737e037111f2a5eff5f824bcb72e963b1af22e5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:35 +00:00
Anas Nashif eaffffd963 samples: move usb samples subsystem folder
Change-Id: Id1696bf18dc77a0afb1180f417b2bb641ad809ab
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:34 +00:00
Anas Nashif 52448f6a2b samples: move shell sample subsystem folder
Change-Id: I9729885ec2c6ceb0367323ed9b1f72f05517b2aa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:33 +00:00
Anas Nashif da4ccce59e samples: move logger-hook sample to subsystem
Change-Id: I693ce41046bddcef21e3f634d602683f1512f927
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:33 +00:00
Anas Nashif fdd0cb70ed samples: remove legacy applications
Change-Id: I790d66f2ab14b40dd6c6fe25c59ccd97850602e7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:32 +00:00
Anas Nashif f475d2cde9 samples: grove: remove duplicate config
Duplicate Kconfig variable in prj.conf causes warning

Jira: ZEP-1880
Change-Id: I941b36a17c550d7e64759ea3266da6957ec3e82c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-26 02:10:24 +00:00
Anas Nashif 2c04055970 Merge "Merge bluetooth branch into master" 2017-03-25 11:25:43 +00:00
Johan Hedberg 93fbca0d16 Merge bluetooth branch into master
- Controller cleanups
 - Refactor controller for a cleaner Link Layer abstraction
 - SDP enhancements
 - Use sys_slist_t API wherever possible
 - Fix race condition in controller
 - Update controller to report Bluetooth 5.0 version

----------------------------------------------------------------
Carles Cufi (6):
      Bluetooth: controller: Remove unused H:4 tag macros
      Bluetooth: controller: Rename downstream API calls
      Bluetooth: controller: Introduce BLUETOOTH_LL_SW
      Bluetooth: controller: Move ll.h to an include folder
      Bluetooth: controller: Remove public address config option
      Bluetooth: controller: Move LL code from driver to ll_sw

Johan Hedberg (11):
      Bluetooth: Make bt_hci_driver instances link-time constants
      Bluetooth: shell: Fix missing initialization of param.own_addr
      Bluetooth: shell: Add command to start continuous passive scanning
      Bluetooth: Move crypto APIs to dedicated header file
      Bluetooth: Controller: Factor out ECB core code from ecb_encrypt()
      Bluetooth: Controller: Introduce big-endian variant for ECB
      Bluetooth: Introduce public big-endian AES API
      Bluetooth: Controller: Increase default TX buffer count
      Bluetooth: Use specific pointer type for conn->channels
      Bluetooth: ATT: Reorder handler struct for compactness
      Bluetooth: ATT: Refactor PDU handling

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Send service search response
      Bluetooth: SDP: Server: Handle ServiceAttributeRequest
      Bluetooth: SDP: Server: Find the attributes in the record
      Bluetooth: SDP: Server: Send ServiceAttributeResponse
      Bluetooth: SDP: Server: Support ServiceSearchAttributeRequest

Luiz Augusto von Dentz (4):
      Bluetooth: ipsp: Fix checking for NULL pointer
      Bluetooth: L2CAP: Use sys_slist_t for connection channels
      Bluetooth: L2CAP: Use sys_slist_t for server channels
      Bluetooth: L2CAP: Use sys_slist_t for fixed channels

Mariusz Skamra (2):
      Bluetooth: L2CAP: Fix TX queueing for LE CoC
      Bluetooth: tester: Fix UART issue on qemu

Matthias Ringwald (1):
      Bluetooth: Controller: Kconfig company id and subversion number

Sathish Narasimman (5):
      Bluetooth: HFP HF: SCO: Handle synchronous_conn_complete
      Bluetooth: SCO: Rename 'conn' to 'acl'
      Bluetooth: HFP HF: SCO: Handle SCO Disconnect
      Bluetooth: HFP HF: SCO Initiate Audio connection
      Bluetooth: AT: Fix reset the state during error

Vinayak Chettimada (16):
      Bluetooth: Controller: Fix RSSI feature conditional compilation
      Bluetooth: Controller: Add advertisement event indication feature
      Bluetooth: Controller: Add Kconfig range check for public address
      Bluetooth: Controller: Version 5.0 and PDU type rename
      Bluetooth: controller: Use explicit paths to internal headers
      Bluetooth: controller: Move bt_rand into separate file
      Bluetooth: Make LE Encrypt helpers public
      Bluetooth: controller: Replace 0 for pointers with NULL keyword
      Bluetooth: Fix checks for changes in connection parameters
      Bluetooth: Support connection parameter update as central
      Bluetooth: shell: Reorder commands in logical order of use
      Bluetooth: shell: Add connection update command
      Bluetooth: controller: Move PDU macros from radio.h to pdu.h
      Bluetooth: controller: Cleanup makefiles
      Bluetooth: controller: Fix mayfly caller id for thread call path
      Bluetooth: controller: Fix race waiting for ticker job to complt

 drivers/bluetooth/hci/h4.c                         |   2 +-
 drivers/bluetooth/hci/h5.c                         |   2 +-
 drivers/bluetooth/hci/spi.c                        |   2 +-
 include/bluetooth/bluetooth.h                      |  15 +-
 include/bluetooth/conn.h                           |  11 +
 include/bluetooth/crypto.h                         |  77 ++
 include/bluetooth/hci.h                            |  24 +
 include/bluetooth/l2cap.h                          |   4 +-
 include/drivers/bluetooth/hci_driver.h             |   2 +-
 samples/bluetooth/ipsp/src/main.c                  |   6 +-
 subsys/bluetooth/Kconfig                           |   2 +-
 subsys/bluetooth/controller/Kconfig                |  39 +-
 subsys/bluetooth/controller/Makefile               |  23 +-
 subsys/bluetooth/controller/hal/Makefile           |   1 +
 subsys/bluetooth/controller/hal/ecb.h              |   3 +
 subsys/bluetooth/controller/hal/nrf5/Makefile      |   3 +
 subsys/bluetooth/controller/hal/nrf5/cntr.c        |   4 +-
 subsys/bluetooth/controller/hal/nrf5/ecb.c         |  64 +-
 subsys/bluetooth/controller/hal/nrf5/radio.c       |  17 +-
 subsys/bluetooth/controller/hal/nrf5/rand.c        |   4 +-
 subsys/bluetooth/controller/hal/radio.h            |   5 -
 subsys/bluetooth/controller/hci/Makefile           |   4 +
 subsys/bluetooth/controller/hci/hci.c              |  76 +-
 subsys/bluetooth/controller/hci/hci_driver.c       | 217 +-----
 subsys/bluetooth/controller/include/ll.h           |  58 ++
 subsys/bluetooth/controller/ll/ll.h                |  29 -
 subsys/bluetooth/controller/ll_sw/Makefile         |   4 +
 subsys/bluetooth/controller/ll_sw/crypto.c         |  54 ++
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c   | 660 +++++++++--------
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h   |  54 +-
 .../controller/{ll => ll_sw}/ctrl_internal.h       |   6 +-
 subsys/bluetooth/controller/{ll => ll_sw}/ll.c     | 237 ++++++-
 subsys/bluetooth/controller/{ll => ll_sw}/pdu.h    |  64 +-
 subsys/bluetooth/controller/ticker/Makefile        |   3 +
 subsys/bluetooth/controller/ticker/ticker.c        |  12 +-
 subsys/bluetooth/controller/util/Makefile          |   1 +
 subsys/bluetooth/controller/util/memq.c            |   5 +-
 subsys/bluetooth/host/Kconfig                      |  16 +-
 subsys/bluetooth/host/Makefile                     |   2 +
 subsys/bluetooth/host/at.c                         |   7 +-
 subsys/bluetooth/host/att.c                        | 204 ++++--
 subsys/bluetooth/host/conn.c                       | 148 +++-
 subsys/bluetooth/host/conn_internal.h              |  12 +-
 subsys/bluetooth/host/crypto.c                     | 155 ++++
 subsys/bluetooth/host/crypto.h                     |   8 +
 subsys/bluetooth/host/hci_core.c                   | 150 ++--
 subsys/bluetooth/host/hci_core.h                   |   2 +-
 subsys/bluetooth/host/hci_ecc.c                    |   9 +-
 subsys/bluetooth/host/hci_ecc.h                    |   5 +-
 subsys/bluetooth/host/hci_raw.c                    |   8 +-
 subsys/bluetooth/host/hci_raw_internal.h           |   2 +-
 subsys/bluetooth/host/l2cap.c                      | 202 ++----
 subsys/bluetooth/host/l2cap_br.c                   |  97 +--
 subsys/bluetooth/host/l2cap_internal.h             |   5 +-
 subsys/bluetooth/host/sdp.c                        | 781 +++++++++++++++++++++
 subsys/bluetooth/host/sdp_internal.h               |  14 +
 subsys/bluetooth/host/smp.c                        |  36 +-
 tests/bluetooth/init/prj_controller_4_0.conf       |   1 +
 tests/bluetooth/init/prj_controller_dbg.conf       |   1 +
 tests/bluetooth/shell/src/main.c                   | 137 +++-
 tests/bluetooth/test_bluetooth/src/bluetooth.c     |   2 +-
 tests/bluetooth/tester/qemu.conf                   |   1 +
 62 files changed, 2583 insertions(+), 1216 deletions(-)
 create mode 100644 include/bluetooth/crypto.h
 create mode 100644 subsys/bluetooth/controller/hal/Makefile
 create mode 100644 subsys/bluetooth/controller/hal/nrf5/Makefile
 create mode 100644 subsys/bluetooth/controller/hci/Makefile
 create mode 100644 subsys/bluetooth/controller/include/ll.h
 delete mode 100644 subsys/bluetooth/controller/ll/ll.h
 create mode 100644 subsys/bluetooth/controller/ll_sw/Makefile
 create mode 100644 subsys/bluetooth/controller/ll_sw/crypto.c
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c (93%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h (84%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl_internal.h (98%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ll.c (58%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/pdu.h (77%)
 create mode 100644 subsys/bluetooth/controller/ticker/Makefile
 create mode 100644 subsys/bluetooth/controller/util/Makefile
 create mode 100644 subsys/bluetooth/host/crypto.c
 create mode 100644 subsys/bluetooth/host/crypto.h

Change-Id: Ic8bee0eb4f15c00ce5ca7b3b80133b1bbd0bdbf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-24 23:21:09 -07:00
Jukka Rissanen c6cad93d8c samples: net: DNS resolving sample application
Change-Id: I4a0283efde4d0dd8ccd0933071acb277431d4a32
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka 3b0769889b net/samples: Add static ipv4 addresses for arduino 101 echo apps config
Jira: ZEP-1444

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

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

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

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

           [*] TI CC2520 Driver support  ----

           [ ] TI CC2520 Driver RAW channel  --->

Make RAW channel depends on TI CC2520.

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

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

Change-Id: I56d1386144967177f889e12d4a173bfb6628f18b
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-03-24 17:31:40 +02:00
Maureen Helm 153017834a samples: fxos8700: Add support for temperature
Enables the temperature sensor in the fxos8700 sample.

Change-Id: I2b4c306d3c5528dc32d940476c00180b5df08187
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:49 -05:00
Maureen Helm 9b715d9128 samples: fxos8700: Switch to generic SYS_LOG_SENSOR_LEVEL
The fxos8700 driver was previously converted to use the generic
SYS_LOG_SENSOR_LEVEL. Update the fxos8700 sample to use it too.

Change-Id: I2ef02342ce3a25e8d3a3d1b13181872ca0abdc16
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:49 -05:00
Luiz Augusto von Dentz 4fb0724a55 Bluetooth: ipsp: Fix checking for NULL pointer
This may cause static analyser error such as the following:

  Null-checking "tmp" suggests that it may be null, but it has already
  been dereferenced on all paths leading to the check.
             if (tmp) {

Change-Id: Id04f8d052d8128003d5b91f7a8303940529ef261
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-03-21 17:05:42 -07:00
Anas Nashif 3dc9af66ca sensors: BME280: added support for SPI communication
Support connection via SPI and keep I2C as the default.

Jira: ZEP-1698
Change-Id: I42a76131577a37429375364deb07e451107f5d81
Signed-off-by: Dario Pennisi <dario@iptronix.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-21 10:39:27 +01:00
Inaky Perez-Gonzalez c9cff15a8a samples/shell: print the actual params passed
The params command is not printing the arguments, which makes this not
so useful to verify how things work, so added it to the sample.

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

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

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

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

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

Tested on Atmel SMART SAM E70 Xplained board

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

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

Jira: ZEP-1884

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

The README file is also updated by this patch.

Jira: ZEP-1543

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

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

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

Jira: ZEP-1878

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

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

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

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

Jira: ZEP-1855

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

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

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

Jira: ZEP-1169

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

Jira: ZEP-1824

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

Jira: ZEP-1824

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

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

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

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

Jira: ZEP-1701

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

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

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

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

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

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

Jira: ZEP-1754

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

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

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

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

Content might be also published for a given subject.

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

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

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

Jira: ZEP-1012

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

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

Coverity-CID: 163115

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

Coverity-CID: 163117

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

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

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

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

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

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

Change-Id: I2ce71f63b6f22e5ceda79babd2eac802fa4bdf53
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-09 20:33:40 +02:00
Johan Hedberg 69d9985429 Merge bluetooth branch into master
- Assert fixes to controller state transitions
 - AVDTP fixes & improvements
 - SDP fixes & improvements
 - HFP improvements
 - GATT fixes
 - New GATT API for getting current MTU

----------------------------------------------------------------
Arun Jagadish (3):
      Bluetooth: AVDTP: Add AVDTP Receive Function
      Bluetooth: AVDTP: Fix discover param struct
      Bluetooth: AVDTP: Rename of variables

Carles Cufi (4):
      Bluetooth: controller: Use direct ISRs
      Bluetooth: controller: Set debug pins with macros
      Bluetooth: controller: Introduce debug pins Kconfig option
      Bluetooth: controller: Report 5.0 compliant controller

Jaganath Kanakkassery (1):
      Bluetooth: SDP: Server: Introduce private define for max services

Johan Hedberg (3):
      Bluetooth: Add support for Bluetooth 5.0 version specifier
      Bluetooth: Relax minimum advertising interval for 5.0 controllers
      Bluetooth: samples: Add combined observer & broadcaster app

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Fix MTU setting after l2cap connection
      Bluetooth: SDP: Server: Set security level to NONE
      Bluetooth: SDP: Server: Refactor data element structure header
      Bluetooth: SDP: Server: Handle Service Search request
      Bluetooth: SDP: Server: Filter records based on requested uuids

Luiz Augusto von Dentz (4):
      Bluetooth: GATT: Use __ASSERT for invalid parameters
      Bluetooth: GATT: Add bt_gatt_get_mtu API
      Bluetooth: L2CAP: Move functions in preparation for queuing
      Bluetooth: L2CAP: Add TX queueing for LE CoC

Maureen Helm (1):
      Bluetooth: samples: Add hexiwear_k64 and frdm_k64f to tests

Piyush Itankar (2):
      Bluetooth: A2DP: Stream End Point Registration
      Bluetooth: A2DP: Added Preset Structure

Sathish Narasimman (4):
      Bluetooth: AT: Fix 'signed' warning
      Bluetooth: HFP HF: Handling AG Network error
      Bluetooth: HFP HF: SCO: Add esco supported pkt type
      Bluetooth: HFP HF: SCO: Accept eSCO conn request

Szymon Janc (9):
      Bluetooth: shell: Fix accessing invalid memory
      Bluetooth: shell: Fix typo
      Bluetooth: SMP: Fix passkey entry for legacy pairing
      Bluetooth: shell: Don't echo LE CoC data
      Bluetooth: Fix connection object leak
      Bluetooth: shell: Simplify indication in gatt-subscribe
      Bluetooth: shell: Fix GATT long write support
      Bluetooth: GATT: Remove not needed variable
      Bluetooth: GATT: Fix subscriptions removal

Vinayak Chettimada (6):
      Bluetooth: Controller: Use direct ISR for Radio IRQ only
      Bluetooth: Controller: Fix LE Ping PDU dispatch
      Bluetooth: Controller: Run all enqueued mayfly before disable
      Bluetooth: Controller: Kconfig option to set public address
      Bluetooth: Controller: Fix assert on role stop/abort
      Bluetooth: Controller: mayfly enable to supercede over disable

 include/bluetooth/a2dp-codec.h               |  73 +++++
 include/bluetooth/a2dp.h                     |  61 +++++
 include/bluetooth/conn.h                     |   2 +
 include/bluetooth/gatt.h                     |  11 +
 include/bluetooth/hci.h                      |  50 ++++
 include/bluetooth/l2cap.h                    |   4 +
 include/bluetooth/sdp.h                      | 103 ++++---
 samples/bluetooth/peripheral_hr/testcase.ini |   2 +-
 samples/bluetooth/scan_adv/Makefile          |   5 +
 samples/bluetooth/scan_adv/README.rst        |  25 ++
 samples/bluetooth/scan_adv/prj.conf          |   2 +
 samples/bluetooth/scan_adv/src/Makefile      |   1 +
 samples/bluetooth/scan_adv/src/main.c        |  75 +++++
 samples/bluetooth/scan_adv/testcase.ini      |   4 +
 subsys/bluetooth/controller/Kconfig          |  15 +
 subsys/bluetooth/controller/hal/debug.h      | 124 ++++-----
 subsys/bluetooth/controller/hal/nrf5/radio.c |   4 +-
 subsys/bluetooth/controller/hal/radio.h      |   2 +-
 subsys/bluetooth/controller/hci/hci.c        |   2 +-
 subsys/bluetooth/controller/hci/hci_driver.c |  22 +-
 subsys/bluetooth/controller/ll/ctrl.c        | 229 ++++++++++++----
 subsys/bluetooth/controller/util/mayfly.c    |  58 +++-
 subsys/bluetooth/controller/util/mayfly.h    |   4 +-
 subsys/bluetooth/host/Kconfig                |   9 +
 subsys/bluetooth/host/a2dp.c                 |  19 ++
 subsys/bluetooth/host/at.c                   |  53 +++-
 subsys/bluetooth/host/at.h                   |  38 ++-
 subsys/bluetooth/host/avdtp.c                |  63 ++++-
 subsys/bluetooth/host/avdtp_internal.h       |  14 +-
 subsys/bluetooth/host/conn.c                 |  60 +++-
 subsys/bluetooth/host/conn_internal.h        |  10 +
 subsys/bluetooth/host/gatt.c                 |  86 +++---
 subsys/bluetooth/host/hci_core.c             |  92 ++++++-
 subsys/bluetooth/host/hci_core.h             |   8 +
 subsys/bluetooth/host/hfp_hf.c               |  15 +-
 subsys/bluetooth/host/l2cap.c                | 319 +++++++++++++---------
 subsys/bluetooth/host/sdp.c                  | 391 +++++++++++++++++++++++++--
 subsys/bluetooth/host/sdp_internal.h         |   2 +
 subsys/bluetooth/host/smp.c                  |   1 -
 tests/bluetooth/shell/src/main.c             |  98 ++++---
 40 files changed, 1728 insertions(+), 428 deletions(-)
 create mode 100644 include/bluetooth/a2dp-codec.h
 create mode 100644 samples/bluetooth/scan_adv/Makefile
 create mode 100644 samples/bluetooth/scan_adv/README.rst
 create mode 100644 samples/bluetooth/scan_adv/prj.conf
 create mode 100644 samples/bluetooth/scan_adv/src/Makefile
 create mode 100644 samples/bluetooth/scan_adv/src/main.c
 create mode 100644 samples/bluetooth/scan_adv/testcase.ini

Change-Id: I94f2f9f4431e21da9aae00c9e32581acb383ad49
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-08 22:21:41 +01:00
Kuo-Lang Tseng 5873fee475 samples: pwm: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is safer because device name can change and
the app does not need to change.

Jira: ZEP-1764

Change-Id: I3c7716fd72e77c99fd29e4e90634c33f47f32e4c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-03-07 23:03:44 +00:00
Andrew Boie 10c41eea00 samples/logger-hook: fix usage of ring buffer
- Ring buffers provide no concurrency control. Since the ring buffer
is being installed as the system log hook, multiple contexts may try
to write to it simultaneously. Lock interrupts to prevent corruption
of the ring buffer.

- NULL pointers were being passed into sys_ring_buf_get() for the
'type' and 'value' parameters, causing undesirable behavior when they
are dereferenced.

- The 'size32' parameter of sys_ring_buf_put() was being passed the
number of bytes, not the number of 32-bit words.

- The 'size32' parameter of sys_ring_buf_get() was not bring correctly
initialized the size of the destination buffer in terms of 32-bit
words. This has been fixed. There is no longer a need to query the
API twice.

Issue: ZEP-1789
Change-Id: I96f9cc74f3711297727b4c5114b6c93510f4a8c1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-03-07 12:40:23 +00:00
Johan Hedberg 9cf9a2f1f2 Bluetooth: samples: Add combined observer & broadcaster app
Add a sample application demonstrating doing continuous scanning and
sending out advertising packets periodically.

Change-Id: I0ce88afd73bed4928ba65472051c0f83ff27a632
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-07 12:21:29 +01:00
Maureen Helm 93a6565dc5 Bluetooth: samples: Add hexiwear_k64 and frdm_k64f to tests
The introduction of device tree broke bluetooth sample builds for the
hexiwear_k64 and frdm_k64f boards. Add these boards to the peripheral_hr
test so this doesn't happen again.

Jira: ZEP-1745

Change-Id: I3e61a83db09cbb5834bd510bff851611e43844a8
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-07 12:21:29 +01:00
Andrei Emeltchenko e9b41f764b hci_usb: Add project configuration for tinyTile board.
Makes configuration for tinyTile board.

Change-Id: I823e299dad905387de85fd6d74159c7540bc7edd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-07 11:19:11 +00:00
Andrei Emeltchenko 8ea70851db hci_usb: Fix incorrect length log
Fixes following warning:
...
warning: format '%u' expects argument of type 'unsigned int', but
argument 6 has type 'int32_t * {aka int *}' [-Wformat=]
...

Change-Id: I3ac523b7c8daf08b0c8e7b43aad270306fe5d744
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-07 11:18:39 +00:00
Andrew Boie 04c52bf9f9 samples: grove: add missing testcase.ini
These were simply copied from the 'lcd' test case.

Issue: ZEP-1768
Change-Id: Ie5d561c3131b04df2952523cc8dfd5a004dc1960
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-03-06 16:58:31 +00:00
Kuo-Lang Tseng 4a363ff5bf samples: i2c_fujitsu: change hard-coded device name
Change to use the device config name defined by driver's Kconfig
for device binding, instead of hard-coding it which is not
portable.

Jira: ZEP-1764

Change-Id: I61ed7cfd97e20faad8f1e98dacef9384e8fefc73
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:49:48 +00:00
Kuo-Lang Tseng e90aa43eaa samples: drivers: change hard-coded device name
Change to use the device name defined by driver's Kconfig for
device binding, instead of hard-coding it which is not portable.

Jira: ZEP-1764

Change-Id: I0dc9aa2cdf426af71f1ed6dcef1ec7cec19f4c3e
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:48:30 +00:00
Kuo-Lang Tseng 1980325392 samples: drivers: rtc: change hard-coded device nam
Change to use the device config name defined by driver's Kconfig
for device binding, instead of hard-coding it which is not
portable.

Jira: ZEP-1764

Change-Id: I7af234ada73302eb062340740df2fc7a8539150d
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:46:49 +00:00
Anas Nashif c78a3485e2 Merge "Merge net branch into master" 2017-02-27 22:32:01 +00:00
Luiz Augusto von Dentz 0dc4dd46d4 lifo: Make use of k_queue as implementation
Once all users of k_lifo migrate to k_queue this should no longer be
needed.

Change-Id: Ib8af40c57bf8feba7b06d6d891cfa57b44faad42
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-27 21:20:53 +00:00
Luiz Augusto von Dentz e5ed88f328 fifo: Make use of k_queue as implementation
This makes k_fifo functions rely on k_queue and port k_poll to use
k_queue directly.

Once all users of k_fifo migrate to k_queue this should no longer be
needed.

Change-Id: Icf16d580f88d11b2cb89e1abd23ae314f43dbd20
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-27 21:20:52 +00:00
Flavio Santes c318967c56 samples/net/mqtt: Don't break lines after the "static" keyword
Fix some style issues found at the src/main.c file.

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

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

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

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

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

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

Jira: ZEP-1732

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

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

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

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

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

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

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

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

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

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

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

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

wireshard 154.pcap

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

Jira: ZEP-1774

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

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

Change-Id: Ibccd7cabd567a630020fb9efbe1ec9e27b653b46
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-27 10:28:53 +02:00
Anas Nashif 87a422896c Revert "samples: i2c_lsm9ds0: change hard-coded device name"
This reverts commit 81f85f4e4b.

Need a better solution for this, the patch itself does not solve any problem
and fails on many platforms that do not have I2C enabled.

Change-Id: I060e3d7a9992db8a1ece6da5e8d3a521f4052395
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-24 06:30:39 -08:00
Andrew Boie 138579a3ad samples: add some missing testcase.ini
Issue: ZEP-1768
Change-Id: Ia59e02bdaf9302b991f0423ef5eba7b0102877b0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-23 13:28:03 +00:00
Kuo-Lang Tseng e7f261b748 samples: blink_led: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is more portable and safer because device
name can change and the app does not need to change.

Jira: ZEP-1764

Change-Id: If8c14dd4eb186bace863432d454c9122461f2f9c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:25:20 +00:00
Kuo-Lang Tseng 0eed7eefee samples: fade_led: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is more portable and safer because device
name can change and the app does not need to change.

Jira: ZEP-1764

Change-Id: I3287da5c5a9df24507efa84bbf7bbb051726bc2c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:25:05 +00:00
Kuo-Lang Tseng e47e85e279 samples: driver: led_apa102c: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is safer because device name can change and
the app does not need to change.

Jira: ZEP-1764

Change-Id: I5a3e16e10f7700ec12edbd07603808cd32f15755
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:24:42 +00:00
Kuo-Lang Tseng 81f85f4e4b samples: i2c_lsm9ds0: change hard-coded device name
Instead of using a hard-coded device name in the device binding
call, use the config name defined by the driver Kconfig as that
is safer and the app does not need to change when the device name
is changed.

Jira: ZEP-1764

Change-Id: I99efc4bcae0d1acae70f7820f69dfffbe17510a6
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:24:04 +00:00
Wojciech Bober f8c2b2e099 samples/net/ieee802154: Update example with nrf5 802.15.4
This commit updates the 802.15.4 example to work with the
nrf5 802.15.4 radio driver.

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

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

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

Jira: ZEP-1539

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

- client_id
- will_topic
- user_name
- topic

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

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

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

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

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

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

Change-Id: Ib601605805d6c5c0173424b2e282a50a6a1076d6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Anas Nashif 15a6598691 Merge "Merge remote-tracking branch 'origin/core'" 2017-02-15 04:33:25 +00:00
Jithu Joseph 38aaa7c955 samples/drivers/crypto: crypto sample app
A sample application  to illustrate the usage of crypto APIs.
This shows the usage of AES - CTR, CBC and CCM  based encryption
and decryption.

origin: original

Change-Id: I17e4d966a70169b71a754c9cdc3f713a5d0c3ac0
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-15 01:08:16 +00:00
Sergio Rodriguez de60e4c8cd samples/net/http: Add HTTP over TLS sample application
Add the HTTPS (HTTP over TLS) server sample application on top
of the current HTTP Parser Library and mbedTLS. This code uses
TLS to stablish a secure connection and HTTP parser to identify
the request and the proper response.

Jira: ZEP-799

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

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

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

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

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

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

Jira: ZEP-1538

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

Change-Id: I6aa5989575cc15630371aa0761bee98fb6fe1b80
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Anas Nashif d4c9a7d80c net: remove obsolete CONFIG_NET_YAIP
Change-Id: Ie8ef79e7d7a6f229af3771b7786af3db89c5e458
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-14 08:30:33 +02:00
Jithu Joseph d3455754d3 samples: webusb: fix variable type mismatches
This was reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ib54d43bbfae4c7819b1e2b82d2931bfe1201ecce
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-14 02:13:52 +00:00
Andrew Boie 9f1ff3fd85 REVERTME: cpp_synchronization: disable on Xtensa
Issue: ZEP-1703
Change-Id: I30af7baa78b0d2ed4dd1ac7236c318c47289fa5e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:03 -08:00
Anas Nashif 3557d04eb5 tests: net: whitelist boards for telnet server
Change-Id: I141cb9e680584b9b26926eae288ae7a2a85633f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:00:39 +00:00
Kuo-Lang Tseng 61452f0e38 samples: bmi160: use correct device name
Binding of the device failed due to incorrect device name. Update
to use the correct device name.

Jira: ZEP-1704

Change-Id: I6ca23a439357592c9c974ca746bccc35e77d996d
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-11 01:28:09 +00:00
Jithu Joseph 720400372b misc: fix more variable type mismatches
These were reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ic625749309773611c0c6ba2905e9420e98947dae
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-11 00:14:15 +00:00
Anas Nashif df16cb92d4 arduino_101: bmi160: use new device name
Use new device name for SPI device

Jira: ZEP-1704
Change-Id: Iec39468bbef54423af2b3a681dd4ae1eee866d1e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-10 16:02:22 +00:00
Marcus Shawcroft 7421928ae5 samples/dhcpv4_client: Switch from private net_sprint_ipv4_addr to public net_addr_ntop
Change-Id: I894c22548aeea4dcb42e457266e7e140acdace0f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:09 +00:00
Marcus Shawcroft 7a903ede9f samples/dhcpv4_client: Increase number of DATA buffers.
Change-Id: I0116613cb63070d08c4cb6ad7a5864d09a014c68
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:09 +00:00
Marcus Shawcroft 571bdbb7c3 samples/dhcpv4_client: Reduce default debug to dhcpv4
Turn down the default logging verbosity on the dhcpv4 frdm_k64f config
to focus on the dhcpv4 implementation.

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

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

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

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

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

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

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

Change-Id: Ib8e3f8b412c2f8388315c2f63cae4392f814ea2f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-09 12:29:29 +02:00
Anas Nashif 31f01f8ed6 Merge "Merge net branch into master" 2017-02-08 12:03:09 +00:00
Johan Hedberg 79883c9834 Merge bluetooth branch into master
- Use k_poll to consolidate all TX threads into a single one
 - Reuse HCI command buffers for storing their response
 - Improvements to SDP client support
 - New "volatile subscription" flag to GATT API
 - Various smaller fixes & cleanups here and there

----------------------------------------------------------------
Arkadiusz Lichwa (8):
      Bluetooth: SDP: Get ProtocolDescriptorList attribute internals
      Bluetooth: shell: Add SDP client support
      Bluetooth: uuid: Fix assigned UDP uuid value
      Bluetooth: SDP: Add API to get ProfileDescriptorList attribute
      Bluetooth: shell: Add getting ProfileDescriptorList attribute
      Bluetooth: SDP: Add API to get SupportedFeature attribute
      Bluetooth: shell: Use SupportedFeature attribute API
      Bluetooth: shell: Add support to retrieve A2SRC record

Arun Jagadish (2):
      Bluetooth: AVDTP: Remove buffer pool
      Bluetooth: AVDTP: Add AVDTP Discover Function Definition

Carles Cufi (1):
      Bluetooth: hci_core: Use nRF5x FICR address

Jaganath Kanakkassery (2):
      Bluetooth: RFCOMM: Fix session timer during acl disc
      Bluetooth: RFCOMM: Use common tx pool for control packets

Johan Hedberg (15):
      Bluetooth: Fix trivial coding style issue
      Bluetooth: Fix checking for invalid public address
      Bluetooth: Fix using correct variable type for interrupt mask
      Bluetooth: Fix buffer leak when HCI driver send() fails
      Bluetooth: drivers/h4: Add support for discarding certain events
      Bluetooth: Add convenience macros for common header sizes
      Bluetooth: Kconfig: Merge headroom reserve variables into a single one
      Bluetooth: Controller: Redesign response buffer allocation for commands
      Bluetooth: Reuse HCI command buffers for the command response
      Bluetooth: conn: Use delayed work for LE connection timeout
      Bluetooth: Merge bt_conn TX threads into a single one with k_poll
      Bluetooth: Merge HCI command and connection TX threads
      Bluetooth: samples: Add missing README.rst files
      Bluetooth: Controller: Use LL_ASSERT instead of BT_ASSERT
      Bluetooth: Fix incorrect checks for command buffer user data

Jonathan Gelie (3):
      Bluetooth: GATT: introduce volatile subscription flag
      Bluetooth: GATT: set subscribe value to zero for unsubscription
      Bluetooth: GATT: fixing unsubscription

Luiz Augusto von Dentz (1):
      Bluetooth: GATT: Fix not removing subscriptions safely

Sathish Narasimman (5):
      Bluetooth: HFP HF: Service level connection completed
      Bluetooth: HFP HF: Enable extended AG Error Result Code
      Bluetooth: HFP HF: Indicate disconnect to application
      Bluetooth: HFP HF: Disconnect rfcomm on SLC error
      Bluetooth: HFP HF: Remove unused variable 'buf'

Szymon Janc (5):
      Bluetooth: Use assert when getting net buf with K_FOREVER
      Bluetooth: Remove some dead code
      Bluetooth: L2CAP: Remove dead code
      Bluetooth: SDP: Make bt_sdp_create_pdu static
      Bluetooth: L2CAP: Make l2cap_br_send_conn_rsp return void

 drivers/bluetooth/hci/Kconfig                   |  13 +-
 drivers/bluetooth/hci/h4.c                      |  93 +++-
 drivers/bluetooth/hci/h5.c                      |  47 +-
 drivers/bluetooth/hci/spi.c                     |  13 +-
 drivers/bluetooth/nble/gatt.c                   |  76 +--
 include/bluetooth/buf.h                         |  13 +-
 include/bluetooth/gatt.h                        |  18 +-
 include/bluetooth/hci.h                         |   9 +-
 include/bluetooth/l2cap.h                       |  20 +-
 include/bluetooth/sdp.h                         |  51 ++-
 include/bluetooth/uuid.h                        |   2 +-
 samples/bluetooth/handsfree/README.rst          |  23 +
 samples/bluetooth/hci_uart/src/main.c           |  11 +-
 samples/bluetooth/hci_usb/src/main.c            |  11 +-
 samples/bluetooth/peripheral_sc_only/README.rst |  26 ++
 subsys/bluetooth/controller/hci/hci.c           | 153 ++++---
 subsys/bluetooth/controller/hci/hci_driver.c    |  23 +-
 subsys/bluetooth/controller/hci/hci_internal.h  |   2 +-
 subsys/bluetooth/controller/ll/ctrl.c           |   2 +-
 subsys/bluetooth/host/Kconfig                   |  10 +-
 subsys/bluetooth/host/at.c                      |   2 +-
 subsys/bluetooth/host/at.h                      |   3 +-
 subsys/bluetooth/host/avdtp.c                   |  81 +++-
 subsys/bluetooth/host/avdtp_internal.h          |   7 -
 subsys/bluetooth/host/conn.c                    | 178 ++++----
 subsys/bluetooth/host/conn_internal.h           |  15 +-
 subsys/bluetooth/host/gatt.c                    | 142 +++---
 subsys/bluetooth/host/hci_core.c                | 285 ++++++++----
 subsys/bluetooth/host/hci_core.h                |   6 +
 subsys/bluetooth/host/hci_ecc.c                 |   6 +-
 subsys/bluetooth/host/hci_raw.c                 |  12 +
 subsys/bluetooth/host/hfp_hf.c                  |  50 +-
 subsys/bluetooth/host/l2cap.c                   |  35 --
 subsys/bluetooth/host/l2cap_br.c                |  49 +-
 subsys/bluetooth/host/l2cap_internal.h          |   7 +-
 subsys/bluetooth/host/rfcomm.c                  |  31 +-
 subsys/bluetooth/host/rfcomm_internal.h         |   5 +-
 subsys/bluetooth/host/sdp.c                     | 584 +++++++++++++++++++++++-
 tests/bluetooth/shell/src/main.c                | 172 +++++++
 39 files changed, 1700 insertions(+), 586 deletions(-)
 create mode 100644 samples/bluetooth/handsfree/README.rst
 create mode 100644 samples/bluetooth/peripheral_sc_only/README.rst

Change-Id: I7589dbad8b97477c72d1b856121593bcf6d11339
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-08 13:03:20 +02:00
Juan Manuel Cruz 5225daad94 mbedtls: add arduino 101 configuration to ssl client sample
Jira: ZEP-748

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

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

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

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

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

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

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

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

Jira: ZEP-827

Change-Id: Iee63a53f2ef424964f040eba20326d648249fc24
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-08 10:12:34 +02:00
Ramesh Thomas 632964e010 samples: power: Remove mention of specific versions in README
The README was referring to a specific version of the boot loader.
Since the boot loader version is expected to change in future
and Zephyr code would also correspond to that version, it is better
to not mention any specific version. Instead, the requirement
is to use the latest version of the boot loader.

Change-Id: I04082eec4af16426f6456702c521e8f61bd4e0df
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-02-08 06:28:25 +00:00
Johan Hedberg 46ed7974b3 Bluetooth: samples: Add missing README.rst files
Add missing README.rst files to the last two samples.

Jira: ZEP-1540

Change-Id: I8dfa6489c6c65872594d4416870e2a41e701595d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-07 10:52:08 +02:00
Johan Hedberg 50678b03cb Bluetooth: Reuse HCI command buffers for the command response
Reduce the pressure on the common RX buffer pool by reusing HCI
command buffers also for the Command Status or Command Complete
response to them. This also implies removing the existing Kconfig
variable for the command buffer sizes since the size is also dependent
on maximum Command Complete event sizes. Instead, reuse the RX buffer
size also for HCI Command buffers.

Change-Id: I006b287d64a0c9ca40de741aa9a424a49a927385
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-05 22:39:25 +02:00
Johan Hedberg 743379c21f Bluetooth: Kconfig: Merge headroom reserve variables into a single one
A subsequent patch will start reusing HCI command buffers for
receiving the response, so the distinction of received vs sent data
headroom would just make the code unnecessarily complex. Instead, just
merge these two variable into a single one.

Change-Id: I31d846331939f1a2270df7ed0c75112825e16493
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-05 22:39:25 +02:00
Baohong Liu fd74c0c5a6 samples: bmi160: reduce polling mode sampling frequency
Reduce the accelerometer sampling frequency for polling mode.
So, cpu has more time to fetch the sample.

Also add some waiting time for the new frequency setting to
take effect.

Jira: ZEP-1532

Change-Id: If5c1d8a2b5f30b232a212f2775306ca397b9f80c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-04 20:08:16 +00:00
Baohong Liu 42af60328d samples: spi_flash: remove an unnecessary config symbol
Remove CONFIG_GPIO from the prj config file. It is redundant.

Change-Id: Ife4301e7ce480a9002cadcddfd5eaa569900a391
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2017-02-04 19:45:44 +00:00
Jukka Rissanen 2612b04d80 samples: net: zperf: Set the proper UDP payload
Use a static buffer for sending UDP payload instead of reading
values from memory.

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

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

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

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

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

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

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

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

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

Jira: ZEP-1656

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

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

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

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

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

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

- Delete unused defines

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

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

The following MQTT API routines are exercised in this sample:

- mqtt_init
- mqtt_tx_connect
- mqtt_tx_pingreq
- mqtt_tx_publish
- mqtt_tx_disconnect

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

- struct mqtt_ctx
- struct mqtt_connect_msg
- struct mqtt_publish_msg

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

A README file is also included in this patch.

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

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

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

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

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

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

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

Change-Id: I3835af6adf337d27c28a0beeb72848dcc838772c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00