The QoS structure is not related to a codec, but rather a
stream, and should thus not use the "Codec" name.
The BAP and ASCS specs refer to the QoS as
"QoS configuration" several places, so it is an obvious
choice for a name.
Since the structure is defined and used by BAP, the prefix
was changed from bt_audio to bt_bap.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If a connection update (from central) overlaps a peripheral initiated
conneection param request, then central rejects peripheral request
and continues central procedure. This lead to an assert in peripheral
On instant there would not be an rx_node for notification, as this
would have been discarded by the reception of the REJECT.
This fix ensures that once an rx_node has been 'accepted' for retention
it will not be discarded/overwritten by future rx_nodes
The test will trigger the assert without the fix in.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
The `bonded` flag of the callback `pairing_complete` is always true,
event if the SSP pairing is non-bondable.
Check the bonding status in SSP complete event instead of in link key
notify event.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In current, the bondable flag cannot be configured for each specific
BR connection.
But for LE conn, there is a function `bt_conn_set_bondable` for this
purpose.
Improve `bt_conn_set_bondable` to support BR conn.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
If the return value of function bt_get_bondable is false, clear the
bonding flag when controller requiring `Authentication_Requirements`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Removes duplicate declaration of the bridging direction, keeping the
one in the public header file.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Adds the `bt_mesh_brg_cfg` prefix to the public Subnet Bridge API, and
aligns the function and callback naming with the rest of the Bluetooth
Mesh API.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Add a function bt_l2cap_br_get_remote_fixed_chan to get the remote fixed
channels.
If the fixed channel CID 0x0007 is unsupported, skip the LTK derivation.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Current, the callback `pairing_complete` is called
when the pairing is filed. But there is a callback
`pairing_failed` for pairing failed case.
Correct the callback calling if pairing failed.
Call `pairing_failed` instead of `pairing_complete`
if the pairing failed.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Due to the BT_CONN_BR_PAIRING is cleared when
receiving ssp pairing complete event. The LTK
key cannot be derived after the BR connection
encrypted.
Add a flag BT_CONN_BR_PAIRED that the pairing
has been done.
Use this flag to indicate whether the LTK
derivation needs to be applied if the BR ACL
connection is encrypted.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When the ssp pairing event is notified, clear the pairing
flag.
It is used to support case that the authentication is
started by peer, the link will not be encrypted after
the pairing is completed without any err.
If the local device want to encrypt the link, it could
call `bt_conn_set_security` to start encrypt the link
after the pairing complete callback triggered.
In original implementation, the `bt_conn_set_security`
cannot be called if the authentication has been started.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Currently, the bonding type of Authentication
_Requirements parameter is always `Dedicated
Bonding` if the device is pairing initiator.
But if the bonding is performed during
connection setup or channel establishment as
a precursor to accessing a service, the
bonding type should be `General bonding`.
Add a flag BT_CONN_BR_GENERAL_BONDING.
Set the flag if the bonding is performed in
the L2CAP_BR/RFCOMM channel establishment.
Set bonding type depends on the flag when
receiving IO cap request.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The `resolving` is used to flag the status that the stack is requesting
remote device name.
It is better to use the type `bool` instead of the original type
`uint8_t`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Move `struct discovery_priv` to classic.h
Rename `struct discovery_priv` to `struct bt_br_discovery_priv`.
Modify the structure `struct bt_br_discovery_priv` with `@private`.
Change field `_priv` of `struct bt_br_discovery_result` from
`uint8_t _priv[4]` to `struct bt_br_discovery_priv _priv`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Due to the update of function bt_br_discovery_start,
register discovery callback by calling
bt_br_discovery_cb_register.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Remove BR discovery callback from bt_br_discovery_start.
All discovery results will be notified through callback
registered by bt_br_discovery_cb_register.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The results of inquiry and extended inquiry
are only reported from application level
after the inquiry complete event notified.
While the event of inquiry result is notified
by controller in real time.
It is not a good user experience.
Just like scanning of LE, add a listener
cb for discovery.
When the event of inquiry result, extended
inquiry result, or remote name request
complete notified, call listener `recv`
cb to notify the upper layer.
When the event of inquiry complete
notified or no pending of remote name
request , call listener `timeout`
cb to notify the upper layer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Once panic mode is entered, the log write functions are called from an ISR,
so must not try to acquire locks.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
The unicast_stop function is changed to primarily do a
BAP disable instead of a release, with optional
support for releasing the streams once they have been disabled.
This also adds unittests for the procedure which also
allow us to remove the invalid param testing from the BSIM tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Because timing of the pause/resume for peripheral/sync is based on
central/broadcaster active clock, the sleep-clock jitter shall not be
added.
Signed-off-by: Morten Priess <mtpr@oticon.com>
- Add next pointer to node_rx_iso_meta for pre-transmission linked
list (does not increase memory usage as union is larger).
- Fix broadcaster not setting PTC with test configuration
- Refactor stopping of sync ISO tickers to separate function
Signed-off-by: Morten Priess <mtpr@oticon.com>
Share pause/resume functionality by moving resume ticker handling to
ull_iso. Rename interface function to ull_conn_iso_resume_ticker_start,
and provide handles instead of instance pointer.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Remove unused nRF21 FEM SPI CSN control as the Zephyr
Controller does not implementation SPI control for Tx/Rx
nor for Tx gain settings.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added support for dynamic registration and unregistration of the
Broadcast Audio Scan Service (BASS) within the scan delegator.
This enables both scan delegator and BASS to be registered or
unregistered dynamically at runtime.
Signed-off-by: Babak Arisian <bbaa@demant.com>
This commit makes the device tree configuration decide
which link layer is compiled in. We do this to avoid
hard-to-understand linker errors referencing device tree nodes.
The following configuration creates a difficult to parse
linker error:
* BT_LL_CHOICE contains multiple entries, BT_LL_SW_SPLIT
is selected.
* Each BT_LL_CHOICE has its own unique device tree node with its
own "compatible".
* Only one of the link layer device tree nodes has status "okay",
but not the one corresponding to BT_LL_SW_SPLIT.
The linker error indicates that code using the HCI driver fails
to link with the controller. This because the HCI driver device
tree node references the link layer selected in devicetree which
is not compiled in.
By adding a dependendency to the device tree node, this can no longer
happen. Instead, if BT_LL_SW_SPLIT is now selected in a configuration
file, a Kconfig warning will be issued:
```
warning: The choice symbol BT_LL_SW_SPLIT
(defined at subsys/bluetooth/controller/Kconfig:129) was
selected (set =y), but BT_LL_SOFTDEVICE (defined at
/home/ruge/ncs/nrf/subsys/bluetooth/controller/Kconfig:11)
ended up as the choice selection.
```
This should be easier to understand than:
```
...(hci_core.c.obj):(.data.bt_dev+0x16c):
undefined reference to `__device_dts_ord_132'
```
After this commit we should consider getting rid of link layer
selection from Kconfig completely as the link layer is in practice
selected through device tree.
Unit tests have been updated to satisfy the dts dependency.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
The CSIP spec states that the procedures shall only be done
on bonded devices, so a check for that was added.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This change adds bt_le_cs prefix to public CS API as well as
adding le_cs prefix to CS related bt_conn callbacks. This is
to ensure consistency within CS API while maintaining the
separation between the Bluetooth LE and Classic features.
Signed-off-by: Burak Gorduk <burak.gorduk@nordicsemi.no>
Adds following HCI support for CS configuration:
- LE CS Create Config command
- LE CS Remove Config command
- LE CS Config Complete event
Two callbacks have been added to notify the application
when a new CS configuration is created or an existing
CS configuration is removed.
Signed-off-by: Burak Gorduk <burak.gorduk@nordicsemi.no>
Added a timeout for active scans (instead of using the host's scan
timeout) in the shell by submitting a k_work that stops the scan
after a specified period.
Fixes#78659
Signed-off-by: Babak Arisian <bbaa@demant.com>
Channel sounding frequently produces very large events, so the default
of 68 bytes can lead to buffer overruns / memory corruption.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
In the handler of SMP_Pairing rsp, the encryption key
flag is cleared incorrectly.
It causes the LE LTK cannot be derived.
Do not modify the encryption key flag to fix the
issue.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The TBS and GTBS instances can now be dynamically registered
and unregistered, which fits better for the use cases of TBS
where specific bearers can come and go depending on the
features of the device.
For example if a SIM card is inserted, then a device can
register a TBS for the provider and remove it again if the
SIM card is removed.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Moves around the shell files so that they are placed nearer
to the features they expose access to.
A few changes as possible has been made.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_gatt_attr_read function did not properly handle cases
where value is NULL and/or value_len is 0, or bad mixes of the
two.
The important part is here is that we do not perform the pointer
arithmetic on NULL and/or call memcpy with a NULL src with a
non-0 length.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add missing NULL check for public API function, so that the
function will return -EINVAL rather than crashing.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added helper functions to set and get assisted listening
stream values for codec capabilities and codec configs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The QoS preference defined by ASCS has some specified
limits and values that we should enforce.
Given the current API we cannot return an error to the
unicast server if it supplies invalid values, so we have
to resort to a LOG_ERR.
For the unicast client we treat invalid QoS preferences
similar to other invalid data in the notifications.
This also adds additional documentation in the
bt_audio_codec_qos_pref struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>