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:
Johan Hedberg 2015-04-18 18:37:03 +03:00 committed by Anas Nashif
commit 3739760dc2
2 changed files with 21 additions and 0 deletions

View file

@ -185,4 +185,9 @@ struct bt_hci_evt_num_completed_packets {
} h[0] PACK_STRUCT; } h[0] PACK_STRUCT;
} 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 */ #endif /* __BT_HCI_H */

View file

@ -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) static void hci_event(struct bt_buf *buf)
{ {
struct bt_hci_evt_hdr *hdr = (void *)buf->data; 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: case BT_HCI_EVT_NUM_COMPLETED_PACKETS:
hci_num_completed_packets(buf); hci_num_completed_packets(buf);
break; break;
case BT_HCI_EVT_LE_META_EVENT:
hci_le_meta_event(buf);
break;
default: default:
BT_ERR("Unknown event %u\n", hdr->evt); BT_ERR("Unknown event %u\n", hdr->evt);
break; break;