Bluetooth: Host: Fix issue with setting 0/NULL data for PA

bt_le_per_adv_set_data would not accept the ad to be NULL or
the ad_len to be 0, making it impossible to set no data (which
effectively clears existing data).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-12-14 22:03:39 +01:00 committed by Carles Cufí
commit 366ddedeb6

View file

@ -1810,7 +1810,7 @@ int bt_le_per_adv_set_data(const struct bt_le_ext_adv *adv,
return -EINVAL;
}
if (!ad_len || !ad) {
if (ad_len != 0 && ad == NULL) {
return -EINVAL;
}