Loading system/stack/l2cap/l2c_api.cc +6 −0 Original line number Diff line number Diff line Loading @@ -780,6 +780,12 @@ std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm, L2CAP_TRACE_DEBUG("%s LE Link is up", __func__); /* Check if there is no ongoing connection request */ if (p_lcb->pending_ecoc_conn_cnt > 0) { LOG_WARN("There is ongoing connection request, PSM: 0x%04x", psm); return allocated_cids; } tL2C_CCB* p_ccb_primary; /* Make sure user set proper value for number of cids */ Loading system/stack/l2cap/l2c_ble.cc +11 −6 Original line number Diff line number Diff line Loading @@ -748,8 +748,17 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) { con_info.peer_mtu = mtu; for (int i = 0; i < p_lcb->pending_ecoc_conn_cnt; i++) { uint16_t cid = p_lcb->pending_ecoc_connection_cids[i]; /* Copy request data and clear it so user can perform another connect if * needed in the callback. */ p_lcb->pending_ecoc_conn_cnt = 0; uint16_t cids[L2CAP_CREDIT_BASED_MAX_CIDS]; std::copy_n(p_lcb->pending_ecoc_connection_cids, L2CAP_CREDIT_BASED_MAX_CIDS, cids); std::fill_n(p_lcb->pending_ecoc_connection_cids, L2CAP_CREDIT_BASED_MAX_CIDS, 0); for (int i = 0; i < num_of_channels; i++) { uint16_t cid = cids[i]; STREAM_TO_UINT16(rcid, p); if (rcid != 0) { Loading Loading @@ -804,10 +813,6 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) { } } p_lcb->pending_ecoc_conn_cnt = 0; memset(p_lcb->pending_ecoc_connection_cids, 0, L2CAP_CREDIT_BASED_MAX_CIDS); break; case L2CAP_CMD_CREDIT_BASED_RECONFIG_REQ: { if (p + 6 > p_pkt_end) { Loading Loading
system/stack/l2cap/l2c_api.cc +6 −0 Original line number Diff line number Diff line Loading @@ -780,6 +780,12 @@ std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm, L2CAP_TRACE_DEBUG("%s LE Link is up", __func__); /* Check if there is no ongoing connection request */ if (p_lcb->pending_ecoc_conn_cnt > 0) { LOG_WARN("There is ongoing connection request, PSM: 0x%04x", psm); return allocated_cids; } tL2C_CCB* p_ccb_primary; /* Make sure user set proper value for number of cids */ Loading
system/stack/l2cap/l2c_ble.cc +11 −6 Original line number Diff line number Diff line Loading @@ -748,8 +748,17 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) { con_info.peer_mtu = mtu; for (int i = 0; i < p_lcb->pending_ecoc_conn_cnt; i++) { uint16_t cid = p_lcb->pending_ecoc_connection_cids[i]; /* Copy request data and clear it so user can perform another connect if * needed in the callback. */ p_lcb->pending_ecoc_conn_cnt = 0; uint16_t cids[L2CAP_CREDIT_BASED_MAX_CIDS]; std::copy_n(p_lcb->pending_ecoc_connection_cids, L2CAP_CREDIT_BASED_MAX_CIDS, cids); std::fill_n(p_lcb->pending_ecoc_connection_cids, L2CAP_CREDIT_BASED_MAX_CIDS, 0); for (int i = 0; i < num_of_channels; i++) { uint16_t cid = cids[i]; STREAM_TO_UINT16(rcid, p); if (rcid != 0) { Loading Loading @@ -804,10 +813,6 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) { } } p_lcb->pending_ecoc_conn_cnt = 0; memset(p_lcb->pending_ecoc_connection_cids, 0, L2CAP_CREDIT_BASED_MAX_CIDS); break; case L2CAP_CMD_CREDIT_BASED_RECONFIG_REQ: { if (p + 6 > p_pkt_end) { Loading