fix(ble/bluedroid): Fixed GATT response timeout setting

This commit is contained in:
chenjianhua
2025-10-27 17:31:40 +08:00
committed by BOT
parent 30ead92285
commit 645c71b3c0
2 changed files with 7 additions and 9 deletions

View File

@@ -1296,14 +1296,9 @@ BOOLEAN gatt_parse_uuid_from_cmd(tBT_UUID *p_uuid_rec, UINT16 uuid_size, UINT8 *
void gatt_start_rsp_timer(UINT16 clcb_idx)
{
tGATT_CLCB *p_clcb = gatt_clcb_find_by_idx(clcb_idx);
UINT32 timeout = GATT_WAIT_FOR_RSP_TOUT;
p_clcb->rsp_timer_ent.param = (TIMER_PARAM_TYPE)p_clcb;
if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY &&
p_clcb->op_subtype == GATT_DISC_SRVC_ALL) {
timeout = GATT_WAIT_FOR_DISC_RSP_TOUT;
}
btu_start_timer (&p_clcb->rsp_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_RSP,
timeout);
GATT_WAIT_FOR_RSP_TOUT);
}
/*******************************************************************************
**

View File

@@ -76,9 +76,12 @@ typedef UINT8 tGATT_SEC_ACTION;
#define GATT_HDR_SIZE 3 /* 1B opcode + 2B handle */
/* wait for ATT cmd response timeout value */
#define GATT_WAIT_FOR_RSP_TOUT 30
#define GATT_WAIT_FOR_DISC_RSP_TOUT 15
/**
* Wait for ATT cmd response timeout value (40 seconds).
* The max connection supervision timeout is 32 seconds,
* And The ATT cmd may not be sent out by controller immediately.
*/
#define GATT_WAIT_FOR_RSP_TOUT 40
#define GATT_REQ_RETRY_LIMIT 2
#define GATT_WAIT_FOR_IND_ACK_TOUT 5