Commit graph

86 commits

Author SHA1 Message Date
Emil Gydesen 0f5aa8aa81 Bluetooth: Audio: Shell Remove BT_HAS_PRESET_CONTROL_POINT_NOTIFIABLE
Do not enable BT_HAS_PRESET_CONTROL_POINT_NOTIFIABLE as it
depends on EATT which isn't enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-14 18:18:36 -04:00
Emil Gydesen 353a05b116 Bluetooth: BAP: Unicast server depend on PACS
When in the BAP unicast server role, at least PAC sink
or PAC source shall be set.

In order to fulfill this new requirement, a few other Kconfig
options had to be changed to a `depends on` from `select` to
avoid recursive Kconfig requirements. This change may require
some applications to update their configurations according
to the migration guide.

The change from `select` to `depends on` is ideal anyhow
as that is the recommended way to add dependencies.

This can checked via the combined BT_PACS Kconfig value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-30 14:30:45 -04:00
Emil Gydesen 53fa757cea Bluetooth: Audio: Shell: Add additional controller configs to audio.conf
The configuration file is mostly tested for the nRF53 series
where the controller configuration is usually from the
hci_ipc sample.

This means that the existing audio.conf before this commit
has not really been tested for audio, and were missing a few
configurations to make it work properly.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-18 14:55:49 +02:00
Emil Gydesen 16ec531a5b Bluetooth: Audio: Shell: Disable EATT support
EATT is not properly used by LE audio nor is the
Zephyr implementation very good, so disable for now
or at least until the BSIM tests are passing with it
enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-09 14:21:04 +02:00
Emil Gydesen 6073b630da Bluetooth: Audio: Shell: Increase BAP BA recv state count
Increase the supported receive state count to 4, as
several on-market device have at least 2 and sometimes
more.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-08 09:11:06 -04:00
Ping Wang 5ccd75b49b Bluetooth: Audio: define bt_bap_bass_subgroup struct.
The Broadcast Assistant API should be fully independent of the scan
delegator. Therefore the new struct bt_bap_bass_subgroup has been
defined to avoid a dependency.

Fixes: #68338

Signed-off-by: Ping Wang <pinw@demant.com>
2024-02-14 19:04:01 +01:00
Daniela Andreea Dumitrache 3bfb2e3ab2 Bluetooth: Audio: Add implementation for PBP and dedicated sample apps.
PBP API allows sources to create a Public Broadcast Announcement.
PBP API to parse a Public Broadcast Announcement.

public_broadcast_source application starts extended advertising and
includes a Public Broadcast Announcement. The advertised broadcast
audio stream quality will cycle between high and standard quality.

public_broadcast_sink application scans for broadcast sources and
synchronizes to the first found source which defines a Public Broadcast
Announcement including a High Quality Public Broadcast Audio Stream
configuration.

Add bsim tests for Public Broadcast Profile APIs.

Add shell implementation for Public Broadcast Profile APIs.

Signed-off-by: Daniela Andreea Dumitrache <danielaandreea.dumitrache@nxp.com>
2024-01-09 09:59:23 +01:00
Jonathan Rico a05a47573a Bluetooth: ATT: Internalize ATT PDU TX pool
Why?
- metadata is easier to manage as an array + index
  - less error-prone -> less memory-management bugs
- we can. because of the previous refactor
- PDU allocations are more predictable
- ATT buffer size can be optimized by app
- isolates ATT from the rest of the ACL users
  - decouples ATT PDU size from e.g. SMP w/ LESC

Drawbacks:
- higher memory usage
- kconfig change

The higher memory use is only temporary, as this will be followed-up
with more refactors that should bring it back down.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-15 17:14:56 +02:00
Emil Gydesen 9c8ec58beb Bluetooth: GMAP: Add GMAP shell
Add the GMAP shell module with support for running the
various audio configurations in an easy way.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-11 18:30:57 +01:00
Emil Gydesen 3fec3964e0 Bluetooth: CAP: Move initiator/commander common code to cap_common
The CAP Initiator and the CAP Commendar share quite a lot of
functionality in terms of discovery and performing set-based
procedures.

The code for handling most of this has been moved to
cap_common.c to avoid duplicating code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-07 16:14:42 +00:00
Emil Gydesen b92ac42677 Bluetooth: CAP: Commander API and skeleton
Adds the CAP Commendar API and skeleton that can
implemented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-07 09:49:41 +01:00
Emil Gydesen 84c01bb527 Bluetooth: Audio: Add ISO test parameters to the BAP API
Add support for the ISO test parameters in the BAP API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-20 14:50:48 +02:00
Emil Gydesen 6ccd112c56 Bluetooth: Audio: Refactor bt_audio_codec_cfg to flat arrays
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>
2023-08-28 15:56:53 +02:00
Fredrik Danebjer 4c94056f74 Bluetooth: Audio: Make PACS optional notify actually optional
Added Kconfig options to make the various PACS characteristics that are
optionally notifiable selectable as notifiable. Selecting a
characteristic as notifiable will make it so for all pacs instance on
the device.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-08-28 15:56:26 +02:00
Emil Gydesen 93ce3e14bc Bluetooth: Audio: Shell: Fix Scan delegator subgroup count
The number of subgroups the scan delegator supports should
match the number of subgroups the broadcast sink supports.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-14 13:34:26 +00:00
Mariusz Skamra c09c4181cf Bluetooth: audio: tbs_client: Minor Kconfig refactor
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>
2023-07-18 11:06:57 +00:00
Emil Gydesen 49a70aa1bb Bluetooth: TMAP: Add TMAP shell module
Add simple TMAP shell module that supports the TMAP
discovery.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-06-30 16:10:51 +02:00
Emil Gydesen 69f7fd9cb2 Bluetooth: Audio: Rename bt_codec to bt_audio_codec_{cap, conf, data}
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>
2023-06-30 12:39:50 +02:00
Emil Gydesen adabb00914 Bluetooth: Audio: Shell: Update audio.conf to more sane values
Some values have been reduced and some have been increased to
better follow the audio configurations in BAP and support
more incoming data.

Also removes HRS as that is not used by LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-06-27 12:15:54 +00:00
Emil Gydesen b0d6437653 Bluetooth: Audio: Shell: Increase number of streams for unicast client
Increase CONFIG_BT_BAP_UNICAST_CLIENT_GROUP_STREAM_COUNT to match
CONFIG_BT_ISO_MAX_CHAN.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-06-10 05:16:59 -04:00
Théo Battrel f5ff886260 Bluetooth: Tests: Remove usage of BT_DEBUG_LOG
Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from tests. 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>
2023-06-07 13:56:55 -04:00
Fredrik Danebjer 7457bcf0a2 Bluetooth: Audio: Make HAS optional notify characteristics optional
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>
2023-05-26 09:09:06 -04:00
Emil Gydesen e8ade2356a Bluetooth: BAP: Add unicast client and server write long support
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>
2023-05-26 05:55:15 -04:00
Emil Gydesen 5109c941f2 Bluetooth: Audio: Add TBS client TX buffer count requirement
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>
2023-05-26 05:54:58 -04:00
Emil Gydesen 5c3241ca5b Bluetooth: MCS: Remove requirement for TX_BUF_COUNT
A recent change in MCS significantly reduced the requirement
of L2CAP_TX_BUF_COUNT and should now work with any value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-26 05:54:58 -04:00
Fredrik Danebjer f3fdb1f96f Bluetooth: Audio: Make VCS optional notify characteristics optional
This change makes VCS Volume Flag characteristic Notify property
optional and selectable through Kconfig.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-05-17 19:26:54 +02:00
Emil Gydesen 2678ab55b6 Bluetooth: Audio: Shell: Enable CSIP Set Member debug log
Enable the CSIP Set Member debug log.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-10 10:14:56 +02:00
Emil Gydesen e2765d7bd5 Bluetooth: Audio: Rename bt_audio_iso to bt_bap_iso
Rename the internal bt_audio_iso struct and API to bt_bap_iso

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-07 16:21:44 +01:00
Emil Gydesen 77853f43f2 Bluetooth: Audio: Rename bt_audio_stream to bt_bap_stream
Rename the bt_audio_stream API to bt_bap_stream
and move the API to bap.h

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-07 16:21:44 +01:00
Emil Gydesen e0fc612c93 Bluetooth: Audio: Rename bt_audio_unicast_client to bt_bap_...
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>
2023-03-07 16:21:44 +01:00
Emil Gydesen be42429f90 Bluetooth: Audio: Rename bt_audio_broadcast_source to bt_bap_...
Rename the bt_audio_broadcast_source API to bt_bap_broadcast_source
and move the API to bap.h

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-07 16:21:44 +01:00
Emil Gydesen 06d00ff5f9 Bluetooth: Audio: Rename bt_audio_broadcast_sink to bt_bap_...
Rename the bt_audio_broadcast_sink API to bt_bap_broadcast_sink
and move the API to bap.h

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-03-07 16:21:44 +01:00
Emil Gydesen eeae1f096a Bluetooth: Audio: Rename bt_audio_unicast_server to bt_bap_...
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>
2023-03-07 16:21:44 +01:00
Emil Gydesen e75fc5e318 Bluetooth: Audio: Remove pac_cache from unicast_client
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>
2023-03-07 09:44:10 +01:00
Emil Gydesen a9071b361f Bluetooth: Audio: Add missing codec debug Kconfig
Add misisng codec debug Kconfig for the codec.c file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-09 15:27:28 +00:00
Emil Gydesen b9a6e04cb3 Bluetooth: Audio: Add AUDIO_ISO debug logging
Add a logging module for the audio_iso.c file, to enable
logging for that.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-04 10:35:14 +01:00
Lars Knudsen 081b83531b Bluetooth: has: Make HAS registration dynamic
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>
2022-12-20 17:04:45 +00:00
Emil Gydesen 0114bc8199 Bluetooth: Audio: Shell: Add TBS Client debug logging in audio.conf
Add TBS client debug logging like all the other modules.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen 18fe973df2 Bluetooth: Audio: Shell: Enable optional TBS features
Enable the optional TBS features to provide a full TBS experience.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen 24d22ebbdb Bluetooth: Audio: Shell: Add support for more connections
Add support for 3 connections. Mainly we need to support
at least 2 connection to use the CSIP Set Coordinator role,
but some sets may also be 3 or even larger.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen cc9006f211 Bluetooth: Audio: Shell: Add EATT to audio.conf
Add EATT support for audio.conf as that is quite useful
for LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen 7f69b866f0 Bluetooth: Audio: Specify bt_vcp_vol_rend API
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>
2022-11-28 17:43:40 +01:00
Emil Gydesen 71bd487cc4 Bluetooth: Audio: Add separate API for VCP vol controller
Add a separate API for the VCP volume controller (client).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen ce2b8f9fe1 Bluetooth: Audio: Rename VCS to VCP
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>
2022-11-28 17:43:40 +01:00
Théo Battrel e458f5aae6 Bluetooth: Use Zephyr standard log system instead of bluetooth/common/log
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>
2022-11-25 17:08:36 +01:00
Emil Gydesen 87f86cebe2 Bluetooth: Audio: Rename bt_csip to bt_csip_set_member
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>
2022-11-24 15:23:48 +01:00
Emil Gydesen 93b3944a51 Bluetooth: Audio: Rename CSIS to CSIP
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>
2022-11-24 15:23:48 +01:00
Emil Gydesen ecb7591d6b Bluetooth: Audio: Rename BASS and BASS client
Rename BASS to BAP Scan Delegator and BASS Client
to BAP Broadcast Assistant. This is the first step towards
integrating the BASS with the rest of BAP.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-16 11:17:52 +01:00
Emil Gydesen 2fd9c82658 Bluetooth: Audio: Increase some values for the audio shell
Increase some value for the shell to be more useful when
working with some audio devices.

Also adds debugging for more services and profiles.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-31 16:43:41 +09:00
Emil Gydesen 760177b1be Bluetooth: Audio: Add CAP initiator skeleton
Add skeleton for the expected APIs and
implementation. May be subject to change as
implementation progresses.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-24 10:39:11 +02:00