Commit graph

9523 commits

Author SHA1 Message Date
Asbjørn Sæbø
6f94d02463 Bluetooth: Audio: Media control client
This commit adds the Media Control Client from the topic-le-audio
branch.  This is a part of the upmerge of the le-audio media control
files.

This client has been developed and maintained over a couple of years
now, and is mature.  During the development it has passed both
IOP-testing and PTS qualification testing.

The commit is a pure copy of the files and content in the
topic-le-audio branch, with the following exceptions:

- files are in bluetooth/audio instead of bluetooth/host/audio, with
  some include paths updated as a consequence
- as a consequence, CMake files and Kconfig files updates are done in
  other locations
- a macro for debug output of Object ID values has been (temporarily)
  added to mcc.h, to avoid a dependency
- a blank line added after a declaration and an overlong line split,
  to pass check_compliance
- copyrights have been updated

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-11-11 15:31:37 +01:00
Asbjørn Sæbø
7e33147330 Bluetooth: Audio: Temporary Object Transfer client
This commit adds the Object Transfer client from the topic-le-audio
branch.  This is a part of the upmerge of the le-audio media control
files.  Media control depends upon Object Transfer for feature
completeness.

This client works, and has been used for IOP- and PTS-testing of the
media control server and client.  It does, however, need an overhaul
before being made "Zephyr official", so for now it will be kept as an
internal file to the le-audio code.

The commit is a pure copy of the files and content in the
topic-le-audio branch, with the following exceptions:

- files are in bluetooth/audio instead of bluetooth/host/audio, with
  an include path updated as a consequence
- a sa consequence, CMake files and Kconfig files updates are done in
  other locations
- In otc.c a superfluous semi-colon has been removed to please
  check_compliance
- Kconfig.ots has been renamed to Kconfig.otc, as there is only
  otc-content left in that file
- copyrights have been updated
- add TODO that these files are to be cleaned up and moved

The Object Transfer Client in this commit was originally written by
Leif Aschehoug <Leif-Alexandre.Aschehoug@nordicsemi.no>.
It has later been updated and maintained by
Emil Gydesen <emil.gydesen@nordicsemi.no> and
Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>

ots
2021-11-11 15:31:37 +01:00
Piotr Pryga
acde30b8f9 Bluetooth: controller: enable missing RSSI while periodic adv sync
The RSSI measurement was not enabled while receiving periodic
advertising. The function responsible for enable the feature
in radio was called, but it was done too early.
It was overwritten by radio_switch_XXX function that assigns
a value to RADIO->SHORTS register.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-11-11 10:05:31 +01:00
Szymon Janc
556736df35 bluetooth: Fix L2CAP CoC response code if LTK is present
If an LTK or an STK is available and encryption is required
(LE security mode 1) but encryption is not enabled, the
service request shall be rejected with the error code
"Insufficient Encryption".

This is affecting L2CAP/LE/CFC/BV-25-C and L2CAP/ECFC/BV-32-C
qualification test cases.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-10 08:28:49 -05:00
Szymon Janc
0cfba7e9b3 Bluetooth: Disconnect L2CAP channel if peer sent too much data
This was affecting L2CAP/LE/CFC/BV-26-C, L2CAP/LE/CFC/BV-27-C,
L2CAP/ECFC/BV-33-C and L2CAP/ECFC/BV-34-C qualification test cases.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-09 19:58:42 -05:00
Johan Hedberg
dc3e1bcb41 Bluetooth: host: Remove confusing left-over comment
This comment was previously associated with a stand-along net_buf_ref
call. Now it's not clear what exactly it's referring to, and the
additional reference to net_buf_put() is fairly self explanatory.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2021-11-09 22:21:23 +02:00
Emil Gydesen
e748e76988 Bluetooth: Audio: Move csis.h to include/bluetooth/audio
Move the header file csis.h from the internal location to
the public include directory. This file is supposed to provide
the public API for CSIS and the CSIS client, but is not fully
complete yet.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Emil Gydesen
dd519f2a10 Bluetooth: Audio: Add CSIS client shell
Add support for the CSIS client shell to interactively
use the CSIS client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Emil Gydesen
9f728d54de Bluetooth: Audio: Add CSIS shell
Adds the CSIS shell implementation, to interactively control
the CSIS server.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Emil Gydesen
c7b49cf1e4 Bluetooth: Audio: Add coordinated sets identification service client
Adds the coordinated set identification service (CSIS) client.

    This is still a work in progress and thus there are no public
    API for it yet, and some code changes will still be needed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Emil Gydesen
d55aeb4a1e Bluetooth: Audio: Add coordinated sets identification service server
Adds the coordinated set identification service (CSIS) server.

This is still a work in progress and thus there are no public
API for it yet, and some code changes will still be needed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Erik Brockhoff
613ff42277 Bluetooth: controller: support not passing invalid SDUs on HCI datapath
Adding a KConfig to allow for disabling of the passing of invalid SDUs
through the ISOAL HCI data path.

Defaults to keeping current behavior.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2021-11-09 11:16:49 +01:00
Ingar Kulbrandstad
59d5ef1e24 Bluetooth: Mesh: Moved composition data out of mesh shell
The mesh shell module owns the composition data for the shell
application, which makes it impossible to use it outside of the
application itself. To support the shell as a generic debugging
component that can be added to any application, we have moved the
composition data out of shell.c, and into the application.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2021-11-08 11:07:11 -05:00
Ilya Makarov
2cab8772b5 Bluetooth: host: Fix MIC generation in Bluetooth CCM encryption
bt_ccm_encrypt only works when encrypting in place. To fix this
ccm_auth() inside bt_ccm_encrypt() must take plaintext instead of
enc_data, to not rely on assumption that plain and cypher data are the
same memory.

Signed-off-by: Ilya Makarov <ilya.makarov.592@gmail.com>

Fixes: #40069
2021-11-08 11:00:33 -05:00
Vinayak Kariappa Chettimada
8613cc760e Bluetooth: Controller: Fix missing auxiliary context release
Fix missing auxiliary context release when reception of
Periodic Advertising Chain PDU fails due to header complete
timeout, i.e. no reception of on-air PDU. Also, fix missing
generation of auxiliary reception failure notification when
no auxiliary context was allocated for chain PDU reception.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-08 16:54:46 +01:00
Emil Gydesen
69f1236657 Bluetooth: ISO: Store SDU and PHY for peripheral
When an CIS is connected, the peripheral did not have
any information about the QoS settings. This commit
adds information about the PHY and SDU. For some reason
the peripheral won't ever have information about the RTN.

The remaining values in the event (interval, delay and
latency) are still not exposed, nor is framing or
packing, the latter of which are not part of the event.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-07 05:42:29 -05:00
Johan Lundin
bc0db8931c Bluetooth: Host: Set SID in bt_le_per_adv_sync_recv_info
Sets SID in bt_le_per_adv_sync_recv_info when host receives
a Periodic Advertising Report

Signed-off-by: Johan Lundin <johan.lundin@nordicsemi.no>
2021-11-06 00:41:28 +02:00
Lingao Meng
b29ce22a96 Bluetooth: Mesh: Fix incorrect write conn_count
When Device use pb-gatt bearer provisioning, and first
provisioning failed due to some reasons(invalid oob etc..).

Which cause `proxy:gatt_disconnectd` incorrected write `conn_count`

Cause this var euqals `-1`.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-05 14:29:27 -04:00
Vinayak Kariappa Chettimada
cff3703e3d Bluetooth: Host: Add Periodic Advertising ADI support
Add Periodic Advertising ADI support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
6433a6aac1 Bluetooth: Controller: Add Periodic Advertising ADI support
Add implementation to add ADI in Periodic Advertising PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
346141d936 Bluetooth: Controller: Use a function to get unique DID
Refactor the implementation to use unique DID.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
e50c6b0c7a Bluetooth: Controller: Fix Advertising LLL header initialization
Fix Advertising LLL header initialization to be done early
so that other functions like Periodic Advertising Parameter
set functions can use LLL context to reference ULL conttext.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
400ff7b99c Bluetooth: Controller: Periodic Adv ADI Support for Duplicate Filtering
Add implementation to support Periodic Advertiser ADI
support for duplicate filtering.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
cb39a13b53 Bluetooth: Controller: Move Periodic Advertiser List option check
Move Periodic Advertiser List option check in LE Periodic
Advertising Create Sync command to HCI.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
b68c9cd442 Bluetooth: Controller: Use data status complete HCI define
Review rework to use data status complete HCI define.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
2e4ed76287 Bluetooth: Controller: Fix Extended Scan Duplicate Filtering
Fix Extended Scan Duplicate Filtering to consider different
advertising mode and multiple advertising set id from same
advertiser Bluetooth device address.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
9bfba6948b Bluetooth: Add missing header that defines BT_ISO_SDU_BUF_SIZE
Add missing header iso.h to hci_raw.c, that defines the
BT_ISO_SDU_BUF_SIZE.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 09:52:48 +01:00
Vinayak Kariappa Chettimada
99e02ad62a Bluetooth: Controller: Fix missing initialization of crc_ok
Fix missing initialization of crc_ok in the Periodic
Advertising Sync implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 09:52:22 +01:00
Vinayak Kariappa Chettimada
a7b5cc7af8 Bluetooth: Controller: Use define for offset unit bits
Use define for offset unit bits in the auxiliary pointer
structure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:36:49 -04:00
Vinayak Kariappa Chettimada
1d0709792d Bluetooth: Controller: Use function to get set/clear AD data
Use function to get the set/clear AD data parameter to
populate the common extended payload format field.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:36:49 -04:00
Vinayak Kariappa Chettimada
c78e0512d6 Bluetooth: Controller: Explicitly typecast void return
Explicitly typecast void return for memcpy and memmove
calls.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:36:49 -04:00
Vinayak Kariappa Chettimada
dab1bb17d5 Bluetooth: Controller: Update PDU header fields population
Updated the implementation to allow population of auxiliary
pointer field as necessary to append PDU chains.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:36:49 -04:00
Vinayak Kariappa Chettimada
0c196d1334 Bluetooth: Controller: Extended Scan Response back-to-back chaining
Add LLL implementation to chain Extended Advertising Scan
Response PDUs back-to-back.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:36:49 -04:00
Vinayak Kariappa Chettimada
c5eab2011f Bluetooth: Controller: Extended Advertising back-to-back chaining
Add LLL implementation to chain Extended Advertising PDUs
back-to-back.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:36:49 -04:00
Lingao Meng
fd5c30c68b Bluetooth: Add check given services is register API
Add API for chech given services is register.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-11-03 18:57:03 +01:00
Vinayak Kariappa Chettimada
7d53c61da3 Bluetooth: Controller: Fix missing traversal of TargetA
Fix missing traversal of TargetA field in advertised Common
Extended Payload Format. This will cause invalid offset used
for fields following the TargetA when Extended Directed
Advertising is used.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:59:46 +01:00
Vinayak Kariappa Chettimada
a3baf8f5da Bluetooth: Controller: Fix ASSERTION FAIL [!hdr->disabled_cb]
Fix ASSERTION FAIL [!hdr->disabled_cb] @ ull_conn.c:882

When initiating a connection using continuous scan window
if there is preemption by the next window then the ISR
callback was overwritten to switch to next scan window
instead of the initiator event being closed.

Fixed by not aborting the initiating state when requested
by the next continuous scan window.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:59:00 +01:00
Vinayak Kariappa Chettimada
311d6da337 Bluetooth: Controller: Review rework fixes and adding const qualifiers
Review rework fixes and adding const qualifiers.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
5725cea881 Bluetooth: Controller: Use define for max advertising radio channels
Use define for maximum number of primary advertising radio
channels used while scanning.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
e4c40a5f99 Bluetooth: Controller: Use defined to check Adv and Scan filter policy
Use defines to check Advertising and Scan filter policy.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
2128e4ab1c Bluetooth: Controller: Use define to translate HCI to Aux Ptr PHY index
In HCI event, PHY indices start at 1 compare to 0 indexed in
aux_ptr field in the Common Extended Payload Format in the PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
c1ed2bc17b Bluetooth: Controller: Minor whitespace and return data type fixes
Minor changes to remove redundant whitespaces and to use
uint8_t instead of uint32_t to return true or false.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
3ba30426ca Bluetooth: Controller: Add const qualifiers to functions
Add const qualifiers to function parameters.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
f0ea78815a Bluetooth: Controller: Improve directed address type readability
Improve readability of directed address type implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
effb0ef60f Bluetooth: Controller: Fix missing reset of LLL scheduling
Fix missing reset of LLL scheduling flag when auxiliary PDU
scan scheduled in LLL is aborted due to preemption.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
ed7e902813 Bluetooth: Controller: Fix skipped Extended Scanning
Fix continuous skipping of Extended Scanning of Auxiliary
PDUs. Due to duplicate prepare events of continuous scanning
present before the auxiliary scanning prepare, preemption
schedules only the primary scan prepare and auxiliary scan
infinitely is postponed.

This is a revert of commit 190532bcc4 ("Bluetooth:
Controller: Only remove duplicate resume events").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
333c23beec Bluetooth: Controller: Implement Extend Adv Report HCI fragmentation
Implementation to fragment the list of received Extended
Advertising PDUs into HCI LE Extended Advertising report
events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
edb436512b Bluetooth: Controller: Fix missing PDU end timestamp for Scan Response
Fix missing implementation to setup the PDU radio end
timestamp capture for Scan Response PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
158dd2936c Bluetooth: Controller: lll and lll_aux for lll_scan and lll_scan_aux
Use variable names lll and lll_aux for struct lll_scan and
struct lll_scan_aux respectively.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
ebc903aee5 Bluetooth: Controller: Add auxiliary PDU device address match
Add implementation to check auxiliary PDU device address
match by comparing the address in the AUX_ADV_IND PDU with
the addresses in the filter accept list.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00