Loading system/stack/gatt/att_protocol.cc +3 −3 Original line number Diff line number Diff line Loading @@ -353,8 +353,8 @@ tGATT_STATUS attp_send_msg_to_l2cap(tGATT_TCB& tcb, uint16_t lcid, } /** Build ATT Server PDUs */ BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg) { BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg, uint16_t payload_size) { uint16_t offset = 0; switch (op_code) { Loading @@ -370,7 +370,7 @@ BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, case GATT_HANDLE_VALUE_NOTIF: case GATT_HANDLE_VALUE_IND: return attp_build_value_cmd( tcb.payload_size, op_code, p_msg->attr_value.handle, offset, payload_size, op_code, p_msg->attr_value.handle, offset, p_msg->attr_value.len, p_msg->attr_value.value); case GATT_RSP_WRITE: Loading system/stack/gatt/gatt_api.cc +7 −5 Original line number Diff line number Diff line Loading @@ -468,8 +468,10 @@ tGATT_STATUS GATTS_HandleValueIndication(uint16_t conn_id, uint16_t attr_handle, tGATT_SR_MSG gatt_sr_msg; gatt_sr_msg.attr_value = indication; BT_HDR* p_msg = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_IND, &gatt_sr_msg); uint16_t payload_size = gatt_tcb_get_payload_size_tx(*p_tcb, cid); BT_HDR* p_msg = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_IND, &gatt_sr_msg, payload_size); if (!p_msg) return GATT_NO_RESOURCES; tGATT_STATUS cmd_status = attp_send_sr_msg(*p_tcb, cid, p_msg); Loading Loading @@ -526,9 +528,9 @@ tGATT_STATUS GATTS_HandleValueNotification(uint16_t conn_id, gatt_sr_msg.attr_value = notif; uint16_t cid = gatt_tcb_get_att_cid(*p_tcb, p_reg->eatt_support); BT_HDR* p_buf = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_NOTIF, &gatt_sr_msg); uint16_t payload_size = gatt_tcb_get_payload_size_tx(*p_tcb, cid); BT_HDR* p_buf = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_NOTIF, &gatt_sr_msg, payload_size); if (p_buf != NULL) { cmd_sent = attp_send_sr_msg(*p_tcb, cid, p_buf); } else Loading system/stack/gatt/gatt_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -495,7 +495,7 @@ extern tGATT_STATUS attp_send_cl_confirmation_msg(tGATT_TCB& tcb, uint16_t cid); extern tGATT_STATUS attp_send_cl_msg(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, uint8_t op_code, tGATT_CL_MSG* p_msg); extern BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg); tGATT_SR_MSG* p_msg, uint16_t payload_size); extern tGATT_STATUS attp_send_sr_msg(tGATT_TCB& tcb, uint16_t cid, BT_HDR* p_msg); extern tGATT_STATUS attp_send_msg_to_l2cap(tGATT_TCB& tcb, uint16_t cid, Loading system/stack/gatt/gatt_sr.cc +5 −4 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ tGATT_STATUS gatt_sr_process_app_rsp(tGATT_TCB& tcb, tGATT_IF gatt_if, tGATTS_RSP* p_msg, tGATT_SR_CMD* sr_res_p) { tGATT_STATUS ret_code = GATT_SUCCESS; uint16_t payload_size = gatt_tcb_get_payload_size_rx(tcb, sr_res_p->cid); uint16_t payload_size = gatt_tcb_get_payload_size_tx(tcb, sr_res_p->cid); VLOG(1) << __func__ << " gatt_if=" << +gatt_if; Loading @@ -308,8 +308,8 @@ tGATT_STATUS gatt_sr_process_app_rsp(tGATT_TCB& tcb, tGATT_IF gatt_if, if (gatt_sr_is_cback_cnt_zero(tcb) && status == GATT_SUCCESS) { if (sr_res_p->p_rsp_msg == NULL) { sr_res_p->p_rsp_msg = attp_build_sr_msg(tcb, (uint8_t)(op_code + 1), (tGATT_SR_MSG*)p_msg); sr_res_p->p_rsp_msg = attp_build_sr_msg( tcb, (uint8_t)(op_code + 1), (tGATT_SR_MSG*)p_msg, payload_size); } else { LOG(ERROR) << "Exception!!! already has respond message"; } Loading Loading @@ -828,7 +828,8 @@ static void gatts_process_mtu_req(tGATT_TCB& tcb, uint16_t cid, uint16_t len, tGATT_SR_MSG gatt_sr_msg; gatt_sr_msg.mtu = tcb.payload_size; BT_HDR* p_buf = attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg); BT_HDR* p_buf = attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg, tcb.payload_size); attp_send_sr_msg(tcb, cid, p_buf); tGATTS_DATA gatts_data; Loading system/stack/gatt/gatt_utils.cc +2 −1 Original line number Diff line number Diff line Loading @@ -813,7 +813,8 @@ tGATT_STATUS gatt_send_error_rsp(tGATT_TCB& tcb, uint16_t cid, uint8_t err_code, msg.error.reason = err_code; msg.error.handle = handle; p_buf = attp_build_sr_msg(tcb, GATT_RSP_ERROR, &msg); uint16_t payload_size = gatt_tcb_get_payload_size_tx(tcb, cid); p_buf = attp_build_sr_msg(tcb, GATT_RSP_ERROR, &msg, payload_size); if (p_buf != NULL) { status = attp_send_sr_msg(tcb, cid, p_buf); } else Loading Loading
system/stack/gatt/att_protocol.cc +3 −3 Original line number Diff line number Diff line Loading @@ -353,8 +353,8 @@ tGATT_STATUS attp_send_msg_to_l2cap(tGATT_TCB& tcb, uint16_t lcid, } /** Build ATT Server PDUs */ BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg) { BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg, uint16_t payload_size) { uint16_t offset = 0; switch (op_code) { Loading @@ -370,7 +370,7 @@ BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, case GATT_HANDLE_VALUE_NOTIF: case GATT_HANDLE_VALUE_IND: return attp_build_value_cmd( tcb.payload_size, op_code, p_msg->attr_value.handle, offset, payload_size, op_code, p_msg->attr_value.handle, offset, p_msg->attr_value.len, p_msg->attr_value.value); case GATT_RSP_WRITE: Loading
system/stack/gatt/gatt_api.cc +7 −5 Original line number Diff line number Diff line Loading @@ -468,8 +468,10 @@ tGATT_STATUS GATTS_HandleValueIndication(uint16_t conn_id, uint16_t attr_handle, tGATT_SR_MSG gatt_sr_msg; gatt_sr_msg.attr_value = indication; BT_HDR* p_msg = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_IND, &gatt_sr_msg); uint16_t payload_size = gatt_tcb_get_payload_size_tx(*p_tcb, cid); BT_HDR* p_msg = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_IND, &gatt_sr_msg, payload_size); if (!p_msg) return GATT_NO_RESOURCES; tGATT_STATUS cmd_status = attp_send_sr_msg(*p_tcb, cid, p_msg); Loading Loading @@ -526,9 +528,9 @@ tGATT_STATUS GATTS_HandleValueNotification(uint16_t conn_id, gatt_sr_msg.attr_value = notif; uint16_t cid = gatt_tcb_get_att_cid(*p_tcb, p_reg->eatt_support); BT_HDR* p_buf = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_NOTIF, &gatt_sr_msg); uint16_t payload_size = gatt_tcb_get_payload_size_tx(*p_tcb, cid); BT_HDR* p_buf = attp_build_sr_msg(*p_tcb, GATT_HANDLE_VALUE_NOTIF, &gatt_sr_msg, payload_size); if (p_buf != NULL) { cmd_sent = attp_send_sr_msg(*p_tcb, cid, p_buf); } else Loading
system/stack/gatt/gatt_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -495,7 +495,7 @@ extern tGATT_STATUS attp_send_cl_confirmation_msg(tGATT_TCB& tcb, uint16_t cid); extern tGATT_STATUS attp_send_cl_msg(tGATT_TCB& tcb, tGATT_CLCB* p_clcb, uint8_t op_code, tGATT_CL_MSG* p_msg); extern BT_HDR* attp_build_sr_msg(tGATT_TCB& tcb, uint8_t op_code, tGATT_SR_MSG* p_msg); tGATT_SR_MSG* p_msg, uint16_t payload_size); extern tGATT_STATUS attp_send_sr_msg(tGATT_TCB& tcb, uint16_t cid, BT_HDR* p_msg); extern tGATT_STATUS attp_send_msg_to_l2cap(tGATT_TCB& tcb, uint16_t cid, Loading
system/stack/gatt/gatt_sr.cc +5 −4 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ tGATT_STATUS gatt_sr_process_app_rsp(tGATT_TCB& tcb, tGATT_IF gatt_if, tGATTS_RSP* p_msg, tGATT_SR_CMD* sr_res_p) { tGATT_STATUS ret_code = GATT_SUCCESS; uint16_t payload_size = gatt_tcb_get_payload_size_rx(tcb, sr_res_p->cid); uint16_t payload_size = gatt_tcb_get_payload_size_tx(tcb, sr_res_p->cid); VLOG(1) << __func__ << " gatt_if=" << +gatt_if; Loading @@ -308,8 +308,8 @@ tGATT_STATUS gatt_sr_process_app_rsp(tGATT_TCB& tcb, tGATT_IF gatt_if, if (gatt_sr_is_cback_cnt_zero(tcb) && status == GATT_SUCCESS) { if (sr_res_p->p_rsp_msg == NULL) { sr_res_p->p_rsp_msg = attp_build_sr_msg(tcb, (uint8_t)(op_code + 1), (tGATT_SR_MSG*)p_msg); sr_res_p->p_rsp_msg = attp_build_sr_msg( tcb, (uint8_t)(op_code + 1), (tGATT_SR_MSG*)p_msg, payload_size); } else { LOG(ERROR) << "Exception!!! already has respond message"; } Loading Loading @@ -828,7 +828,8 @@ static void gatts_process_mtu_req(tGATT_TCB& tcb, uint16_t cid, uint16_t len, tGATT_SR_MSG gatt_sr_msg; gatt_sr_msg.mtu = tcb.payload_size; BT_HDR* p_buf = attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg); BT_HDR* p_buf = attp_build_sr_msg(tcb, GATT_RSP_MTU, &gatt_sr_msg, tcb.payload_size); attp_send_sr_msg(tcb, cid, p_buf); tGATTS_DATA gatts_data; Loading
system/stack/gatt/gatt_utils.cc +2 −1 Original line number Diff line number Diff line Loading @@ -813,7 +813,8 @@ tGATT_STATUS gatt_send_error_rsp(tGATT_TCB& tcb, uint16_t cid, uint8_t err_code, msg.error.reason = err_code; msg.error.handle = handle; p_buf = attp_build_sr_msg(tcb, GATT_RSP_ERROR, &msg); uint16_t payload_size = gatt_tcb_get_payload_size_tx(tcb, cid); p_buf = attp_build_sr_msg(tcb, GATT_RSP_ERROR, &msg, payload_size); if (p_buf != NULL) { status = attp_send_sr_msg(tcb, cid, p_buf); } else Loading