/******************************************************************************/
/* L O C A L F U N C T I O N P R O T O T Y P E S */
/******************************************************************************/
-static void l2c_csm_closed(tL2C_CCB* p_ccb, uint16_t event, void* p_data);
-static void l2c_csm_orig_w4_sec_comp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_closed(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data);
+static void l2c_csm_orig_w4_sec_comp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data);
-static void l2c_csm_term_w4_sec_comp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_term_w4_sec_comp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data);
-static void l2c_csm_w4_l2cap_connect_rsp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_w4_l2cap_connect_rsp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data);
-static void l2c_csm_w4_l2ca_connect_rsp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_w4_l2ca_connect_rsp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data);
-static void l2c_csm_config(tL2C_CCB* p_ccb, uint16_t event, void* p_data);
-static void l2c_csm_open(tL2C_CCB* p_ccb, uint16_t event, void* p_data);
-static void l2c_csm_w4_l2cap_disconnect_rsp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_config(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data);
+static void l2c_csm_open(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data);
+static void l2c_csm_w4_l2cap_disconnect_rsp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data);
-static void l2c_csm_w4_l2ca_disconnect_rsp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_w4_l2ca_disconnect_rsp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data);
-static const char* l2c_csm_get_event_name(uint16_t event);
+static const char* l2c_csm_get_event_name(tL2CEVT event);
// Send a connect response with result OK and adjust the state machine
static void l2c_csm_send_connect_rsp(tL2C_CCB* p_ccb) {
* Returns void
*
******************************************************************************/
-void l2c_csm_execute(tL2C_CCB* p_ccb, uint16_t event, void* p_data) {
+void l2c_csm_execute(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) {
if (!l2cu_is_ccb_active(p_ccb)) {
LOG_WARN("CCB not in use, event (%d) cannot be processed", event);
return;
* Returns void
*
******************************************************************************/
-static void l2c_csm_closed(tL2C_CCB* p_ccb, uint16_t event, void* p_data) {
+static void l2c_csm_closed(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) {
tL2C_CONN_INFO* p_ci = (tL2C_CONN_INFO*)p_data;
uint16_t local_cid = p_ccb->local_cid;
tL2CA_DISCONNECT_IND_CB* disconnect_ind;
case L2CEVT_L2CA_DISCONNECT_REQ: /* Upper wants to disconnect */
l2cu_release_ccb(p_ccb);
break;
+
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns void
*
******************************************************************************/
-static void l2c_csm_orig_w4_sec_comp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_orig_w4_sec_comp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data) {
tL2CA_DISCONNECT_IND_CB* disconnect_ind =
p_ccb->p_rcb->api.pL2CA_DisconnectInd_Cb;
l2cu_release_ccb(p_ccb);
break;
+
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns void
*
******************************************************************************/
-static void l2c_csm_term_w4_sec_comp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_term_w4_sec_comp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data) {
LOG_DEBUG("LCID: 0x%04x st: TERM_W4_SEC_COMP evt: %s", p_ccb->local_cid,
l2c_csm_get_event_name(event));
btm_sec_l2cap_access_req(p_ccb->p_lcb->remote_bd_addr, p_ccb->p_rcb->psm,
false, &l2c_link_sec_comp, p_ccb);
break;
+
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns void
*
******************************************************************************/
-static void l2c_csm_w4_l2cap_connect_rsp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_w4_l2cap_connect_rsp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data) {
tL2C_CONN_INFO* p_ci = (tL2C_CONN_INFO*)p_data;
tL2CA_DISCONNECT_IND_CB* disconnect_ind =
l2cu_send_peer_connect_req(p_ccb); /* Start Connection */
}
break;
+
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns void
*
******************************************************************************/
-static void l2c_csm_w4_l2ca_connect_rsp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_w4_l2ca_connect_rsp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data) {
tL2C_CONN_INFO* p_ci;
tL2CA_DISCONNECT_IND_CB* disconnect_ind =
l2c_csm_send_connect_rsp(p_ccb);
l2c_csm_send_config_req(p_ccb);
break;
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns void
*
******************************************************************************/
-static void l2c_csm_config(tL2C_CCB* p_ccb, uint16_t event, void* p_data) {
+static void l2c_csm_config(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) {
tL2CAP_CFG_INFO* p_cfg = (tL2CAP_CFG_INFO*)p_data;
tL2CA_DISCONNECT_IND_CB* disconnect_ind =
p_ccb->p_rcb->api.pL2CA_DisconnectInd_Cb;
l2cu_release_ccb(p_ccb);
(*disconnect_ind)(local_cid, false);
break;
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns void
*
******************************************************************************/
-static void l2c_csm_open(tL2C_CCB* p_ccb, uint16_t event, void* p_data) {
+static void l2c_csm_open(tL2C_CCB* p_ccb, tL2CEVT event, void* p_data) {
uint16_t local_cid = p_ccb->local_cid;
tL2CAP_CFG_INFO* p_cfg;
tL2C_CHNL_STATE tempstate;
l2c_link_check_send_pkts(p_ccb->p_lcb, 0, NULL);
}
break;
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns void
*
******************************************************************************/
-static void l2c_csm_w4_l2cap_disconnect_rsp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_w4_l2cap_disconnect_rsp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data) {
LOG_DEBUG("LCID: 0x%04x st: W4_L2CAP_DISC_RSP evt: %s", p_ccb->local_cid,
l2c_csm_get_event_name(event));
case L2CEVT_L2CA_DATA_WRITE: /* Upper layer data to send */
osi_free(p_data);
break;
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns void
*
******************************************************************************/
-static void l2c_csm_w4_l2ca_disconnect_rsp(tL2C_CCB* p_ccb, uint16_t event,
+static void l2c_csm_w4_l2ca_disconnect_rsp(tL2C_CCB* p_ccb, tL2CEVT event,
void* p_data) {
tL2CA_DISCONNECT_IND_CB* disconnect_ind =
p_ccb->p_rcb->api.pL2CA_DisconnectInd_Cb;
case L2CEVT_L2CA_DATA_WRITE: /* Upper layer data to send */
osi_free(p_data);
break;
+ default:
+ LOG_ERROR("Handling unexpected event:%s", l2c_csm_get_event_name(event));
}
LOG_DEBUG("Exit chnl_state=%s [%d], event=%s [%d]",
channel_state_text(p_ccb->chnl_state).c_str(), p_ccb->chnl_state,
* Returns pointer to the name
*
******************************************************************************/
-static const char* l2c_csm_get_event_name(uint16_t event) {
+static const char* l2c_csm_get_event_name(tL2CEVT event) {
switch (event) {
case L2CEVT_LP_CONNECT_CFM: /* Lower layer connect confirm */
return ("LOWER_LAYER_CONNECT_CFM");