Skip to content

Commit ca088aa

Browse files
rugeGerritsencfriedt
authored andcommitted
Bluetooth: host: Warn on incomplete adv reports
When the controller forwards incomplete reports to the host, the application currently has no way of reassembling them. Therefore the application may fail to parse the data. Issue a warning until #37368 is resolved. Signed-off-by: Rubin Gerritsen <[email protected]>
1 parent d563313 commit ca088aa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

subsys/bluetooth/host/scan.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,15 @@ void bt_hci_le_adv_ext_report(struct net_buf *buf)
535535
/* Convert "Legacy" property to Extended property. */
536536
adv_info.adv_props = evt->evt_type ^ BT_HCI_LE_ADV_PROP_LEGACY;
537537

538+
if (BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS(evt->evt_type) ==
539+
BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_PARTIAL) {
540+
/* Handling of incomplete reports is currently not
541+
* handled in the host. The remaining advertising
542+
* reports may therefore contain partial data.
543+
*/
544+
BT_WARN("Incomplete adv report");
545+
}
546+
538547
le_adv_recv(&evt->addr, &adv_info, buf, evt->length);
539548

540549
net_buf_pull(buf, evt->length);
@@ -629,6 +638,14 @@ void bt_hci_le_per_adv_report(struct net_buf *buf)
629638
info.cte_type = BIT(evt->cte_type);
630639
info.addr = &per_adv_sync->addr;
631640

641+
if (evt->data_status == BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_PARTIAL) {
642+
/* Handling of incomplete reports is currently not
643+
* handled in the host. The remaining advertising
644+
* reports may therefore contain partial data.
645+
*/
646+
BT_WARN("Incomplete per adv report");
647+
}
648+
632649
SYS_SLIST_FOR_EACH_CONTAINER(&pa_sync_cbs, listener, node) {
633650
if (listener->recv) {
634651
net_buf_simple_save(&buf->b, &state);

0 commit comments

Comments
 (0)