Merge branch 'bugfix/fix_hid_congestion_v5.1' into 'release/v5.1'

Fix(bt/bluedroid): Fix the issue for HID congestion checking[backport 5.1]

See merge request espressif/esp-idf!26230
This commit is contained in:
Wang Meng Yang
2023-09-27 16:24:56 +08:00
2 changed files with 2 additions and 2 deletions

View File

@@ -776,7 +776,7 @@ tHID_STATUS hidd_conn_send_data(uint8_t channel, uint8_t msg_type, uint8_t param
}
#endif
HIDD_TRACE_VERBOSE("%s: report sent", __func__);
if (p_hcon->conn_flags & HID_CONN_FLAGS_CONGESTED || !L2CA_DataWrite(cid, p_buf))
if (L2CA_DataWrite(cid, p_buf) == L2CAP_DW_FAILED)
return (HID_ERR_CONGESTED);
return (HID_SUCCESS);
}

View File

@@ -928,7 +928,7 @@ tHID_STATUS hidh_conn_snd_data (UINT8 dhandle, UINT8 trans_type, UINT8 param,
data_size -= bytes_copied;
/* Send the buffer through L2CAP */
if ((p_hcon->conn_flags & HID_CONN_FLAGS_CONGESTED) || (!L2CA_DataWrite (cid, p_buf))) {
if (L2CA_DataWrite(cid, p_buf) == L2CAP_DW_FAILED) {
return (HID_ERR_CONGESTED);
}