summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hci/src/hci_h4.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/hci/src/hci_h4.c b/hci/src/hci_h4.c
index ba15426..75e2014 100644
--- a/hci/src/hci_h4.c
+++ b/hci/src/hci_h4.c
@@ -103,6 +103,7 @@ static const uint16_t msg_evt_table[] =
#define HCI_COMMAND_COMPLETE_EVT 0x0E
#define HCI_COMMAND_STATUS_EVT 0x0F
+#define HCI_VENDOR_EVT 0xFF
#define HCI_READ_BUFFER_SIZE 0x1005
#define HCI_LE_READ_BUFFER_SIZE 0x2002
@@ -297,6 +298,35 @@ uint8_t internal_event_intercept(void)
}
}
}
+ else if (event_code == HCI_VENDOR_EVT)
+ {
+ num_hci_cmd_pkts = *p++;
+
+ if (p_cb->int_cmd_rsp_pending > 0)
+ {
+ HCIDBG( \
+ "Intercept CommandCompleteEvent for internal command (0x%04X)",\
+ p_cb->int_cmd[p_cb->int_cmd_rd_idx].opcode);
+ if (p_cb->int_cmd[p_cb->int_cmd_rd_idx].cback != NULL)
+ {
+ p_cb->int_cmd[p_cb->int_cmd_rd_idx].cback(p_cb->p_rcv_msg);
+ }
+ else
+ {
+ // Missing cback function!
+ // Release the p_rcv_msg buffer.
+ if (bt_hc_cbacks)
+ {
+ bt_hc_cbacks->dealloc((TRANSAC) p_cb->p_rcv_msg, \
+ (char *) (p_cb->p_rcv_msg + 1));
+ }
+ }
+ p_cb->int_cmd_rd_idx = ((p_cb->int_cmd_rd_idx+1) & \
+ INT_CMD_PKT_IDX_MASK);
+ p_cb->int_cmd_rsp_pending--;
+ return TRUE;
+ }
+ }
else if (event_code == HCI_COMMAND_STATUS_EVT)
{
num_hci_cmd_pkts = *(++p);