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:
Krzysztof Kopyściński
2023-06-15 00:41:32 +02:00
committed by Szymon Janc
parent 16d255a365
commit a974bbc0a7
+2 -7
View File
@@ -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();