Commit graph

42249 commits

Author SHA1 Message Date
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
Szymon Janc
51ac70d42b Bluetooth: GATT: Refactor subscription API
This removes destroy callback for userdata as bt_gatt_subscribe
doesn't take any user data parameters and that destroy callback
was acctually called with subscribe parameters.

We assume subscription is active if bt_gatt_subscribe returned 0
(ie write command was sent). This is due to remote might be sending
notifications before reply to write.

Also note that bt_gatt_subscribe doesn't take any user data parameters
and that destroy callback was acctually called with subscribe
parameters.

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

Change-Id: I58ac9cd481ffa08ccc2d7a0464ca75f61fb280c5
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 18:52:29 -05:00
Szymon Janc
c12c48c4b2 tinycrypt: Fix compilation with ECC enabled
Common ecc.c code was not compiled resulting in following link error:

crypto/tinycrypt/lib.a(ecc_dh.o): In function `ecc_make_key':
crypto/tinycrypt/source/ecc_dh.c:50: undefined reference to `vli_set'
crypto/tinycrypt/source/ecc_dh.c:51: undefined reference to `curve_n'
crypto/tinycrypt/source/ecc_dh.c:51: undefined reference to `vli_sub'
crypto/tinycrypt/source/ecc_dh.c:54: undefined reference to `curve_n'
crypto/tinycrypt/source/ecc_dh.c:54: undefined reference to `vli_cmp'
crypto/tinycrypt/source/ecc_dh.c:53: undefined reference to `vli_cond_set'
crypto/tinycrypt/source/ecc_dh.c:56: undefined reference to `vli_isZero'
crypto/tinycrypt/source/ecc_dh.c:62: undefined reference to `curve_G'
...

Change-Id: Ib590fd7330753c0ae8ef54159b0f2b7461b5b38e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 22:14:58 +00:00
Szymon Janc
0f7bc9dd67 tinycrypt: Fix few typos in Kconfig help messages
Change-Id: Ia6442359e1ab5116083c065ae63e4b929e74ef76
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 22:14:58 +00:00
Andrew Boie
6bb087c511 sanitycheck: add testcase.ini field for slow tests
Some tests take a very long time to complete, add a directive in
testcase.ini to mark them as such. Unless --enable-slow is passed
on the command line, these tests are not executed, only compiled.

app_kernel and test_sha256 marked as slow test cases. It appears
test_sha256 was being skipped earlier due to platform_whitelist line
which has been removed; the test should be able to run on all
microkernel-supporting boards. Same with test_aes, which completes
very quickly and is not marked as 'slow'.

Change-Id: I39ec8212f3fa10122ff786c10b6659d22bae64e3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-10 22:12:55 +00:00
Dan Kalowsky
0d8308ec3f samples : adc : fix build issues
Change-Id: I5ac198a5af2748ac5ac1be90e173a98887e9f559
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-10 11:23:56 -05:00
Dan Kalowsky
5d81be5c9d adc : rename device to just ADC
Part of making the device model work, is using a more generic name for
the devices.  Currently the ADC uses 2 possible solutions, when it should
be using just one name for them all.

Change-Id: Id9b78b3edf234391819847bb9b8534747d7d4409
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-10 11:23:56 -05:00
Dan Kalowsky
9ccd5ce785 adc : ti : only one instance
There can only be one instance of an ADC, but we have code setup for
multiple.

Change-Id: I94eae2450bdc6b138ebad66f80a7c451cefe32a9
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-10 11:23:56 -05:00
Dan Kalowsky
e97507a034 adc: dw: there is only one ADC
The ADC for DesignWare is currently setup to handle multiple dev entries,
but there only ever exists one.  No reason to add to complexity for multiple
if there is only going to be one.

Change-Id: I0b77ef91160776dcf0aea1a50b144fff2b2be9e2
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-10 11:23:56 -05:00
Dan Kalowsky
4743684e4f struct packing
Looking at all structs as to where we can pack them a little better, and
calling out the padding/stride at the end for future expansion.

Change-Id: I4a651092e950dd3d915af9fa0ee0d7d59803e58f
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-10 16:21:26 +00:00
Andrew Boie
f21ff23310 x86: add debug function to dump IDT
Looking at the IDT in a debugger is confusing, add a pretty-printing
function.

Change-Id: Iacc5e204e5d11e3e875c75ddf6d2e2e80b230299
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-10 16:02:17 +00:00
Andrew Boie
313ed31253 x86: fix IDT entry definition
It was, in a nutshell, wrong. Fortunately, the incorrectly
specified fields weren't being used by anything.

Change-Id: I0fa63fa16a267502744a7a2c82865c7de8b5446e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-10 16:01:26 +00:00
Rodrigo Caballero
869181a994 doc: Edit the ADC driver APIs
Edit public API details for clarity, grammar, punctuation found
on file adc.h.

Used imperative verbs for all @brief descriptions.

Change-Id: Icd4787b450bb7cb2a706d38993f2a4c03d691994
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-10 04:08:53 +00:00
Anas Nashif
3f123c6b6e doc: fixed include path for input directories
Change-Id: Iec71dd19a676bd6a9349a386990034fc7ddd2f85
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-10 03:30:50 +00:00
Benjamin Walsh
48e4f82f3c device: fix race condition in device_sync if ISR runs before thread waits
If an ISR was enabled and ran before the thread that wants to wait for
completion actually does wait, the type of thread would not be
registered in the object. The ISR would thus not know what type of
semaphore to release. This caused the ISR to release the object for the
previous caller of device_sync_call_wait().

Instead, the ISR now looks if there is already a waiter: if not, it
marks the device as being ready in the object, which allows the thread
to skip taking the semaphore; if there is a waiter, the correct
semaphore type is released, as before.

Change-Id: Ib97480db8ba3e895812cf4bc209d9794639af325
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-10 02:08:30 +00:00
Daniel Leung
f42664554e sanitycheck: enable build tests for Arduino Due
This enables sanitycheck to build for Arduino Due.

Note that there is no on-board bluetooth so bluetooth tests
are skipped.

Change-Id: I4f564e68ec65f01b7b33a32f6d0d7749290c0e5b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-10 01:35:33 +00:00
Daniel Leung
e20c79c154 samples: test_tickless: enable test for Atmel SAM3
This adds the necessary functions to enable the tickless idle test
for Atmel SAM3 family processor.

Change-Id: I19e2a8c898dbbc687c980d06bb6c19de693b97a4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-10 01:35:33 +00:00
Benjamin Walsh
3c66686a43 sys_clock: start the microkernel ticker in the MICROKERNEL init level
The ticker was always initialized in the NANOKERNEL init level. In a
microkernel, this can cause problems if for the some reason the
initialization of the microkernel server is delayed, such as devices
initialization in the NANOKERNEL level taking non-insignificant time to
complete. What happens in that case is the ticker ISR will start firing
and piling up events in the microkernel server stack, and quite quickly
overrun it, since it has a finite size, causing random crashes.

So, in the microkernel, initialize the ticker once the microkernel
server is available. There is no point in sending ticker event before
anyway.

Change-Id: Ie9e13184f6ad35954023faf3bbff26242284b7be
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-10 01:35:14 +00:00
Benjamin Walsh
205d3a4265 device: fibers/idle task must wait when acquiring device_sync object
TICKS_NONE was mistakenly used when waiting on the nanokernerel
semaphore in the microkernel case, instead of TICKS_UNLIMITED, causing a
thread that wants to wait to return immediately, as if the device was
always ready.

Change-Id: Id2376ebef324339fec05c56655e705755a670973
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-10 01:34:37 +00:00
Daniel Leung
7cd4d5b9c4 samples/footprint-min: turn off IPM for ARC
On x86, IPM is not enabled for footprint min benchmark. Extends this
to ARC too.

Change-Id: I099fc00c9f8ee086118c63523ad28afd6c991732
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-10 00:38:22 +00:00
Peter Mitsis
08b353b8b4 minimal libc: stdlib.h no longer includes ctype.h
The libc 'ctype.h' header file is not supposed to be automatically
included when including 'stdlib.h'.

Change-Id: I821a9946894572a7b82804b1569b7b18c24316db
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-09 23:41:59 +00:00
Anas Nashif
fb44466164 doc: create api directory
Change-Id: Iecf09fd9b362f7c1ea25efdc5ac3d2345630766a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-09 17:15:56 -05:00