Commit graph

42249 commits

Author SHA1 Message Date
Andrei Emeltchenko
3dec8b60a2 drivers/nble: Correct style
Make code consistent and make one line less then 80 chars.

Change-Id: I4aff3542dfa150ec08ec878303011e44319b238c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:33 -05:00
Grzegorz Kolodziejczyk
b3617ba937 Bluetooth: Fix checking parameters in bt_le_conn_params_valid
Parameters should be checked according to specification. Previous
implementation don't check properly given timeout. Additional check of
lower timeout limit was required.

Change-Id: Id6d302de9c8c9952c0f61107a1ef8d9fa727bffb
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:25:33 -05:00
Andrei Emeltchenko
99a4cac6a9 drivers/nble: Update RPC to the Nordic BLE chip
Update RPC headers to sync with NBLE firmware.

Change-Id: I3231fe16372f2a6a38868edfa543689f631d8b98
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:33 -05:00
Louis Caron
9e58ac9840 Bluetooth: fix bswap order when building 128bit UUIDs
When building 128b UUIDs, the uint16_t needs to be swapped in the
big order case only, as explained in the comments

Change-Id: Ia998d333c9a22c9989763f3729fe42c0edf16545
Signed-off-by: Louis Caron <louis.caron@intel.com>
2016-02-05 20:25:33 -05:00
Luiz Augusto von Dentz
a1bac54378 drivers/nble: Fix not being able to register CEP attributes
Registering CEP attributes was not possible because
bt_gatt_attr_read_cep was not implemented causing the following error:

bt: bt_gatt_register: Failed to read attr: -71

Change-Id: Ib0860cf657d6a6001c1fd4dd2712ac7361edee1c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:33 -05:00
Luiz Augusto von Dentz
922b83ac38 drivers/nble: Add initial implementation of on_ble_gatts_write_evt
Change-Id: Ib28d35d6f5aac697dbbbac8e7d01e6bfcf6545c6
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:33 -05:00
Luiz Augusto von Dentz
dbaa3e38cf drivers/nble: Add initial implementation of bt_gatt_notify
Change-Id: I9a5ed5092e8ae8ce9f89f53334b43a2362b91bac
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:33 -05:00
Luiz Augusto von Dentz
a7462f82a8 drivers/nble: Add initial implementation of bt_gatt_write_ccc
Change-Id: Iaf565c792fee6e2d39d199519199ee34f8f4ca57
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:33 -05:00
Louis Caron
48802c2212 Bluetooth: Add API to update LE connection parameters
Applications should be able to update the connection parameters.

Change-Id: I446f64fcd0b27b605e636e566fb35a362a92de96
Signed-off-by: Louis Caron <louis.caron@intel.com>
2016-02-05 20:25:33 -05:00
Jukka Rissanen
bef69b7b96 net: apps: Add the non link local IPv6 address in routes
For this demo app, set the 2001:db8::/64 address in routing
table. This way we will be able to pass data using these
addresses. Something like this should not be done in real
networking environment.

Change-Id: I1764d5ae09ab95dd580c6b48d6f368bfe283a6a3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
5e16d7a355 net: apps: Make echo-client to timeout packet receive
The echo-client will timeout the packet receive after 5 seconds.
This way we at least send something instead of waiting forever
if the packet is lost.

Change-Id: Idc332965786797df4ed04dc8b3ef49af32a3f436
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Luiz Augusto von Dentz
db0c12eece drivers/nble: Add initial implementation of on_ble_gatts_read_evt
Change-Id: Ia749272a23d96318f477d41d46509dc64c6d474a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
5205172dd4 net: contiki: Fix debug prints in ICMPv6 handling
Change-Id: I2a1df0dfb44ee6fbd94535d93a7504fa2c7f7f43
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Andrei Emeltchenko
bb34c219ce drivers/nble: gatt: Fix loosing errcode and wrong comparision
Fix assigning negative error code to unsigned int and then compare it
against zero.

Change-Id: Idedaf91dda20a38806ee81d5c488ae8b46c8feff
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:32 -05:00
Andrei Emeltchenko
03969be306 drivers/nble: gatt: Remove unneeded check
For size_t it is hard to be negative in the following check
...
if (!data || len < 0)
...

Change-Id: Ib995d568e10aa1e3cbaf28f46d267addb876f073
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:32 -05:00
Andrei Emeltchenko
8e4ca413fd drivers/nble: Add debug tables with function strings
Since RPC to the NBLE is designed in a such a way that it is nearly
impossible to find out which packet received, create debug tables in
debug configuration. The tables store strings of function names
referenced by function index in a table, created the same way as RPC.

Sample output is:
...
bt: rpc_deserialize (0xa80082c4): on_nble_up
...

Change-Id: Ic91fcf73753aa9b78bdbacd5c8a0279823a4679e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:32 -05:00
Szymon Janc
6645d3f485 Bluetooth: GATT: Remove destroy callback from bt_gatt_discover_params
Instead of destroy callback, call discovery_func with NULL attribute to
indicated that discovery has completed. This makes it clear when
discovery is completed and parameters used for it are no longer used.
Thanks to this application doesn't need to abuse user data destroy
callback for detecting if discovery has completed.

Also note that bt_gatt_discover doesn't take any user data parameter
and that destroy callback was acctually called with discovery
parameters.

If application would require to pass user data along with parameters
it may use CONTAINER_OF macro along with bt_gatt_discover_params.

Change-Id: Iec4eb9795975ef2555502e13a682e13ff37742e0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:32 -05:00
Louis Caron
bcb61c6630 Bluetooth: add the connection parameters to le conn info
Applications that need it can retrieve the connection
parameters at any time, connected callback for example,
and eventually handle the connection update callback or
not, this gives maximum flexibility for handling these
parameters and requesting change.

Change-Id: Iba7d30ade045875ebc721fd332e031d9008e248c
Signed-off-by: Louis Caron <louis.caron@intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
9f8ed3a6e0 net: Make sure timer fiber does not print stack usage too often
Sometimes the timer fiber was flooding stack usage to console.

Change-Id: I3518cc08f3c8d3ed8ccc19e7bbb6356811e28ab7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
0cb73a1b9c net: Stack analyze function fixed
The stack analyzer works now same was as the one found in
Bluetooth sub-system.

Change-Id: I75e393882db6ba83f991d37aa2bf81d960b61231
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Luiz Augusto von Dentz
629dbb624e drivers/nble: Add initial implementation of bt_gatt_register
Change-Id: I2f72c203da9b99841cd83b26b25fbf435c54baf5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:32 -05:00
Luiz Augusto von Dentz
2d220fdcf7 drivers/nble: Increase buffer size to 384 bytes
This is the MTU supported by the firmware and is necessary in order to
register bigger services such as vendor specific in the peripheral
sample.

Change-Id: I24b2f9e983d8e2da22d41a40f538f0daf7d526d0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
9e79aa6f9d net: apps: echo-server refactoring to work in microkernel
The echo-server uses only one code base for both microkernel
and nanokernel.

Change-Id: I7abdf76dc13c31e4f91d0fd9d3b870ffe20ac71b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
40bef01a5f net: apps: echo-client refactoring to work in microkernel
The echo-client uses only one code base for both microkernel
and nanokernel.

Change-Id: Ieaf9a969319537286181ba333e3a05bfa0e9363a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
de767512d7 net: apps: Refactor echo-client compilation
Separate setup for different low level bearer. By default the
Makefile will create version suitable for qemu testing using
slip. If one writes "make NET_IFACE=802154" then IEEE 802.15.4
radio specific settings are activated.

Because echo-client does not contain any processor specific
settings, remove the ARM config files and rename the x86
specific ones.

Change-Id: I0608b6172bdd044dd49dedf86477ef8a31391a23
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
396766531e net: apps: Refactor echo-server compilation
Separate setup for different low level bearer. By default the
Makefile will create version suitable for qemu testing using
slip. If one writes "make NET_IFACE=802154" then IEEE 802.15.4
radio specific settings are activated.

Because echo-server does not contain any processor specific
settings, remove the ARM config files and rename the x86
specific ones.

Change-Id: I2caf26979f32496c6efb4dd1f625a60e3e5f6744
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
c12fcb1bbd net: Clarified the neighbor discovery option in Kconfig
Change-Id: I31a725450120c29de33246f8602f97c8b4c852c7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Szymon Janc
d3a05596f8 Bluetooth: samples/tester: Fix invalid use of struct bt_uuid
struct bt_uuid is a 'tentative' UUID type and shouldn't be used for
UUID storage. Since tester application doens't know type of UUID
on compile time we need to have a common extra type that would
allow to store both 16 and 128 UUIDs.

Change-Id: Ia2775a457a732cf03ba7e4a59e6d654fcd1ab05d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:32 -05:00
Szymon Janc
87d8bfeaa2 Bluetooth: Add clarifying comment about usage of struct bt_uuid
This type should only be used as a pointer.

Change-Id: Icf656f310344cecbde527e809af6d00dcfc7ef82
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:32 -05:00
Ravi kumar Veeramally
a4963cea35 net: apps: Update echo-server and echo-client IPv6 address
Address configurations for different Kconfig options is difficult
to test under different environments. Make it simple at the moment.

Change-Id: I689649b11b4ccb1cf1ff0e90720fa03b6dc3656b
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:25:32 -05:00
Ravi kumar Veeramally
838961af9a net: apps: Modify echo-client to send data only after reception
Modify echo-client to send packet after packet received from
server and wait unlimited ticks. Current behaviour flood messages
to server irrespective of reception at server end. Modified
behavior only for nanokernel at the moment.

Change-Id: I6aa20c5b9fc9d6d1cf8f996e90735f5d2b986e5a
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-05 20:25:32 -05:00
Luiz Augusto von Dentz
94210770fd drivers/nble: Only call ready callback once get_version completes
There could be commands that depend on the firmware version the stack
needs to wait until version is complete.

Change-Id: If8ded19c4cd4eb3c33df64b3cde29da11b0de8df
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:32 -05:00
Andrei Emeltchenko
6948fc437a uart-pipe: Fix using fifo_fill instead of poll_out
For non-interrupt transfers poll_out should be used, This fixes data
lost issues on a real UART hardware like Arduino 101 and Galileo
boards.

Change-Id: Ic7a5d055941d83f9d62cbea9e911ce25730ed7b6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:32 -05:00
Andrei Emeltchenko
d2c87d1e86 Bluetooth: nble: Update NBLE RPC interfaces
Following change in NBLE firmware update interfaces and structures.

Change-Id: I47df2374961d13fabc54ee8e446a155a65999072
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
e6bffc88d2 net: Fix the statistics printing in timer fiber
Timer fiber printed statistics too fast.

Change-Id: Icb24e9866543316de3491edf89298350d9bee994
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
6956fe1670 net: samples: Fix echo-client compile error for microkernel
Change-Id: Id1a40244543744b60971dd6321edf1aadd02108a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Jukka Rissanen
17856bb9a7 net: samples: Fix microkernel echo-server and echo-client
The echo-server and echo-client samples did not compile correctly
if one wanted them to work correctly using "make server" and
"make client" commands.

Change-Id: I955c6cc23c3192fcb1dfcfbda7df53050a71501f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:32 -05:00
Johan Hedberg
0270fda003 drivers/nble: Fix error return for NRPA advertising address type
Currently the nble implementation doesn't support advertising with an
NRPA.

Change-Id: I80e3e2a72d73d23f37966eb429a8ffb8d8c50bf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:31 -05:00
Johan Hedberg
479d25d035 Bluetooth: Rename BT_LE_ADV_ADDR_PUBLIC to BT_LE_ADV_ADDR_IDENTITY
In anticipation of supporting a local static random address in the
future it makes more sense to call BT_LE_ADV_ADDR_PUBLIC
BT_LE_ADV_ADDR_IDENTITY.

Change-Id: I4826f1dfb50b54e13a35cbe7ee74e28641c81ad1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:31 -05:00
Andrei Emeltchenko
8baedd3a6b Bluetooth: tester: Update configuration for NBLE
Enable CONFIG_CONSOLE_HANDLER and disable CONFIG_UART_CONSOLE since
tester reuses that UART.

Change-Id: Ia440d75f66d01f29d10b5d6a68fc052fd8b57fa7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:31 -05:00
Andrei Emeltchenko
e539c3b99c Bluetooth: nble: Remove enabling debug by default
Enabling BLUETOOTH_DEBUG enables also serial console conflicting with
tester reusing the same UART.

Change-Id: I8058a019e61146ff05cc44ab543cf6ec9ff418ef
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:31 -05:00
Andrei Emeltchenko
78b0b6dd62 Bluetooth: nble: Fix warnings when debug is disabled
Use pointers instead of potentially unused var.

Change-Id: I07bcb788b0f9e5e100c913c48d7d38464565157a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:31 -05:00
Johan Hedberg
08c594049d Bluetooth: Update documentation of BT_DATA & BT_DATA_BYTES
Change-Id: Ia523cc2f0602dcd9b7c0877121c678b049d64956
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:31 -05:00
Johan Hedberg
bd0065b3bd Bluetooth: samples: Use sizeof() to evaluate fixed name length
This way we avoid bugs coming from wrongly (human) counted length.

Change-Id: I95eb87a78fc12d4c5e083ce1c65d8b690ad8db78
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:31 -05:00
Johan Hedberg
7d8303bbbf Bluetooth: Introduce BT_DATA_BYTES convenience macro
This way we don't need a special BT_BYTES macro and avoid bugs coming
from wrongly counted number of bytes (which is now evaluated at
build-time).

Change-Id: Ic6319234a816fe2fab6229b3bb980d0e3503e241
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:31 -05:00
Dan Kalowsky
08dd836791 board : arduino_101 : fixing flash scripts
Fixing the flash script so that we only have one for the process of writing
out the ROM and the OS images.

Change-Id: I6fc8bd8eee553a17c0036da3ce5b89510f3b57d8
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:25:31 -05:00
Dan Kalowsky
eb38faa75b doc : arduino_101 : adding image for JTAG connection
Adding in an image for locating the JTAG connector on the Arduino 101 board,
and a visual pointer towards the JTAG silkscreen dot.

Added figures for the JTAG connector.

Change-Id: I57ed5608bf2f3ded325965ec77142e3376f386ed
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:25:31 -05:00
Dan Kalowsky
0e053a5f4d doc : arduino_101 : adding serial debug information
Adding in a section for attaching a serial cable, and links for two that we
have found that work for us.  Adding in links to both serial cables.

Added figures of the pins with appropriate callouts.

Change-Id: Ibae64811f1c32f6a8e82be17abbc91df6c53219a
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:25:31 -05:00
Dan Kalowsky
f60bfa00f6 doc : arduino_101 : style fixes
Fixing a few notes that are not being properly displayed.

Change-Id: I60f8a8615ee93ba391a99a819aa1761e6713e51b
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:25:31 -05:00
Anas Nashif
fe9eae95e8 link in external application library
When building an application and external build process of an
application specific library can be started by the application which
generates a .a file that will be linked at the final stage with the
Zephyr kernel.

Change-Id: I06fa1a10605ab032801ead8f5ee8d0c85c0bea5c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:31 -05:00