Bluetooth: Add skeleton for handling LE meta event
All LE related HCI events come wrapped in a LE Meta 'super' event. This patch adds a basic event handler for it. Change-Id: I4a037d4af080c3ba0f982586065c0c49b6cf7640 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
f64e3c08b2
commit
3739760dc2
2 changed files with 21 additions and 0 deletions
|
@ -185,4 +185,9 @@ struct bt_hci_evt_num_completed_packets {
|
|||
} h[0] PACK_STRUCT;
|
||||
} PACK_STRUCT;
|
||||
|
||||
#define BT_HCI_EVT_LE_META_EVENT 0x3e
|
||||
struct bt_hci_evt_le_meta_event {
|
||||
uint8_t subevent;
|
||||
} PACK_STRUCT;
|
||||
|
||||
#endif /* __BT_HCI_H */
|
||||
|
|
|
@ -435,6 +435,19 @@ static void hci_num_completed_packets(struct bt_buf *buf)
|
|||
}
|
||||
}
|
||||
|
||||
static void hci_le_meta_event(struct bt_buf *buf)
|
||||
{
|
||||
struct bt_hci_evt_le_meta_event *evt = (void *)buf->data;
|
||||
|
||||
bt_buf_pull(buf, sizeof(*evt));
|
||||
|
||||
switch (evt->subevent) {
|
||||
default:
|
||||
BT_DBG("Unhandled LE event %x\n", evt->subevent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void hci_event(struct bt_buf *buf)
|
||||
{
|
||||
struct bt_hci_evt_hdr *hdr = (void *)buf->data;
|
||||
|
@ -453,6 +466,9 @@ static void hci_event(struct bt_buf *buf)
|
|||
case BT_HCI_EVT_NUM_COMPLETED_PACKETS:
|
||||
hci_num_completed_packets(buf);
|
||||
break;
|
||||
case BT_HCI_EVT_LE_META_EVENT:
|
||||
hci_le_meta_event(buf);
|
||||
break;
|
||||
default:
|
||||
BT_ERR("Unknown event %u\n", hdr->evt);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue