summaryrefslogtreecommitdiffstats
path: root/hci
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-06-24 00:33:36 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-06-24 00:33:49 +0200
commita8b43d894e09fa9cea02159fe054969885190ac1 (patch)
treef265b65f2600a286b7c82adc669e1a5549363977 /hci
parent20c13c655e0cdd25d21d562d1d44988107a20711 (diff)
downloadexternal_bluetooth_bluedroid-a8b43d894e09fa9cea02159fe054969885190ac1.zip
external_bluetooth_bluedroid-a8b43d894e09fa9cea02159fe054969885190ac1.tar.gz
external_bluetooth_bluedroid-a8b43d894e09fa9cea02159fe054969885190ac1.tar.bz2
H4 HCI: Properly report vendor-specific events as internal responsesHEADreplicant-4.2-0004replicant-4.2-0003replicant-4.2-0002replicant-4.2
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'hci')
-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);