To avoid spending unnecessary time looking up the same keys multiple
times simply store a pointer to them from the connection context.
Change-Id: I94b550870c863237348a2cab7ba056be2a7f4bc5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If we're not actively performing pairing we should ignore any
encryption changes. If we don't do this the code might e.g.
incorrectly clear out existing keys.
Change-Id: Iac49a09abd7386b773e325b9bc939d6b6c741c92
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add support for handing the Identity Info and Identity Address Info
SMP PDUs.
Change-Id: Ie0ed57e2c1819a1619b9eaa340ed22666c81eea8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add support to store IRKs through the bt_keys API.
Change-Id: I01f713f8ad3657605a8bc2738db349d25bb89649
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll need to store many other keys besides slave LTKs. Refactor the
key handling code so that new types can be easily added.
Change-Id: I768db9cb29e8e73e87713e59f7b80af80399f20d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In preparation of adding more key support and to not bloat hci_core.c
prepare a new .c file for the key management code.
Change-Id: I5129a7a3a5d495a299f75e4e669253446a276142
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The public header file buf.h uses stdint.h definitions and should
therefore have the necessary include statement (since public header
files are supposed to be self-contained).
Change-Id: I9e2a9e13e5d2c35aa61c7552c3ba9fa73b8886a6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The input paramter is bt_addr_le_t so the function should be named
accordingly.
Change-Id: I7b796020d6e43ae1aa76a261cbfbaf7cba163029
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
bt_gatt_notify can be used to send ATT notifications:
< ACL Data TX: Handle 3585 flags 0x00 dlen 8
ATT: Handle Value Notification (0x1b) len 3
Handle: 0x0010
Data: 64
Change-Id: I908f10f9e60dc7cef221e4b27c3b6e49e7b0cfc9
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This uses BT_GATT_CCC to declare CCC descriptors which makes the core
to managed the CCC configuration so the task don't have to do it.
Change-Id: Ied4fc7eaa1f9f3e6c23d4d5b20d5c26d606f93f4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
BT_GATT_CCC uses _bt_gatt_ccc internal struct to handle peer
configurations and special helpers to read and write to minimize the
code necessary to handle CCC in the task.
Note this not yet include handling of connection and disconnection but
the idea is that the core would automatically disable the configurations
while disconnected and re-enable once peer connect back.
Change-Id: I89325b8a074766b9fd2423085565df669f7275e1
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Invalid peer address was being passed since the conn pointer was not
initialized properly.
Change-Id: Ib64584f1eb8bc534389bd4fa057c58dd00ffbd6d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
To implement CCC properly it is required to know the remote address since
it is per client, futhermore bt_gatt_notify requires an address where to
send the notification.
Change-Id: I9d9fdf72d668831bed76e2aef06816af3620f4b8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The BLUETOOTH_DEBUG_UART config option should depend on BLUETOOTH_UART
and also be sorted after it in the hierarchy.
Change-Id: I3e049e52c2e353cd0c6f1a99ca8934a289e0cce8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Follow the same style as bt_conn_lookup_handle (i.e. drop the 'by').
Change-Id: I6a31104fc8beac13c357088e46a91bd713fcfdd4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To take multiple different ways of looking up connections rename the
existing too generic bt_conn_lookup to bt_conn_lookup_handle.
Change-Id: I1c4965ad76738fa08ccca91b28cda552c9a88373
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
bt_conn_lookup_by_addr looks up for existing BLE connection by address.
Change-Id: If24516511b7d07cd99bbe095a737b38b0adaabad
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Buffers returned by bt_uart_evt_recv() and bt_uart_acl_recv() may be
NULL in theory. This makes code consistent by checking return value.
Change-Id: Id39def39c8b1c4c6eefc7b2bf01702c54b3e565c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This adds write callback to CCC descriptors storing the value in a stack
variable.
Change-Id: I8cd2567c6fee730500b446192b73fc82d86ba1ff
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Hexadecimal values should be in lower case.
Change-Id: Id79347997bab0673fb90f6f00ec9c2cff1440ee2
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add Notify property and Current Characteristic Configuration to Current
Time Service in peripheral app.
Change-Id: I44f36eea4f129c7b407b045da892f2ba88338592
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Move the usage reports into the function that does the analysis, and
also include a percentage of the usage. To make the results more
relevant give them in terms of the "real" stack size, i.e. the stack
space minus the CSS size in the beginning.
Change-Id: Ibc0418de396e140839c9a810196fbf16df533df5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
512 is a more accurate description than 1024 of the stack usage impact
of enabling debug logs.
Change-Id: I4b79b4eb9724ba624ff546973a1126c62382d1aa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To not have to always do the __noinit, debug log correction and 4-byte
alignement declaration create some helper macros for defining the
stacks.
Change-Id: I2de5068d7044af3f348ed01281498a777d04c97d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The CCS always starts at a 4-byte aligned boundary, so if the stack
given to fiber_start doesn't begin in such a place there will be some
unused bytes in the beginning and the 'real' stack will start at a
different offset. Take this into account when calculating the unused
stack portion.
Change-Id: I6c36d0354f4d014ad256b5580b76282d7d4384ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In case there are changes to the way the stacks are defined it's safer
to use sizeof() rather than rely on some specific size define.
Change-Id: Ic9ae090c0dbc0d88995a8883f9b4876be5958f1d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This one doesn't really contribute anything extra to the other info
that's already logged.
Change-Id: I741fa1a161914915bee0870dc102a7d0acfe0a33
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add Current Time Service currently providing hardcoded time since
there is no way of getting current time in the OS.
Change-Id: I9954d51f77905230a6dd180f37d3a48f379c69ec
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Set the stack sizes based on what the current utilization is for SMP
and GATT tests.
Change-Id: I892282a088d7b244f7abdbc92368addc9c19e4eb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To make it easy to periodically verify that we have sane stack sizes
it's helpful to have some code to evaluate how much of the stacks are
used. There's already a CONFIG_INIT_STACKS option which pre-fills the
stacks with 0xaa bytes, so we make use of it and in case the option is
enabled run the extra code to evaluate how much of each stack was
used. The trigger for the evaluation is a disconnection event.
Change-Id: I815ff96b2e6f877c29f4df3c949afae78222a8f3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
No need to waste CPU cycles initializing the stack variables.
Change-Id: Ifab0cf77ffb46d93aecb9a3082155478de782736
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Converting the coding conventions documentation over to the new format
Change-Id: I9f2552436e59c48a9fb9103834ad5a5d9c4bcc0f
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
- Update naming where it makes sense
- Fix a few spelling and phrasing issues
Change-Id: If08a7c77a35624adfdaafc276850b6d896356441
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove excessive use of zephyr and use a more generic
terminology where possible.
Change-Id: Ida8916765dbe824f63d7a4cedba60b35d14aee55
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Not all GCC toolchains generate a fully linked image (non-relocatable) when
using ${CC} for linking.
Change-Id: Id99501b6510cd6eeb87f245a6273fcebd6d36cde
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Informs the 'xtools' toolchain where to look for the libgcc.a library when
linking.
Change-Id: Ic990f1522dd8ddc9c5baf1366505e49929130969
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Some compilers default to a value for -march that is incompatible with the
specified -mcpu setting.
Change-Id: Id94fc6666efe86ab511cf2320bf07b2eb70d72ce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Aligns the default version of the xtools toolchain to that specified by the
x86.config and arm.config files under 'scripts/cross_compiler'.
Change-Id: Ib05766871a85de98c5ead19e15d740073f2f42cf
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The size of the k_args strcture must be equivalent to ...
CMD_PKT_SIZE_IN_WORDS * sizeof(uint32_t)
This is complicated by the fact that not only do different compilers treat the
size of 'bool' and 'enum' types differently, they may also pad structures
differently. Both of these differences have direct impacts on the k_args
structure. To work around this, the k_args fields 'alloc' and 'Comm' are
forcibly aligned to a 4-byte boundary, while the rest of the k_args structure
is packed.
Change-Id: I722f1a585e5e34a7a7218ed0b214b54fac6d39f7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>