Use the ISO Data sent callback in iso_broadcast sample to
synchronize the ISO data send. ISO Data sent callback is
generated every SDU interval corresponding to the number of
completed packets event generated by the Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Patch to rename struct bt_ots_init to struct bt_ots_init_param
to avoid duplicating the name bt_ots_init.
Fix for issue#45968
Signed-off-by: Jai Arora <infolinesoni@gmail.com>
Rename the bt_codec struct to bt_audio_codec_conf or
to the new struct bt_audio_codec_cap.
Rename the bt_codec_data to bt_audio_codec_data.
The purpose of this is to split the codec specific configuration
and codec capabilities into seperate structs, as they do not
reflect the same values, or used for the same purpose.
This commit depends on the preset macros workings on either
type of struct (for now), but will be modified in future updates.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This fixes metadata length checks for BT_AUDIO_METADATA_TYPE_EXTENDED
and BT_AUDIO_METADATA_TYPE_VENDOR that should be at least 2 bytes long.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The CCID list can be empty, as the Assigned Numbers is not strict
regarding it's minimum length.
Fixes: #59666
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Restore back BT_CTLR_ISO_TX_BUFFER_SIZE to 251 after fix in
commit e460847b60 ("Bluetooth: host: don't fragment ISO
if len <= MTU").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Rx Prio thread stack usage value to Kconfig default
value. After long duration use of hci_rpmsg in audio
application, remaining stack was 80 bytes, hence increase
back to 448 as set in the Kconfig defaults.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
As per table 4.2 in BAP v1.0.1, the BAP unicast client shall
support at least 2 (> 1) endpoints in either direction if it
supports that direction.
Since Kconfig does not support such requirements (0 || > 1),
this is done using a BUILD_ASSERT.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This PR adds ability to build mesh with tf-m psa
for platforms those support tf-m.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
A mesh key type has been added to be able to choose the different
key representation for different security libraries.
The type as well as some functionality related to Mesh key
management has been added as a public API.
If tynicrypt is chosen then keys have representation
as 16 bytes array. If mbedTLS with PSA is used then keys are
the PSA key id. Raw value is not kept within BLE Mesh stack
for mbedTLS. Keys are imported into the security library
and key ids are gotten back. This refactoring has been done
for the network(including all derivated keys), application,
device, and session keys.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
The default transport latency was not valid.
Set it to a value that is large enough.
The minimum possible transport latency is 16580 us,
but this assumes the controller ignores the RTN=2.
If the controller uses the RTN=2, the transport latency will
be slightly larger than 30 ms depending on
how the controller chooses to setup the ISO link.
Therefore, we set it to 40 ms to ensure the default
configuration is valid.
How these numbers were found:
For unframed PDUs this is defined in Core_v5.4, Vol 6,
Part G, Section 3.2.2:
Transport_Latency =
CIG_Sync_Delay + FT * ISO_Interval - SDU_Interval
Because unframed PDUs are being used, the ISO interval needs
to be a multiple of SDU interval.
If MaxPDU = MaxSDU and the PHY is 2M, this results in that
the maximum subevent size is:
2120 * 2 + 2 * 150 = 4540.
For 2 CISes this is 9080 us > 7500
Therefore, the controller has to set the ISO interval to a
minimum of 15000 us in order to fit the packets.
Based upon this info, the controller has the freedom to ignore
or use the requested RTN=2.
1. Ignore -> NSE is 2: Minimum ISO interval is 15000 us
2. RTN = 2, Increase NSE: 4 * 4540 = 18160 -> ISO_Interval = 22500 us
3. RTN = 2, Increase the FT to 2, NSE = 2 -> ISO_Interval = 15000 us
For (1):
Transport_Latency = CIG_Sync_Delay + 15000 - 7500
= CIG_Sync_Delay + 7500
For (2):
Transport_Latency = CIG_Sync_Delay + 22500 - 7500
= CIG_Sync_Delay + 15000
For (3):
Transport_Latency = CIG_Sync_Delay + 2 * 15000 - 7500
= CIG_Sync_Delay + 22500
As shown in Core_v5.4, Vol 6, Part B, Section 4.5.14,
CIG_Sync_Delay needs to be larger than or equal to the length of
all ISO events. That is, the sum of the subevents:
For (1): CIG_Sync_Delay = 2 * 4540 = 9080
For (2): CIG_Sync_Delay = 4 * 4540 = 18160
For (3): CIG_Sync_Delay = 2 * 4540 = 9080
This results in the following transport latencies:
For (1): Transport_Latency = 9080 + 7500 = 16580
For (2): Transport_Latency = 18160 + 15000 = 33160
For (3): Transport_Latency = 9080 + 22500 = 31580
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
It is not intentional to continue advertising once a connection has been
established for two reasons:
1. We do not configure enough connection contexts for this
2. We don't want to generate controller scheduling conflicts that can
possibly reduce performance.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
BlueZ btusb does not recognize hci_usb sample as Bluetooth
Controller when CDC ACM is enabled in the sample.
Refer to https://github.com/zephyrproject-rtos/zephyr/issues/29107
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Tx ISO Data packet sequence number increment based on
the send timer timeout value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Relax Tx ISO SDUs being dropped in unicast audio client and
server samples when using the Zephyr Bluetooth Low Energy
Controller, i.e. Tx ISO SDUs dropped due to delayed ISO data
send calls in upper layer with respect to payload number in
the current ISO radio events in the Controller.
This option is disabled in the sample and users can use it
when need be.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add Zephyr Bluetooth Low Energy Controller overlay config for
the unicast audio client and server samples.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Only print incoming data when the data is valid. Otherwise we also
print incoming data when no data was received.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from samples. It
has been deprecated since this PR:
https://github.com/zephyrproject-rtos/zephyr/pull/56183
The Kconfig symbols has been replaced by `CONFIG_LOG=y` on most of the
cases. Or it has been removed when not needed anymore.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
This fixes regression causing compilation errors seen when the
code is built without preset support (BT_HAS_PRESET_COUNT = 0).
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Enable the send timer only when at least one ASE source is enabled,
CONFIG_BT_ASCS_ASE_SRC_COUNT > 0 in case of unicast_audio_server,
CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT > 0 for unicast_audio_client.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Add and use specific macros for manufacturer, product, and
serial number string descriptors.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Added Kconfig options to make HAS characteristics that has notify as
optional property selectable and thus optional. These settings are
global, meaning that a chosen notify property will be used for all
registered has instances.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
Add support for long writes for the unicast client and server.
This reuses the ATT buffer for long reads.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
After removing the high default for MCS, it was discovered that
the TBS client requires a significant amount of buffers to work
properly as well. Added the requirement as a build assert that
depends on which optional TBS client features are enabled.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
strtok should not be used for the purpose it was being used for.
Furthermore, the pointer that was stored from the value is not
a long-living pointer, and would in fact be invalid after the
callback has returned.
Modified the code so that we store the value in the application
and then do a proper search for the first URI in the list.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The TMAP central had a few bugs. It was also using the old
BAP discovery API.
The commit fixes the bugs, and updates it to use the new BAP
discover API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Using EM2 or deeper sleep states (where HF clocks are off) requires
special care if BLE radio is used, since BLE radio relies on that clock,
and its power/clock requirements need to be taken into account
On SiLabs, radio PM is implemented as part of RAIL blob, which relies
on sl_power_manager HAL service. I've implemented SoC PM
state changes using sl_power_manager instead of emlib, and added
call to RAIL PM initialization in Gecko HCI driver.
Signed-off-by: Roman Dobrodii <rdobrodii@antmicro.com>
Add implementation of the Telephony and Media Audio Service, as well as
two sample applications.
tmap_central reflects a smartphone implementing the Unicast Media Sender
and Call Gateway TMAP roles.
tmap_peripheral reflects an earbud implementing the Unicast Media
Receiver and Call Terminal TMAP roles.
Upon connection, tmap_central starts an audio stream using CAP Initiator
APIs.
CCP, MCP and VCP are discovered and used to send example commands.
Future improvements: 2-earbud support, add TMAP Broadcast roles,
update with new CAP Acceptor/Commander APIs as they become available
Signed-off-by: Silviu Petria <silviu.petria@nxp.com>
Add a new endpoint callback that is used to report the found
ASEs during BAP discovery, rather than calling
the discovery callback with optional values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a new pac_record callback that is used to report the found
PAC records during BAP discovery, rather than calling
the discovery callback with optional values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the BAP unicast client specific discover parameter struct.
This make the BAP discover work more similar to the other
profiles.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The direction has been moved to a function parameter instead,
and we keep a local copy of the value in the stack instead.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Several duplicates were found with
scripts/twister -T samples/ -T tests/ --dry-run --list-test-duplicates
This is an issue since duplicated names causes overwriting of
results. Most duplicates looked like obvious copy-pase errors.
New names where addopted looking at other tests in the same yaml
or looking at the directory/descriptio.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Modify the BT_UUID_XX_ENCODE and BT_LE_SUPP_FEAT_XX_ENCODE
macros to use the SYS_ENCODE_LEXX macros, instead of re-inventing
the encoding.
Also apply the macros for several other places.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function bt_codec_cfg_get_chan_allocation_val takes a pointer
to an enum, rather than an uint32_t, but was wrongly defined in
the header files and incorrectly used a few places.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>