Bluetooth: Audio: Make PACS location optional
Make the PACS location characteristic optional, and also optionally writable. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
c130b16ef3
commit
a796927961
7 changed files with 163 additions and 82 deletions
|
@ -598,17 +598,23 @@ static int has_init(const struct device *dev)
|
|||
has.features |= BT_HAS_FEAT_WRITABLE_PRESETS_SUPP;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_HAS_HEARING_AID_BANDED)) {
|
||||
/* HAP_d1.0r00; 3.7 BAP Unicast Server role requirements
|
||||
* A Banded Hearing Aid in the HA role shall set the Front Left and the Front
|
||||
* Right bits to a value of 0b1 in the Sink Audio Locations characteristic value.
|
||||
*/
|
||||
bt_audio_capability_set_location(BT_AUDIO_SINK, BT_AUDIO_LOCATION_FRONT_LEFT |
|
||||
BT_AUDIO_LOCATION_FRONT_RIGHT);
|
||||
} else if (IS_ENABLED(CONFIG_BT_HAS_HEARING_AID_LEFT)) {
|
||||
bt_audio_capability_set_location(BT_AUDIO_SINK, BT_AUDIO_LOCATION_FRONT_LEFT);
|
||||
} else {
|
||||
bt_audio_capability_set_location(BT_AUDIO_SINK, BT_AUDIO_LOCATION_FRONT_RIGHT);
|
||||
if (IS_ENABLED(CONFIG_BT_PAC_SNK_LOC)) {
|
||||
if (IS_ENABLED(CONFIG_BT_HAS_HEARING_AID_BANDED)) {
|
||||
/* HAP_d1.0r00; 3.7 BAP Unicast Server role requirements
|
||||
* A Banded Hearing Aid in the HA role shall set the
|
||||
* Front Left and the Front Right bits to a value of 0b1
|
||||
* in the Sink Audio Locations characteristic value.
|
||||
*/
|
||||
bt_audio_capability_set_location(BT_AUDIO_SINK,
|
||||
(BT_AUDIO_LOCATION_FRONT_LEFT |
|
||||
BT_AUDIO_LOCATION_FRONT_RIGHT));
|
||||
} else if (IS_ENABLED(CONFIG_BT_HAS_HEARING_AID_LEFT)) {
|
||||
bt_audio_capability_set_location(BT_AUDIO_SINK,
|
||||
BT_AUDIO_LOCATION_FRONT_LEFT);
|
||||
} else {
|
||||
bt_audio_capability_set_location(BT_AUDIO_SINK,
|
||||
BT_AUDIO_LOCATION_FRONT_RIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue