Bluetooth: Add skeleton for handling disconnect complete events

This patch adds a simple event handler for the LE Disconnection
Complete HCI event. An extra thing the handler needs to do is to
re-enable advertising if necessary, since it will have been implicitly
disabled by the controller upon a connection event.

Change-Id: Ie6f2eecb8c1d7de16fea24c8fd1533545f41baa5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2015-04-18 18:52:54 +03:00 committed by Anas Nashif
commit 58c5689531
2 changed files with 29 additions and 0 deletions

View file

@ -163,6 +163,13 @@ struct bt_hci_cp_le_set_adv_enable {
/* Event definitions */
#define BT_HCI_EVT_DISCONN_COMPLETE 0x05
struct bt_hci_evt_disconn_complete {
uint8_t status;
uint16_t handle;
uint8_t reason;
} PACK_STRUCT;
#define BT_HCI_EVT_CMD_COMPLETE 0x0e
struct hci_evt_cmd_complete {
uint8_t ncmd;