&rvc, sizeof(rvc));
}
+static void le_send_adv_report(struct btdev *btdev, const struct btdev *remote)
+{
+ struct __packed {
+ uint8_t subevent;
+ union {
+ struct bt_hci_evt_le_adv_report lar;
+ uint8_t raw[10 + 31 + 1];
+ };
+ } meta_event;
+
+ meta_event.subevent = BT_HCI_EVT_LE_ADV_REPORT;
+
+ memset(&meta_event.lar, 0, sizeof(meta_event.lar));
+ meta_event.lar.num_reports = 1;
+ memcpy(meta_event.lar.addr, remote->bdaddr, 6);
+ meta_event.lar.data_len = remote->le_adv_data_len;
+ memcpy(meta_event.lar.data, remote->le_adv_data,
+ meta_event.lar.data_len);
+ /* Not available */
+ meta_event.raw[10 + meta_event.lar.data_len] = 127;
+ send_event(btdev, BT_HCI_EVT_LE_META_EVENT, &meta_event,
+ 1 + 10 + meta_event.lar.data_len + 1);
+}
+
+static void le_set_adv_enable_complete(struct btdev *btdev)
+{
+ int i;
+
+ for (i = 0; i < MAX_BTDEV_ENTRIES; i++) {
+ if (!btdev_list[i] || btdev_list[i] == btdev)
+ continue;
+
+ if (!btdev_list[i]->le_scan_enable)
+ continue;
+
+ le_send_adv_report(btdev_list[i], btdev);
+ }
+}
+
+static void le_set_scan_enable_complete(struct btdev *btdev)
+{
+ int i;
+
+ for (i = 0; i < MAX_BTDEV_ENTRIES; i++) {
+ if (!btdev_list[i] || btdev_list[i] == btdev)
+ continue;
+
+ if (!btdev_list[i]->le_adv_enable)
+ continue;
+
+ le_send_adv_report(btdev, btdev_list[i]);
+ }
+}
+
static void default_cmd(struct btdev *btdev, uint16_t opcode,
const void *data, uint8_t len)
{
status = BT_HCI_ERR_SUCCESS;
}
cmd_complete(btdev, opcode, &status, sizeof(status));
+ if (status == BT_HCI_ERR_SUCCESS && btdev->le_adv_enable)
+ le_set_adv_enable_complete(btdev);
break;
case BT_HCI_CMD_LE_SET_SCAN_PARAMETERS:
status = BT_HCI_ERR_SUCCESS;
}
cmd_complete(btdev, opcode, &status, sizeof(status));
+ if (status == BT_HCI_ERR_SUCCESS && btdev->le_scan_enable)
+ le_set_scan_enable_complete(btdev);
break;
case BT_HCI_CMD_LE_READ_WHITE_LIST_SIZE: