mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-12 04:57:55 +00:00
apps: bttester: fix attribute reporting in read by UUID
There is no need to call `gatt_buf_add` when `gatt_buf` if filled using pointer `chr` from `gatt_buf_reserve`. This caused sending malformed data to BTP reposnse event.
This commit is contained in:
committed by
Szymon Janc
parent
16d255a365
commit
a974bbc0a7
@@ -844,7 +844,8 @@ read_uuid_cb(uint16_t conn_handle,
|
||||
rp->data_length = gatt_buf.len;
|
||||
rp->value_length = attr_len;
|
||||
rp->status = 0;
|
||||
os_mbuf_append(buf, gatt_buf.buf + 1, gatt_buf.len - 1);
|
||||
os_mbuf_append(buf, gatt_buf.buf, gatt_buf.len);
|
||||
|
||||
tester_send_buf(BTP_SERVICE_ID_GATTC, opcode,
|
||||
CONTROLLER_INDEX, buf);
|
||||
read_destroy();
|
||||
@@ -855,12 +856,6 @@ read_uuid_cb(uint16_t conn_handle,
|
||||
attr_len = attr->om->om_len;
|
||||
}
|
||||
|
||||
if (gatt_buf_add(attr->om->om_data, attr->om->om_len) == NULL) {
|
||||
read_destroy();
|
||||
rc = BLE_HS_ENOMEM;
|
||||
goto free;
|
||||
}
|
||||
|
||||
chr = gatt_buf_reserve(sizeof(*chr) + attr->om->om_len);
|
||||
if (!chr) {
|
||||
read_destroy();
|
||||
|
||||
Reference in New Issue
Block a user