Bluetooth: Audio: Shell: Fix off-by-one issue with the HAS uuid
If the advertising is connectable, and we have privacy, then according to the HAP spec, we should not advertise the HAS uuid. This was done by simply truncating the advertising data, but it was only truncated by 1, instead of by the size of the UUID. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
1e7d2c83aa
commit
f0b104346a
1 changed files with 2 additions and 2 deletions
|
@ -2144,7 +2144,7 @@ ssize_t audio_ad_data_add(struct bt_data *data_array, const size_t data_array_si
|
||||||
IF_ENABLED(CONFIG_BT_GTBS, (BT_UUID_16_ENCODE(BT_UUID_GTBS_VAL),))
|
IF_ENABLED(CONFIG_BT_GTBS, (BT_UUID_16_ENCODE(BT_UUID_GTBS_VAL),))
|
||||||
IF_ENABLED(CONFIG_BT_TBS, (BT_UUID_16_ENCODE(BT_UUID_TBS_VAL),))
|
IF_ENABLED(CONFIG_BT_TBS, (BT_UUID_16_ENCODE(BT_UUID_TBS_VAL),))
|
||||||
IF_ENABLED(CONFIG_BT_VCP_VOL_REND, (BT_UUID_16_ENCODE(BT_UUID_VCS_VAL),))
|
IF_ENABLED(CONFIG_BT_VCP_VOL_REND, (BT_UUID_16_ENCODE(BT_UUID_VCS_VAL),))
|
||||||
IF_ENABLED(CONFIG_BT_HAS, (BT_UUID_16_ENCODE(BT_UUID_HAS_VAL),))
|
IF_ENABLED(CONFIG_BT_HAS, (BT_UUID_16_ENCODE(BT_UUID_HAS_VAL),)) /* Shall be last */
|
||||||
};
|
};
|
||||||
size_t ad_len = 0;
|
size_t ad_len = 0;
|
||||||
|
|
||||||
|
@ -2202,7 +2202,7 @@ ssize_t audio_ad_data_add(struct bt_data *data_array, const size_t data_array_si
|
||||||
* Service UUID in the Service UUID AD type field of the advertising data
|
* Service UUID in the Service UUID AD type field of the advertising data
|
||||||
* or scan response.
|
* or scan response.
|
||||||
*/
|
*/
|
||||||
data_array[ad_len].data_len = ARRAY_SIZE(ad_ext_uuid16) - 1;
|
data_array[ad_len].data_len = ARRAY_SIZE(ad_ext_uuid16) - BT_UUID_SIZE_16;
|
||||||
} else {
|
} else {
|
||||||
data_array[ad_len].data_len = ARRAY_SIZE(ad_ext_uuid16);
|
data_array[ad_len].data_len = ARRAY_SIZE(ad_ext_uuid16);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue