Loading system/stack/gatt/gatt_api.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1170,7 +1170,7 @@ void GATT_Deregister(tGATT_IF gatt_if) { for (auto clcb_it = gatt_cb.clcb_queue.begin(); clcb_it != gatt_cb.clcb_queue.end();) { if (clcb_it->in_use && (clcb_it->p_reg->gatt_if == gatt_if) && if ((clcb_it->p_reg->gatt_if == gatt_if) && (clcb_it->p_tcb->tcb_idx == p_tcb->tcb_idx)) { alarm_cancel(clcb_it->gatt_rsp_timer_ent); gatt_clcb_invalidate(p_tcb, &(*clcb_it)); Loading system/stack/gatt/gatt_cl.cc +10 −9 Original line number Diff line number Diff line Loading @@ -1132,9 +1132,10 @@ uint8_t gatt_cmd_to_rsp_code(uint8_t cmd_code) { bool gatt_cl_send_next_cmd_inq(tGATT_TCB& tcb) { std::deque<tGATT_CMD_Q>* cl_cmd_q = nullptr; while (!tcb.cl_cmd_q.empty() || while ( gatt_is_outstanding_msg_in_att_send_queue(tcb) || EattExtension::GetInstance()->IsOutstandingMsgInSendQueue(tcb.peer_bda)) { if (!tcb.cl_cmd_q.empty()) { if (gatt_is_outstanding_msg_in_att_send_queue(tcb)) { cl_cmd_q = &tcb.cl_cmd_q; } else { EattChannel* channel = Loading Loading @@ -1204,6 +1205,12 @@ void gatt_client_handle_server_rsp(tGATT_TCB& tcb, uint16_t cid, uint8_t cmd_code = 0; tGATT_CLCB* p_clcb = gatt_cmd_dequeue(tcb, cid, &cmd_code); if (!p_clcb) { LOG_WARN("ATT - clcb already not in use, ignoring response"); gatt_cl_send_next_cmd_inq(tcb); return; } uint8_t rsp_code = gatt_cmd_to_rsp_code(cmd_code); if (!p_clcb) { LOG_WARN("ATT - clcb already not in use, ignoring response"); Loading @@ -1218,12 +1225,6 @@ void gatt_client_handle_server_rsp(tGATT_TCB& tcb, uint16_t cid, return; } if (!p_clcb->in_use) { LOG(WARNING) << "ATT - clcb already not in use, ignoring response"; gatt_cl_send_next_cmd_inq(tcb); return; } gatt_stop_rsp_timer(p_clcb); p_clcb->retry_count = 0; Loading system/stack/gatt/gatt_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -370,7 +370,6 @@ struct tGATT_CLCB { tGATT_STATUS status; /* operation status */ bool first_read_blob_after_read; tGATT_READ_INC_UUID128 read_uuid128; bool in_use; alarm_t* gatt_rsp_timer_ent; /* peer response timer */ uint8_t retry_count; uint16_t read_req_current_mtu; /* This is the MTU value that the read was Loading Loading @@ -646,6 +645,7 @@ extern void gatt_client_handle_server_rsp(tGATT_TCB& tcb, uint16_t cid, uint8_t* p_data); extern void gatt_send_queue_write_cancel(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, tGATT_EXEC_FLAG flag); extern bool gatt_is_outstanding_msg_in_att_send_queue(const tGATT_TCB& tcb); /* gatt_auth.cc */ extern bool gatt_security_check_start(tGATT_CLCB* p_clcb); Loading system/stack/gatt/gatt_utils.cc +14 −3 Original line number Diff line number Diff line Loading @@ -983,7 +983,6 @@ tGATT_CLCB* gatt_clcb_alloc(uint16_t conn_id) { tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); tGATT_REG* p_reg = gatt_get_regcb(gatt_if); clcb.in_use = true; clcb.conn_id = conn_id; clcb.p_reg = p_reg; clcb.p_tcb = p_tcb; Loading Loading @@ -1137,7 +1136,7 @@ uint16_t gatt_tcb_get_payload_size_rx(tGATT_TCB& tcb, uint16_t cid) { * ******************************************************************************/ void gatt_clcb_dealloc(tGATT_CLCB* p_clcb) { if (p_clcb && p_clcb->in_use) { if (p_clcb) { alarm_free(p_clcb->gatt_rsp_timer_ent); for (auto clcb_it = gatt_cb.clcb_queue.begin(); clcb_it != gatt_cb.clcb_queue.end(); clcb_it++) { Loading Loading @@ -1232,7 +1231,7 @@ uint8_t gatt_num_clcb_by_bd_addr(const RawAddress& bda) { uint8_t num = 0; for (auto const& clcb : gatt_cb.clcb_queue) { if (clcb.in_use && clcb.p_tcb->peer_bda == bda) num++; if (clcb.p_tcb->peer_bda == bda) num++; } return num; } Loading Loading @@ -1525,6 +1524,18 @@ tGATT_STATUS gatt_send_write_msg(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, return attp_send_cl_msg(tcb, p_clcb, op_code, &msg); } /******************************************************************************* * * Function gatt_is_outstanding_msg_in_att_send_queue * * Description checks if there is message on the ATT fixed channel to send * * Returns true: on success; false otherwise * ******************************************************************************/ bool gatt_is_outstanding_msg_in_att_send_queue(const tGATT_TCB& tcb) { return (!tcb.cl_cmd_q.empty() && (tcb.cl_cmd_q.front()).to_send); } /******************************************************************************* * * Function gatt_end_operation Loading Loading
system/stack/gatt/gatt_api.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1170,7 +1170,7 @@ void GATT_Deregister(tGATT_IF gatt_if) { for (auto clcb_it = gatt_cb.clcb_queue.begin(); clcb_it != gatt_cb.clcb_queue.end();) { if (clcb_it->in_use && (clcb_it->p_reg->gatt_if == gatt_if) && if ((clcb_it->p_reg->gatt_if == gatt_if) && (clcb_it->p_tcb->tcb_idx == p_tcb->tcb_idx)) { alarm_cancel(clcb_it->gatt_rsp_timer_ent); gatt_clcb_invalidate(p_tcb, &(*clcb_it)); Loading
system/stack/gatt/gatt_cl.cc +10 −9 Original line number Diff line number Diff line Loading @@ -1132,9 +1132,10 @@ uint8_t gatt_cmd_to_rsp_code(uint8_t cmd_code) { bool gatt_cl_send_next_cmd_inq(tGATT_TCB& tcb) { std::deque<tGATT_CMD_Q>* cl_cmd_q = nullptr; while (!tcb.cl_cmd_q.empty() || while ( gatt_is_outstanding_msg_in_att_send_queue(tcb) || EattExtension::GetInstance()->IsOutstandingMsgInSendQueue(tcb.peer_bda)) { if (!tcb.cl_cmd_q.empty()) { if (gatt_is_outstanding_msg_in_att_send_queue(tcb)) { cl_cmd_q = &tcb.cl_cmd_q; } else { EattChannel* channel = Loading Loading @@ -1204,6 +1205,12 @@ void gatt_client_handle_server_rsp(tGATT_TCB& tcb, uint16_t cid, uint8_t cmd_code = 0; tGATT_CLCB* p_clcb = gatt_cmd_dequeue(tcb, cid, &cmd_code); if (!p_clcb) { LOG_WARN("ATT - clcb already not in use, ignoring response"); gatt_cl_send_next_cmd_inq(tcb); return; } uint8_t rsp_code = gatt_cmd_to_rsp_code(cmd_code); if (!p_clcb) { LOG_WARN("ATT - clcb already not in use, ignoring response"); Loading @@ -1218,12 +1225,6 @@ void gatt_client_handle_server_rsp(tGATT_TCB& tcb, uint16_t cid, return; } if (!p_clcb->in_use) { LOG(WARNING) << "ATT - clcb already not in use, ignoring response"; gatt_cl_send_next_cmd_inq(tcb); return; } gatt_stop_rsp_timer(p_clcb); p_clcb->retry_count = 0; Loading
system/stack/gatt/gatt_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -370,7 +370,6 @@ struct tGATT_CLCB { tGATT_STATUS status; /* operation status */ bool first_read_blob_after_read; tGATT_READ_INC_UUID128 read_uuid128; bool in_use; alarm_t* gatt_rsp_timer_ent; /* peer response timer */ uint8_t retry_count; uint16_t read_req_current_mtu; /* This is the MTU value that the read was Loading Loading @@ -646,6 +645,7 @@ extern void gatt_client_handle_server_rsp(tGATT_TCB& tcb, uint16_t cid, uint8_t* p_data); extern void gatt_send_queue_write_cancel(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, tGATT_EXEC_FLAG flag); extern bool gatt_is_outstanding_msg_in_att_send_queue(const tGATT_TCB& tcb); /* gatt_auth.cc */ extern bool gatt_security_check_start(tGATT_CLCB* p_clcb); Loading
system/stack/gatt/gatt_utils.cc +14 −3 Original line number Diff line number Diff line Loading @@ -983,7 +983,6 @@ tGATT_CLCB* gatt_clcb_alloc(uint16_t conn_id) { tGATT_TCB* p_tcb = gatt_get_tcb_by_idx(tcb_idx); tGATT_REG* p_reg = gatt_get_regcb(gatt_if); clcb.in_use = true; clcb.conn_id = conn_id; clcb.p_reg = p_reg; clcb.p_tcb = p_tcb; Loading Loading @@ -1137,7 +1136,7 @@ uint16_t gatt_tcb_get_payload_size_rx(tGATT_TCB& tcb, uint16_t cid) { * ******************************************************************************/ void gatt_clcb_dealloc(tGATT_CLCB* p_clcb) { if (p_clcb && p_clcb->in_use) { if (p_clcb) { alarm_free(p_clcb->gatt_rsp_timer_ent); for (auto clcb_it = gatt_cb.clcb_queue.begin(); clcb_it != gatt_cb.clcb_queue.end(); clcb_it++) { Loading Loading @@ -1232,7 +1231,7 @@ uint8_t gatt_num_clcb_by_bd_addr(const RawAddress& bda) { uint8_t num = 0; for (auto const& clcb : gatt_cb.clcb_queue) { if (clcb.in_use && clcb.p_tcb->peer_bda == bda) num++; if (clcb.p_tcb->peer_bda == bda) num++; } return num; } Loading Loading @@ -1525,6 +1524,18 @@ tGATT_STATUS gatt_send_write_msg(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, return attp_send_cl_msg(tcb, p_clcb, op_code, &msg); } /******************************************************************************* * * Function gatt_is_outstanding_msg_in_att_send_queue * * Description checks if there is message on the ATT fixed channel to send * * Returns true: on success; false otherwise * ******************************************************************************/ bool gatt_is_outstanding_msg_in_att_send_queue(const tGATT_TCB& tcb) { return (!tcb.cl_cmd_q.empty() && (tcb.cl_cmd_q.front()).to_send); } /******************************************************************************* * * Function gatt_end_operation Loading