Commit graph

41120 commits

Author SHA1 Message Date
Rodrigo Caballero
3010de9850 doc: Edit the IPM driver APIs
Edit public API details for clarity, grammar, punctuation found
on file ipm.h

Made consistent use of @retval to document return values.

Used imperative verbs for all @brief descriptions.

Change-Id: Ie5516fcb18648a99c58bcfef7888286dead7cff4
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-11 01:08:24 +00:00
Rodrigo Caballero
18c24a9ec2 doc: Edit the Pinmux driver APIs
Edit public API details for clarity, grammar, punctuation found
on file pinmux.h

Change-Id: Ib75e5c3bff84709e8f3f830dd71dde00bdef08a2
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-11 01:06:53 +00:00
Rodrigo Caballero
7e68a8b934 doc: Edit the GPIO driver APIs
Edit public API details for clarity, grammar, punctuation found
on file gpio.h

Used imperative verbs for all @brief descriptions.

Change-Id: I5c9b7ac39d2b691d98f72b66c67f525ad0409207
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-11 01:06:39 +00:00
Rodrigo Caballero
0daf7e4968 doc: Edit the SPI driver APIs
Edit public API details for clarity, grammar, punctuation found
on file spi.h

Made consistent use of @retval to document return values.

Used imperative verbs for all @brief descriptions.

Change-Id: Ie53eeeb79d399e8474fe7341a396f5437c2999dc
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-11 01:05:46 +00:00
Rodrigo Caballero
10bea3dec8 doc: Include the I/O APIs in the documentation.
Includes the I/O drivers' interfaces in the ReST documentation.

Change-Id: I9ef70c4b0561c102b5c9425b4e41b5c813bf51b6
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-11 01:04:38 +00:00
Rodrigo Caballero
9a1acd715a doc: Edit the code-block ReST documentation.
Change-Id: I4e38d9ed3cfb0aa50d559a94641c10175142f659
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-11 01:03:57 +00:00
Andrei Emeltchenko
483f015359 drivers/nble: Print local Bluetooth address
Add printing local bdaddr to help with discovery.

...
on_ble_gap_read_bda_rsp (0xa80089a4): Local bdaddr: C3:40:54:C7:DE:B4
(random)
...

Change-Id: I19f8000b1029fdc839303203d6bac91ee76231ed
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:02 -05:00
Szymon Janc
068fe1136e Bluetooth: SMP: Add support for TinyCrypt ECC
This allows to use ECC implementation from TinyCrypt instead of
controller based ECC.

Change-Id: I09bdff78899c1ac5cd1d10243d4c00c4d0a75d83
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 19:13:01 -05:00
Andrei Emeltchenko
86ae7dcb0c drivers/nble: Read local Bluetooth Address
Read and store local bdaddr, serialize command sequence.

Change-Id: Iea6a0e9d7dab3bbba04c26f47f07bc5d2527e9d7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:01 -05:00
Szymon Janc
708126cd30 Bluetooth: Use correct CONFIG option for TinyCrypt ECC define
The option is named CONFIG_TINYCRYPT_ECC_DH.

Change-Id: Ice30857d368582f5bc5d2f47e8ce6b1a89e29128
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 19:13:01 -05:00
Andrei Emeltchenko
5e3930cf12 drivers/nble: Use rsp instead of par
Using rsp instead of par makes code more intuitive.

Change-Id: Ib6594e78f4c6d0088e66e9023a696ea42a2e1f4f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:01 -05:00
Jukka Rissanen
4d3cb02446 net: Increase the 802.15.4 TX stack to 4096 bytes
If application needs to send large packets, the 802.15.4
fragmentation code needs to store the fragments somewhere.
Currently this somewhere is stack which means that we
need to increase the stack size quite a lot.

Change-Id: I9b08563e77c021e5ac103e637e331d7b977563cc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-10 19:13:01 -05:00
Szymon Janc
6de50c5aa6 Bluetooth: Store LE SC Public Key in SMP code
There is no need to keep this in bt_dev structure as this is not
used outside of SMP code.

Change-Id: I24a1d9daffb4d382bf1ed07a5645e4cbdafa3c5e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
31b9a82f65 Bluetooth: samples/peripheral_hr: Add "Zephyr" to device name
Change-Id: I6ff63676db9d74932a4eef648bf5284b9229d4f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Szymon Janc
c762215b79 Bluetooth: Remove CONFIG_TEST_RANDOM_GENERATOR from sample apps
This option is not needed as none of sample uses sys_rand32_get.

Change-Id: I00620a2fa7ea926d09e4e8f86cbf8ca7080478b3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 19:13:01 -05:00
Luiz Augusto von Dentz
36522ee71b Bluetooth: peripheral: Make heart rate simulation more predictable
sys_rand32_get appears to get stuck with same number for a while so
instead just increment the heart rate by 1 until 160 and then return it
back to 90.

Change-Id: I2aea870c68539271a1bb6190a958a7e2d1914dc3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-10 19:13:01 -05:00
Jukka Rissanen
971af2b249 cc2520: packetbuf attributes were set using wrong pointer
The buf pointer in cc2520_read() points to memory that will
hold the received data. It must not be used to set RSSI and
link quality values. Very difficult to find memory corruption
was seen as we were overwriting memory in other part of the
system. The fix was to set the RSSI and link quality variables
in read_packet() where the buf pointer points to proper memory.

Change-Id: I49bfe37f4c7ccc0f582f3aecdf73d5b3ea6bb4e5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-10 19:13:01 -05:00
Andrei Emeltchenko
ecfc0d12bf drivers/nble: Clean NBLE UART driver
Remove not used code and decrease number of log messages

Change-Id: I3a41fcc15d7f7b7e8802a13f6eb871794437a87c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
362579cc74 Bluetooth: samples/peripheral_hr: Pass explicit connection to bt_gatt_notify
Change-Id: Ie854ddc3a20ae38df0501ffaa4026dd37c7ae7d8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
7dc5596de7 drivers/nble: Pass correct handle in bt_gatt_notify
Change-Id: I90d85e681e4274722ed94dce839287e5868a93af
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Andrei Emeltchenko
7d91d3331f drivers/nble: Add debug for SM config response
Change-Id: I96b124cdf1808e1c948dd8a6511847511eacfbd2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
f23f8c3e96 Bluetooth: samples/peripheral_hr: Add adv-restart hack for nble
Force restarting advertising until nble is able to handle this by
itself.

Change-Id: Ife811eb69a63b98b3b0380b80e403d5d9dc10f22
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Andrei Emeltchenko
edd64e0746 drivers/nble: Update RPC to Nordic chip
Following changes in NBLE firmware update our RPC, shall be compatible
with firmware images building from 02/10.

Change-Id: Ifeb1193a241e9fea39c52a6c0f5bbd6c21041c08
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:01 -05:00
Andrei Emeltchenko
bcab0a8993 drivers/nble: Add configuration for device manager
Change-Id: I6a17462bd54492c4d84b4b92bf6cfbe9a4721fab
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
4af20ab08b drivers/nble: Add initial implementation of connection callbacks
Change-Id: I0c67bedac396b870c401af2992b1754510e06720
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
97e359e6ab drivers/nble: Implement bt_conn_get_info and bt_conn_get_dst
Change-Id: Ida9ca9c499bc3789ec15705c04c32dbb22e49165
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
b35bf098a0 drivers/nble: Clarify connection reference counting
Change-Id: I9ed8859cb32f240d131bb9d4ff774e2f805b16d3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
641d706597 drivers/nble: Implement bt_conn_lookup_addr_le
Change-Id: Ia22dfdc40b647e6f364fffec9963fb70609159f7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
fd28fc1b00 Bluetooth: Move address helper functions to hci.h
These are needed both by nble as well as the HCI stack and will likely
also be of use for applications.

Change-Id: Ifd10ae6df25151162d9d5491466324b4a42f5506
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
9c3fc8aa96 drivers/nble: Remove unnecessary bt_conn_add_le function
Change-Id: I99221b0b62219d59a076e8d228c4478571714e7a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Johan Hedberg
15b7cb6f1e drivers/nble: Adjust max conn count to something more realistic
Change-Id: I0cc91cddd4848e4f0da302163d438db0fc0199dd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 19:13:01 -05:00
Andrei Emeltchenko
48b10035c5 drivers/nble: Add basic connection handling support
Add connection handling skeleton keeping interfaces similar to
net/bluetooth and putting internals to private conn_internal.h header.

...
bt: rpc_deserialize (0xa8008924): on_ble_gap_connect_evt
bt: on_ble_gap_connect_evt (0xa8008924): handle 3
...
bt: rpc_deserialize (0xa8008924): on_ble_gap_conn_update_evt
bt: bt_conn_ref (0xa8008924): handle 3 ref 2
bt: bt_conn_unref (0xa8008924): handle 3 ref 1
...
bt: rpc_deserialize (0xa8008924): on_ble_gap_disconnect_evt
bt: bt_conn_ref (0xa8008924): handle 3 ref 2
bt: on_ble_gap_disconnect_evt (0xa8008924): conn 0xa80080c4 handle 3
bt: bt_conn_unref (0xa8008924): handle 3 ref 1
bt: bt_conn_unref (0xa8008924): handle 3 ref 0
...

Change-Id: I1885ecad5c57323b7d5a68be0c63d98dc65350b3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:01 -05:00
Andrei Emeltchenko
ff784b4175 drivers/nble: Add BLUETOOTH_MAX_CONN option
BLUETOOTH_MAX_CONN option is maximum number of simultaneous Bluetooth
connections supported.

Change-Id: If9629f919ba76fbd2803852c325b357c742edd9a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:01 -05:00
Luiz Augusto von Dentz
e4582107f4 drivers/nble: Fix log order when receiving a write event
For example when writing to CCC descriptor it may give the impression
that a handle is being written twice when in fact it is just calling
a callback.

Change-Id: I7aca87a1678789547224ef8d64f1f6c55af8022d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-10 19:13:01 -05:00
Szymon Janc
eccec2a5ac Bluetooth: Kconfig: Add option for enabling TinyCrypt
Add a single option for enabling use of TinyCrypt library for
crypto. This option selects all required TinyCrypt options
depending on BT features enabled. Thanks to this applications
only need to select single option instead of set of required
TinyCrypt features.

Change-Id: I2862e9ad3e204635f2ed3199433982bcfb7112f6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 19:13:00 -05:00
Szymon Janc
47ecb52064 Bluetooth: Add support for TinyCrypt based bt_rand
This allows to use pseudo random numbers generator provided by
tinycrypt instead of constant using of HCI LE Rand command.

HCI LE Rand commands are used only to initialize and re-seed PRNG.

Using tinycrypt for NRPA increase size of sample shell application
from 86852 to 89700 bytes.

Change-Id: I06e7392d087908caf37cd3ae648ea0bd5cc4ce61
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 19:13:00 -05:00
Andrei Emeltchenko
49a145c849 drivers/nble: debug: Remove extensive debug
Change-Id: I040c43abb7d84a77312fdc633dd522b2ca319fdc
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:00 -05:00
Andrei Emeltchenko
79b086d4c3 drivers/nble: Add conn handle debug logs
Change-Id: I9754ea80cfa8f56add1945a1b5fd5b2f4ba17ea3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:00 -05:00
Andrei Emeltchenko
7038367fe4 Bluetooth: trivial: Remove empty line
Change-Id: I23506caf37b66bb2c1b84b0121522431fe1748a9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-10 19:13:00 -05:00
Ravi kumar Veeramally
2f0e8dc28b cc2520: Return DEV_FAIL on initialization failed case
Change-Id: I4ce3d3cafcedf58f17fb7680186b950eb903332a
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-10 19:13:00 -05:00
Ravi kumar Veeramally
3432d1b423 cc2520: Add Kconfig option for TI cc2520 channel
Default cc2520/802.15.4 channel number is 26. Using Kconfig option
user will have chance to set different channel number between
11 and 26.

Change-Id: Id8f47ab5e328adae56e00adc6437c8ca8601a658
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-02-10 19:13:00 -05:00
Luiz Augusto von Dentz
7ab263ea6a Bluetooth: peripheral: Fix using CCC handle with bt_gatt_notify
The handle shall be the characteristic value handle not the CCC.

Change-Id: I677ca12fdd59023f2498f712b060197a59baee64
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-10 19:13:00 -05:00
Jukka Rissanen
cd14f65ebe net: Initialize Contiki vars related to L2 buffer mgmt
The l2_buf struct contains variables that Contiki uses
for it's state management. It is important that we
initialize these variables into sane values otherwise
there will be hard to catch errors like overwriting
memory in other parts of the system.

Change-Id: Id0f552a6f0f2858fc6e8e4964ada0715a40f46f8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-10 19:13:00 -05:00
Jukka Rissanen
6d2276e160 net: Print thread pointer in debug prints
This makes it easier to correlate the debug messages
to different fibers.

Change-Id: I6fb2d1265bb39fd27a1d1702e47eaf70e81ee98d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-10 19:13:00 -05:00
Luiz Augusto von Dentz
4efacd3d5b drivers/nble: Sync ble_gatt_notif_ind_rsp definition
The definition is not in sync with firmware which cause the following
error:

bt: rpc_deserialize (0xa8008a24): on_ble_gatts_send_notif_ind_rsp
panic: errcode -1

Change-Id: Iddaa1eece7c43b5707c01db6e053d104a2a846e6
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-10 19:13:00 -05:00
Johan Hedberg
2b7a5229f2 Bluetooth: samples: Add dedicated Heartrate peripheral sample app
This can be used to focus on demonstrating a simple heartrate service.

Change-Id: Ib59c653ebe356784592c8468767b45c5240ec67a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-10 19:12:55 -05:00
Szymon Janc
843268d78d Bluetooth: GATT: Refactor read API
Add read parameters to read callabck

Merge bt_gatt_read_multiple functionality into bt_gatt_read.
This makes it easier for application to handle all types of reads
as same sematics is kept for them.

Instead of destroy callback, call read_func with NULL data to
indicated that read has completed. This makes it clear when
read is completed and parameters used for it are no longer needed.
Thanks to this application doesn't need to abuse user data destroy
callback for detecting if read has completed. Since destroy callback
is no longer needed it is removed.

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

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

Change-Id: I8d6ea136b1e61c1dae73cca868b53c48c45a5492
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 18:52:29 -05:00
Luiz Augusto von Dentz
7e2264a065 drivers/nble: Increase rx buffer count
With peripheral application there is at least 6 commands sent in a row
which will lead to 6 responses which might cause the driver to run out
of buffers so this increases it to 8 to align with HCI driver.

Change-Id: I7ecbc2cfbaf754c35466c57124ff87d27766a07b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-10 18:52:29 -05:00
Johan Hedberg
6543318194 drivers/console: Fix writing out carriage return on all terminals
Some terminals (e.g. screen) don't seem to propagate carriage returns
through, creating the following kind of results when pressing enter in
a shell:

btshell>
         btshell>
                  btshell>
                           btshell>

Fix this by always printing out '\r' when receiving a carriage return.

Change-Id: Ia5ce5612c9b830edc84619538dc17a654b6e805b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 18:52:29 -05:00
Luiz Augusto von Dentz
eb3b2b5f83 Bluetooth: peripheral: Register services after init
With NBLE driver it is not possible to register services before
bt_enable completes.

Change-Id: I71194150b807e183b0016accb600ae9538ba9b01
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-10 18:52:29 -05:00