pthread_mutex_unlock(&btsnoop_log_lock);
}
-void rtk_btsnoop_capture(const HC_BT_HDR *p_buf) {
+void rtk_btsnoop_capture(const HC_BT_HDR *p_buf, bool is_rcvd) {
const uint8_t *p = (const uint8_t *)(p_buf + 1) + p_buf->offset;
if (hci_btsnoop_fd == -1)
else
rtk_btsnoop_write_packet(HCI_EVENT_PKT, p, false);
break;
+ case MSG_HC_TO_STACK_HCI_ACL:
+ case MSG_STACK_TO_HC_HCI_ACL:
+ rtk_btsnoop_write_packet(HCI_ACLDATA_PKT, p, is_rcvd);
+ break;
+ case MSG_HC_TO_STACK_HCI_SCO:
+ case MSG_STACK_TO_HC_HCI_SCO:
+ rtk_btsnoop_write_packet(HCI_SCODATA_PKT, p, is_rcvd);
+ break;
case MSG_STACK_TO_HC_HCI_CMD:
if(((rtkbt_h5logfilter & 1) == 0) || (*p != 0x94) || (*(p + 1) != 0xfc))
rtk_btsnoop_write_packet(HCI_COMMAND_PKT, p, true);
unsigned char * p_data = recv_buffer;
int length = total_length;
HC_BT_HDR * p_buf;
- uint16_t len;
+ uint8_t boundary_flag;
+ uint16_t len, handle, acl_length, l2cap_length;
switch (coex_packet_recv_state) {
case RTKBT_PACKET_IDLE:
coex_packet_bytes_need = 1;
if(rtk_parse_manager)
rtk_parse_manager->rtk_parse_internal_event_intercept(coex_resvered_buffer);
break;
+
+ case DATA_TYPE_ACL:
+ p_buf->event = MSG_HC_TO_STACK_HCI_ACL;
+ handle = *(uint16_t *)coex_resvered_buffer;
+ acl_length = *(uint16_t *)&coex_resvered_buffer[2];
+ l2cap_length = *(uint16_t *)&coex_resvered_buffer[4];
+ boundary_flag = RTK_GET_BOUNDARY_FLAG(handle);
+ if(rtk_parse_manager)
+ rtk_parse_manager->rtk_parse_l2cap_data(coex_resvered_buffer, 0);
+ break;
+
+ case DATA_TYPE_SCO:
+ p_buf->event = MSG_HC_TO_STACK_HCI_SCO;
+ break;
+
default:
p_buf->event = MSG_HC_TO_STACK_HCI_ERR;
break;
}
- rtk_btsnoop_capture(p_buf);
+ rtk_btsnoop_capture(p_buf, true);
}
break;
type = send_buffer[0];
int length = total_length;
HC_BT_HDR * p_buf;
- uint16_t len;
+ uint8_t boundary_flag;
+ uint16_t len, handle, acl_length, l2cap_length;
len = BT_HC_HDR_SIZE + (length - 1);
uint8_t packet[len];
if(rtk_parse_manager)
rtk_parse_manager->rtk_parse_command(&send_buffer[1]);
break;
+
+ case DATA_TYPE_ACL:
+ p_buf->event = MSG_STACK_TO_HC_HCI_ACL;
+ handle = *(uint16_t *)&send_buffer[1];
+ acl_length = *(uint16_t *)&send_buffer[3];
+ l2cap_length = *(uint16_t *)&send_buffer[5];
+ boundary_flag = RTK_GET_BOUNDARY_FLAG(handle);
+ if(rtk_parse_manager)
+ rtk_parse_manager->rtk_parse_l2cap_data(&send_buffer[1], 1);
+
+ break;
+
+ case DATA_TYPE_SCO:
+ p_buf->event = MSG_STACK_TO_HC_HCI_SCO;
+ break;
default:
p_buf->event = 0;
ALOGE("%s invalid data type: %d", __func__, type);
break;
}
- rtk_btsnoop_capture(p_buf);
+ rtk_btsnoop_capture(p_buf, false);
}
static void userial_coex_handler(void *context)