Component /bt: write_API_to_write_char_get_wrong_status_when_server_response_NULL

This commit is contained in:
zhiweijian 2017-06-09 15:08:06 +08:00
parent e7db29b2a8
commit 352cc0c7fe
2 changed files with 6 additions and 0 deletions

View file

@ -554,6 +554,9 @@ void gatt_process_error_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op_code,
(opcode == GATT_REQ_PREPARE_WRITE) && (opcode == GATT_REQ_PREPARE_WRITE) &&
(p_attr) && (p_attr) &&
(handle == p_attr->handle) ) { (handle == p_attr->handle) ) {
if (reason == GATT_SUCCESS){
reason = GATT_ERROR;
}
p_clcb->status = reason; p_clcb->status = reason;
gatt_send_queue_write_cancel(p_tcb, p_clcb, GATT_PREP_WRITE_CANCEL); gatt_send_queue_write_cancel(p_tcb, p_clcb, GATT_PREP_WRITE_CANCEL);
} else if ((p_clcb->operation == GATTC_OPTYPE_READ) && } else if ((p_clcb->operation == GATTC_OPTYPE_READ) &&

View file

@ -309,6 +309,9 @@ tGATT_STATUS gatt_sr_process_app_rsp (tGATT_TCB *p_tcb, tGATT_IF gatt_if,
ret_code = attp_send_sr_msg (p_tcb, p_tcb->sr_cmd.p_rsp_msg); ret_code = attp_send_sr_msg (p_tcb, p_tcb->sr_cmd.p_rsp_msg);
p_tcb->sr_cmd.p_rsp_msg = NULL; p_tcb->sr_cmd.p_rsp_msg = NULL;
} else { } else {
if (p_tcb->sr_cmd.status == GATT_SUCCESS){
status = GATT_UNKNOWN_ERROR;
}
ret_code = gatt_send_error_rsp (p_tcb, status, op_code, p_tcb->sr_cmd.handle, FALSE); ret_code = gatt_send_error_rsp (p_tcb, status, op_code, p_tcb->sr_cmd.handle, FALSE);
} }