mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
fix(bt/bluedroid): Fix BLE prepare write
This commit is contained in:
@@ -1241,15 +1241,18 @@ tGATT_STATUS gatts_write_attr_perm_check (tGATT_SVC_DB *p_db, UINT8 op_code,
|
|||||||
// btla-specific ++
|
// btla-specific ++
|
||||||
else if ( (p_attr->uuid_type == GATT_ATTR_UUID_TYPE_16) &&
|
else if ( (p_attr->uuid_type == GATT_ATTR_UUID_TYPE_16) &&
|
||||||
(p_attr->uuid == GATT_UUID_CHAR_CLIENT_CONFIG ||
|
(p_attr->uuid == GATT_UUID_CHAR_CLIENT_CONFIG ||
|
||||||
p_attr->uuid == GATT_UUID_CHAR_SRVR_CONFIG) )
|
p_attr->uuid == GATT_UUID_CHAR_SRVR_CONFIG ||
|
||||||
|
p_attr->uuid == GATT_UUID_CLIENT_SUP_FEAT ||
|
||||||
|
p_attr->uuid == GATT_UUID_GAP_ICON
|
||||||
|
) )
|
||||||
// btla-specific --
|
// btla-specific --
|
||||||
{
|
{
|
||||||
if (op_code == GATT_REQ_PREPARE_WRITE && offset != 0) { /* does not allow write blob */
|
if (op_code == GATT_REQ_PREPARE_WRITE) { /* does not allow write blob */
|
||||||
status = GATT_NOT_LONG;
|
status = GATT_REQ_NOT_SUPPORTED;
|
||||||
GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_NOT_LONG,handle:0x%04x",handle);
|
GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_REQ_NOT_SUPPORTED,handle:0x%04x",handle);
|
||||||
} else if (len != max_size) { /* data does not match the required format */
|
} else if (len != max_size) { /* data does not match the required format */
|
||||||
status = GATT_INVALID_ATTR_LEN;
|
status = GATT_INVALID_ATTR_LEN;
|
||||||
GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_INVALID_PDU,handle:0x%04x",handle);
|
GATT_TRACE_ERROR( "gatts_write_attr_perm_check - GATT_INVALID_ATTR_LEN,handle:0x%04x",handle);
|
||||||
} else {
|
} else {
|
||||||
status = GATT_SUCCESS;
|
status = GATT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -1448,8 +1448,9 @@ void gatt_attr_process_prepare_write (tGATT_TCB *p_tcb, UINT8 i_rcb, UINT16 hand
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((prepare_record->error_code_app == GATT_SUCCESS)
|
if ((prepare_record->error_code_app == GATT_SUCCESS)
|
||||||
&& ((status == GATT_INVALID_OFFSET) || (status == GATT_INVALID_ATTR_LEN))){
|
// update prepare write status for excute write request
|
||||||
prepare_record->error_code_app = status;
|
&& (status == GATT_INVALID_OFFSET || status == GATT_INVALID_ATTR_LEN || status == GATT_REQ_NOT_SUPPORTED)) {
|
||||||
|
prepare_record->error_code_app = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user