mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
component/bt: Check the value received from the peer device when sent the data used prepare write.
component/bt: Fix misspellings of "corret" in comments in bta_gattc_write_cmpl function.
This commit is contained in:
parent
0236592fe5
commit
8f015e3e48
@ -1278,6 +1278,11 @@ void bta_gattc_write_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data)
|
||||
|
||||
if (p_clcb->p_q_cmd->api_write.hdr.event == BTA_GATTC_API_WRITE_EVT &&
|
||||
p_clcb->p_q_cmd->api_write.write_type == BTA_GATTC_WRITE_PREPARE) {
|
||||
// Should check the value received from the peer device is correct or not.
|
||||
if (memcmp(p_clcb->p_q_cmd->api_write.p_value, p_data->p_cmpl->att_value.value,
|
||||
p_data->p_cmpl->att_value.len) != 0) {
|
||||
cb_data.write.status = BTA_GATT_INVALID_PDU;
|
||||
}
|
||||
|
||||
event = BTA_GATTC_PREP_WRITE_EVT;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user