diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-12-14 21:05:10 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-12-14 21:05:10 +0100 |
commit | 5fea34a7e045949e48d22651cf1c4f836fbbc7bd (patch) | |
tree | 13331147c8a071873b2dc60387f3d2a584aabbd6 /emulator | |
parent | 6ca36f7fa5a2a8346507ebb5e8ea55416ad98644 (diff) | |
download | bluez-5fea34a7e045949e48d22651cf1c4f836fbbc7bd.tar.gz |
emulator: Add skeleton for HCI Disconnect command support
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/le.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/emulator/le.c b/emulator/le.c index 5acb9a417..69a96deef 100644 --- a/emulator/le.c +++ b/emulator/le.c @@ -156,7 +156,7 @@ static void reset_defaults(struct bt_le *hci) hci->manufacturer = 0x003f; /* Bluetooth SIG (63) */ memset(hci->commands, 0, sizeof(hci->commands)); - //hci->commands[0] |= 0x20; /* Disconnect */ + hci->commands[0] |= 0x20; /* Disconnect */ //hci->commands[2] |= 0x80; /* Read Remote Version Information */ hci->commands[5] |= 0x40; /* Set Event Mask */ hci->commands[5] |= 0x80; /* Reset */ @@ -474,6 +474,11 @@ static void le_meta_event(struct bt_le *hci, uint8_t event, send_event(hci, BT_HCI_EVT_LE_META_EVENT, pkt_data, 1 + len); } +static void cmd_disconnect(struct bt_le *hci, const void *data, uint8_t size) +{ + cmd_status(hci, BT_HCI_ERR_UNKNOWN_CONN_ID, BT_HCI_CMD_DISCONNECT); +} + static void cmd_set_event_mask(struct bt_le *hci, const void *data, uint8_t size) { @@ -1434,6 +1439,8 @@ static const struct { uint8_t size; bool fixed; } cmd_table[] = { + { BT_HCI_CMD_DISCONNECT, cmd_disconnect, 3, true }, + { BT_HCI_CMD_SET_EVENT_MASK, cmd_set_event_mask, 8, true }, { BT_HCI_CMD_RESET, cmd_reset, 0, true }, { BT_HCI_CMD_SET_EVENT_MASK_PAGE2, cmd_set_event_mask_page2, 8, true }, |