Refactor the bt_audio_codec_cfg to use flat arrays to store
metadata and codec specific configurations.
The purpose of this is to make it easier to copy the data
between layers, but also to support non-LTV data for non-LC3
codec configurations.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This removes odd `subscribe` parameter from bt_tbs_client_discover
function parameters list. As the API user enables specific
CONFIG_BT_TBS_CLIENT_* option, the client implementation should
subscribe to the characteristic notifications so that the user receives
the value updates.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
As the metadata has to be validated anyway, let the initial vaidation of
metadata to be done in ASCS. The application can still reject the
metadata, but the length validation and supported type validation can be
performed by the stack.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Since the driver can now be also used on nRF91 Series, its name need to
be updated to not cause confusion.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Add `yd_esp32` board:
- Model name: YD-ESP32
- Manufacturer: VCC-GND® Studio
- Espressif module: ESP32-WROOM-32E
Signed-off-by: Julio Cesar <hi@jcsx.dev>
There is no reason why the capabilities
should be modified by the stack after registration,
nor any reason why a the unicast client application
needs to modify the reported remote capabilities, so
all have been marked as const.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Refactor the bt_audio_codec_cap to use flat arrays to store
metadata and codec specific capabilities.
The purpose of this is to make it easier to copy the data
between layers, but also to support non-LTV data for non-LC3
codec capabilities.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The broadcast sink API has been modified so that all scanning, etc.
will be done by the application, rather than the stack. This commit
updates the sample to use this updated API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The broadcast sink API has been modified so that all scanning, etc.
will be done by the application, rather than the stack. This commit
updates the sample to use this updated API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add (optional) advanced ISO support for the benchmark ISO
sample. The CONFIG_BT_ISO_ADVANCED Kconfig simply needs to
be enabled in order to support the advanced settings.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add (optional) advanced ISO support for the benchmark ISO
sample. The CONFIG_BT_ISO_ADVANCED Kconfig simply needs to
be enabled in order to support the advanced settings.
This also reduces the number of default channels supported
to 1.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove virtual esp32 board and replace it with the
real word boards:
- esp32_devkitc_wroom
- esp32_devkitc_wrover (with PSRAM option)
Signed-off-by: Marek Matej <marek.matej@espressif.com>
Add two TMAP broadcast sample applications.
tmap_bms implements the Broadcast Media Sender role. It uses CAP
Initiator broadcast APIs to broadcast an audio stream.
tmap_bmr implements the Broadcast Media Receiver role. It scans and
syncs to the PA having filtered the EA by the presence of TMAP role
information. It also instantiates the VCP.
Signed-off-by: Silviu Petria <silviu.petria@nxp.com>
This intoduces dedicated Kconfig option to enable TBS client,
that makes the configuration more intuitive.
While configuring GTBS only, the user does not have to explicitly set
the BT_TBS_CLIENT_MAX_TBS_INSTANCES to 0 to disable the TBS client
functionality.
This adds also `tbs_only_client` test case to test the TBS only build
option.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
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>
Implementation of preliminary Central with multiple CIS
create support in Lower Link Layer. Uses a simple CIS
offset calculation that works when ACL are created with
connection interval that is multiple of CIG ISO interval.
Each ACLs are offset using BT_CTLR_CENTRAL_SPACING hence
having the same CIG sync delay values for all the ACLs.
Advanced Scheduling to setup CIS in any order of ACL and
CIS combination, ACL placed anywhere in timeline and CIS
creation will come therein will be implemented in later
Pull Requests.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use BT_CONN_TX_USER_DATA_SIZE when defining pools of buffers that will go
through `bt_conn_send_cb()`.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Enfore a minimum duration between edges on the IRQ pin to give the HCI
controller time to detect the state change. Without this delay and with
several packets queued on the `rx_queue`, the pin could be re-asserted
almost immediately after being cleared.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Some samples, tests got missed in the switch from void main() to
int main(). Cleanup those samples/tests to use int main().
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
With the minimal C library malloc implementation moving to libc/common, all
of the related Kconfig variables have also changed. Update uses within the
tree.
Signed-off-by: Keith Packard <keithp@keithp.com>
`bt_conn_le_create` returns a signed value. Error message format string
expects an unsigned value.
This commit changes the expected value in the format string to a signed
one, to match what `bt_conn_le_create` returns.
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
Avoid hitting the assert
```
__ASSERT_NO_MSG(net_buf_simple_tailroom(buf) >= len);
```
when the provided buffer is longer than we can fit. Instead discard the
packet and log an error.
This handling is similar to packets are discarded in hci_uart
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Add a new sample that demonstrate the following points:
- Exchange of Key Material;
- Advertising encrypted data;
- Read advertising data;
- Decrypt advertising data that are encrypted.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Main now has a int return type.
Fix return values, so this sample can be compiled.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This applies the coccinelle script to another set of files:
samples/bluetooth/bthome_sensor_template/src/main.c
samples/boards/stm32/power_mgmt/standby_shutdown/src/main.c
samples/drivers/smbus/src/main.c
samples/drivers/virtualization/ivshmem/doorbell/src/ivshmem.c
samples/fuel_gauge/max17048/src/main.c
samples/hello_world/src/main.c
samples/sensor/proximity_polling/src/main.c
samples/subsys/logging/ble_backend/src/main.c
tests/drivers/build_all/mfd/src/main.c
Signed-off-by: Keith Packard <keithp@keithp.com>
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.
Most of these changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.
Signed-off-by: Keith Packard <keithp@keithp.com>
The platform nrf52_bsim was specified as an integration platform,
but was missing from the allow list.
This commit adds this platform to the allow list.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Fix broadcast audio source and sink samples' conf file to
use Broadcast ISO feature in Zephyr Bluetooth Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The init infrastructure, found in `init.h`, is currently used by:
- `SYS_INIT`: to call functions before `main`
- `DEVICE_*`: to initialize devices
They are all sorted according to an initialization level + a priority.
`SYS_INIT` calls are really orthogonal to devices, however, the required
function signature requires a `const struct device *dev` as a first
argument. The only reason for that is because the same init machinery is
used by devices, so we have something like:
```c
struct init_entry {
int (*init)(const struct device *dev);
/* only set by DEVICE_*, otherwise NULL */
const struct device *dev;
}
```
As a result, we end up with such weird/ugly pattern:
```c
static int my_init(const struct device *dev)
{
/* always NULL! add ARG_UNUSED to avoid compiler warning */
ARG_UNUSED(dev);
...
}
```
This is really a result of poor internals isolation. This patch proposes
a to make init entries more flexible so that they can accept sytem
initialization calls like this:
```c
static int my_init(void)
{
...
}
```
This is achieved using a union:
```c
union init_function {
/* for SYS_INIT, used when init_entry.dev == NULL */
int (*sys)(void);
/* for DEVICE*, used when init_entry.dev != NULL */
int (*dev)(const struct device *dev);
};
struct init_entry {
/* stores init function (either for SYS_INIT or DEVICE*)
union init_function init_fn;
/* stores device pointer for DEVICE*, NULL for SYS_INIT. Allows
* to know which union entry to call.
*/
const struct device *dev;
}
```
This solution **does not increase ROM usage**, and allows to offer clean
public APIs for both SYS_INIT and DEVICE*. Note that however, init
machinery keeps a coupling with devices.
**NOTE**: This is a breaking change! All `SYS_INIT` functions will need
to be converted to the new signature. See the script offered in the
following commit.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
init: convert SYS_INIT functions to the new signature
Conversion scripted using scripts/utils/migrate_sys_init.py.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
manifest: update projects for SYS_INIT changes
Update modules with updated SYS_INIT calls:
- hal_ti
- lvgl
- sof
- TraceRecorderSource
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
tests: devicetree: devices: adjust test
Adjust test according to the recently introduced SYS_INIT
infrastructure.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
tests: kernel: threads: adjust SYS_INIT call
Adjust to the new signature: int (*init_fn)(void);
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Remove qemu_cortex_m3 from various bluetooth tests and samples since
they enable NVS which requires CONFIG_FLASH_PAGE_LAYOUT which is
not supported on qemu_cortex_m3 since there is no flash driver.
We get build failures with the arm-clang compiler because nvs.c
is referencing z_impl_flash_get_page_info_by_offs which does not
exist.
Switch to qemu_x86 as the integration_platforms if it was
qemu_cortex_m3 before.
Removed the bluetooth.mesh.mesh_shell.reduced_legacy as this was
added specifically for building on qemu_cortex_m3.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Add support for the Scan Delegator for the Broadcast
Audio Sink sample. This include advertising connectable
as well as handling PAST.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Per the BAP specification, if the Broadcast Sink role is
supported, then the Scan Delegator shall also be supported.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix RAM overflow building for direction finding feature on
nRF53 Series, by reducing thread stack sizes. And move
building DF plus CIS feature to hci_uart sample from
hci_rpmsg sample.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix RAM overflow by using default values for
BT_BUF_ACL_RX_SIZE and BT_BUF_ACL_RX_COUNT. Default Rx size
of 27 is sufficient for nRF51 SoC, as it does not support
data length extensions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
We get compile warnings of the form:
error: converting the result of
'<<' to a boolean; did you mean
'((__aeabi_ctype_table_ + 1)[(byte)] << 28) != 0'?
[-Werror,-Wint-in-bool-context]
if (!isprint(byte)) {
^
Since isprint (and the other is* functions) return an int, change check
to an explicit test against the return value.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
The unicast client used the BT_DATA_UUID16_SOME and
BT_DATA_UUID16_ALL instead BT_DATA_SVC_DATA16 for
discovering ASCS servers.
BT_DATA_SVC_DATA16 is the right one to use, as that
is mandatory for a server to advertise, and the UUID
ones are only recommended. Furthermore, the service data
of the ASCS server can now also be retrieved.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
From now app layer is able to return explicit response code and
reason that will appear in ASE Control Point notification.
Fixes issues of ASCS/SR/SPE/BI-(07/08/09)-C PTS test cases, where
PTS was receiving wrong response codes and reasons.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Add kconfig to let the ISO broadcast and ISO receive samples report
packets no more than once per set interval of packets.
Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
Some recent PRs included conditional compilation for
KCONFIG_BT_LL_SW_LLCP_LEGACY, which must be removed.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
This commit removes the legacy LLCP code including the
Kconfig option
It also updates the babblesim tests, and removes the
tests for the legacy controller
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
To enable Bluetooth controller coexistence feature, there is
implementation of ticker task, which aborts any ongoing radio events
during assertion of the grant pin. This solves the co-existence issue
in the role of the subordinate transceiver.
Signed-off-by: Tomáš Beneš <tomas@dronetag.cz>
Remove duplicated board specific conf file for iso_broadcast
and iso_receive samples. Instead, have an overlay conf file.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Several places used the bt_audio prefix where it shouldn't.
Also moved the BAP documentation to its own file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added a new header file bap_lc3_preset.h which contains
the definitions of the LC3 (pre)sets defined by the
BAP spec.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename the bt_audio_unicast_client API to bt_bap_unicast_client
and move the API to bap.h
Also adds the _bap_ infix to the bt_unicast_client functions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename the bt_audio_audio_server API to bt_bap_unicast_server
and move API to bap.h.
This also adds the _bap_ infix for bt_unicast_server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removes the unused pac_pache from the unicast_client.
This moves the storing of the PAC records (in the form of
struct bt_codec) from the stack to the upper layers.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The sample was only willing to connect if the pair RSSI level
was over -35dBm. That is ok when testing physically keeping
devices at less than 1 meter from each other.
But in CI we test with a default attenuation of 60dB between
devices and the Tx power is 0dBm.
Which causes the tests based on this sample to fail.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The sample was only willing to connect if the pair RSSI level
was over -40dBm. That is ok when testing physically keeping
devices at less than ~1 meter from each other.
But in CI we test with a default attenuation of 60dB between
devices and the Tx power is 0dBm.
Which causes the tests based on this sample to fail.
Fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
nrf51 has been discontinued. There is no reason to support
ble mesh as well as new mesh features and fitting of samples
for nrf51 DK platforms. As alternative support of nrf52840
has been added if there wasn't before.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
This drops using the environmental part when referencing ZEPHYR_BASE
as the environment value does not have to be set and, in most cases,
is no longer set at all.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Allow the Unicast Audio Client sample to work if there are no
sink or no source ASEs on the remove device (e.g. if the remote
device only has sink ASEs).
If the remote have neither, it will abort.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The Zephyr controller does not support PAST, and there
is no other controller we can build upstream with these samples.
Disable these 2 samples for the nrf52_bsim until PAST
is supported by the controller.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
If waiting on the first semaphore in the main loop times out, the main
loop starts from the beginning and attempts to start scanning for
broadcast sources. But since the first semaphore was not passed, the
scan_recv_cb callback was not called yet and thus the previously started
scanning was not stopped. As a result, an attempt to start the scanning
will fail with -EALREADY and the main thread will end. To solve this,
-EALREADY is now ignored when checking the return value of
bt_audio_broadcast_sink_scan_start.
Signed-off-by: Ladislav Podivin <ladislav.podivin@tietoevry.com>
Set the bbc_microbit board as part of the integration platforms, since
the sample is designed for the board and so CI should fail if the sample
no longer builds for it.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The sample no longer fits in RAM, reduce the number of discardable
packets to make it fit.
Fixes#55328.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Since the commit 897d2b8204 ("boards: arm: nrf52840dongle_nrf52840: Use
USB CDC as default UART") this board has the 'cdc_acm_uart' node defined
and selected (with 'chosen' node) as 'bt-c2h-uart' by default. Overlay
file is no longer required.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Only the receiver of the audio is allowed to send the
receiver start ready command.
Furthermore, this removes the automated transition to the
streaming state on the server, as the server now shall
call bt_audio_stream_start to put the stream into the
streaming state.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This instance might be shared by other users that may have opened it
earlier in the boot chain.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Zero initialize has_param in BSIM test.
Also, specify all bt_has_register_param members in hap_ha sample.
Signed-off-by: Lars Knudsen <larsgk@gmail.com>
- Include ISO stream count in ISO streams definitions in
controller.
- Create ISOAL source on controller when ISO data path is
setup.
- Send broadcast data buffers transferred from host over
HCI to ISOAL as ISO SDU fragments.
- Allow bot conn and ISO data to use data_buf_overflow.
- Store ISO interval during BIG create.
- Remove ISO data path for each BIS during BIG terminate
procedure.
- Set value (temporarily) for ISOAL target_event enabling
it to Tx data.
- Check status of data fragment sent to ISOAL for memory
allocation and other errors.
- Destroy ISOAL source when ISO stream released.
- Use ISO Advertising handle, not stream handle to destroy
ISO data path.
- Remove extra ISOAL sink destroy call when removing ISO
data path.
- Add FIXME comment as reminder to address LL_ASSERT on
isoal_status error.
Signed-off-by: Carl Stehle <droid@appception.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add direction finding, Broadcast ISO and Connected ISO conf
files for build coverage and user convenience to build
respective binaries for nRF53 Series network core.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The HIDs sample is currently setup with a passkey callback and requires
authenticated write and read access.
Add a sample option to disable the passkey callbacks, and automatically
set the GATT attributes as encryption required. This is a useful sample
setup as real world HID devices (mice, keyboards...) usually don't have
a passkey mechanism, and removing the callback to reproduce that setup
while not changing the GATT permission leads to automatic disconnections
for encryption failures that can be fairly hard to troubleshoot.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Set a sample name and description for a bunch of tests where those are
left as "TBD" right now.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Set the packing field when creating the broadcast source. This
is currently missing, and in uninitialized.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This fixes the application that was not waiting for QoS configuration of
all streams in the group. The QoS operation is done on group of streams,
while the status of each one of the streams is received separately.
Meaning that the application has to control which streams were already
configured before enabling them.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Allow the streams to be paired when creating unicast group. This will
allow to reuse the same ISO for the paired streams.
Fixes: #51796
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Update the Readme file of the large mtu sample because the orginal PR
(https://github.com/zephyrproject-rtos/zephyr/pull/53593) has been merged
before the last comment could be addressed.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Add nrf5340_audio_dk_nrf5340_cpunet to the platform_allow
as having it only in integration_platforms causes issues
with the CI system.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the README to add more informations on MTUs. Also add a diagram of
the different MTU and Kconfig symbols in the Host.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Add a new sample that demonstrate how to exchange MTU to allow larger
packet transmission.
The sample is split in two applications. One is the Central, it will
initiate the MTU exchange. The other one is the Peripheral and will try to
send a large notification. If the MTU exchange fail or the new size is not
big enough, the Peripheral will not be able to send the notification.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Disables having USB enabled for boards that configure USB CDC for
console, shell or logging at bootup in applications that enable USB
to prevent a conflict arising whereby USB is registered from
multiple points and later calls fail.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The macro BT_CONN_INTERVAL_TO_MS was used a fair amount
of places, but it often was used with integers. This meant
that sometimes the resulting (integer) value would be
incorrect, as something like 7.5ms interval would not
be properly stored as a integer in millisecond units.
Adding BT_CONN_INTERVAL_TO_US allows users to still use
integers to store the result, but in a more accurate unit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix all line-length errors detected by yamllint:
yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
grep '(line-length)'
Using a limit is set to 100 columns, not touching the commandlines in
GitHub workflows (at least for now).
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add the ISO packing field when creating a unicast group.
This refactors the structure of the unicast group create,
as it now takes both the packing as a group parameter, as well
as an array of stream-specific parameters.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This changes HAS registration to be dynamic and let's the
application set Hearing Aid Type and binaural features.
Often, devices are flashed with generic firmware with some
features stored post factory production, requiring
the settings to be moved from compile time to run-time.
This change will increase the RAM usage as the GATT
service is moved from ROM to RAM.
Signed-off-by: Lars Knudsen <larsgk@gmail.com>
Co-author: Soren Engquist <soren@engquist.dk>
Move the check for the pa_interval to before we start
parsing the data for the name, as that is more optimized.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Verify that the peridic advertising interval is non-0 to
ensure that the remote device is actually advertising
with peridic advertising enabled.
This fixes an issue where per_interval_ms would be set to 0,
causing bt_le_per_adv_sync_create to fail to invalid values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove the struct bt_vcp pointer from the volume
renderer API, as there is only ever a single
Volume Renderer instance on a device.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Split the `bt_vcp_cb` struct into separate structure for
the volume controller and the volume renderer.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The VCP server, known as the volume renderer, has a
more explicity bt_vcp_vol_rend API naming scheme now.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Renames almost all occurences of VCS to VCP, as we want to
use the profile as the namespace for volume control.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename vcs.h to vcp.h to better detail what the
file contains, as it is more than just VCS. This also
renames the Kconfig file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Imcrease the supported number of subgroups to 2 as well as the number of
streams to 2, so that it matches the default configuration of the
broadcast audio source sample.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The `bluetooth/common/log.h` and `bluetooth/common/log.c` files have been
removed. Files that were using them have been updated to use
`zephyr/logging/log.h` instead.
Those replacement have been done consequently:
- `/BT_DBG/LOG_DBG/`
- `/BT_ERR/LOG_ERR/`
- `/BT_WARN/LOG_WRN/`
- `/BT_INFO/LOG_INF/`
- `/BT_HEXDUMP_DBG/LOG_HEXDUMP_DBG/`
- `/BT_DBG_OBJ_ID/LOG_DBG_OBJ_ID/`
Also, some files were relying on the `common/log.h` include to include
`zephyr/bluetooth/hci.h`, in those cases the include of `hci.h` has
been added.
For files that were including `common/log.h` but not using any logs,
the include has been removed and not replaced.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Use the service instance struct instead of the more generic
`bt_csip` for the CSIP set member API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Renamed remaining structs and functions that are not
for the set coordinator to use the set member CSIP
role name.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Renamed the coordinated set implementation to use the
profile (CSIP) name instead of the service (CSIS) name, as
the former is more general.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Increase the time between resets from 30s to 120s.
This make it easier to properly use, while still get
the chance to test the stop functionality.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Updates the broadcast source API to create subgroups and
to set BIS specific codec configuration
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove Kconfig file samples/subsys/usb/usb_pid.Kconfig added in
the commit e5cbe6a9e7 ("usb: cdc: Add unique PIDs for each sample")
with the motivation to have a separate ID for each sample supposedly
to be recognizable by the host.
The new USB support does not use the options, VID/PID is set
directly in the application. As a note, it is not necessary to have
unique PID for each sample, especially for the well known USB classes.
Replace the individual Kconfig options in the documentation
by a table with the references to the samples and PIDs.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Currently, the sync timeout means the device will timeout
straight after it syncs. This means we cannot send a sync
transfer as we are no longer synced.
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
Setting the extended advertiser as default advertiser
to improve both preformence and reliability.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
The data field is a *pointer* to the buffer, not the actual buffer itself.
Instead of smashing past the end of the struct, write through that pointer.
Signed-off-by: Keith Packard <keithp@keithp.com>
This changes the API to use proper naming convention, as the code has
been moved out of capabilities.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The sequence number is by the core spec defined as 16-bit.
We had implemented a workaround for the wrapping of the
sequence number, which required the type to be larger
than 16-bit (32-bit).
However, since the definition of the sequence number,
and the use of, is poorly defined by the core spec, we
are reverting this workaround and reducing the sequence
number to 16-bit again. This way it is more in line
with the core spec, as well as more intuitive given the
other uses for the sequence number.
This change moves the responsibility of using the
right value to the upper layers, as the stack can
and will no longer provide any guarantees.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This refactors how the BAP broadcast source handles the
extended and periodic advertising.
First it removes the start and stop of the extended
advertising, and instead expects the application
(or upper layers) to do this.
Second it exposes API functions to get the
necessary advertising data from BAP (service data and
the BASE), which the upper layers will then also
be responsible for setting and updating.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the config file to support 2 Broadcast Streams in
hci_rpmsg samples for running iso_broadcast and iso_receive
samples on nRF5340 DK.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add project configuration overlay file to build the current
full feature set Bluetooth Low Energy Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The direction is used to identify the list to append the registered
capabilities. There is no need to keep it in the bt_audio_capabilities,
it can be provided as a function parameter instead.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Use Identiy address in direction_finding_connectionless_tx sample.
Without this option the advertiser is advertising using an NRPA since
it is a non-connectable advertiser.
The function bt_le_ext_adv_oob_get_local cannot be used to get the NRPA
address of the non-connectable advertiser when privacy is disabled.
Check the return address of bt_le_ext_adv_oob_get_local.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This removes the callbacks from capabilities. The callbacks are used for
unicast server role only, while the capabilities are used for the
broadcast sink role as well. Thus the callbacks can be removed as there
is another bt_audio_unicast_server_cb API that is specific for unicast
server role.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This PR adds support using the USB CDC UART in the hci_uart sample,
including sample configuration for the nRF 52840 dongle.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
When the stopped callback is called, then the CIS is disconnected.
This should stop the sending of data from the server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix the iso_broadcast and iso_receive sample to wait on
semaphore for all channel establishment and all channel
terminate callbacks to be invoked.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Increase the ISO Tx Buffers to avoid throttling of ISO data
transmission when using 2 Broadcast ISO streams.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The controlling expression of an if statement
and the controlling expression of an iteration-statement shall have
essentially Boolean type.
Signed-off-by: Pirun Lee <pirun.lee@nordicsemi.no>