Bluetooth: Fix bt_gatt_attr_read_chrc for UUID 128 bits

When reading a characteristic attribute which contain a 128 bits UUID the
size of the elements were counting only the UUID alone not other fields
that are part of the value causing invalid responses to be sent.

Change-Id: I7474531f586ba19788eb9e0ed59555c5d7672176
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2015-06-02 15:09:35 +03:00 committed by Anas Nashif
commit 51f85ed6ab

View file

@ -156,7 +156,7 @@ int bt_gatt_attr_read_chrc(const bt_addr_le_t *peer,
value_len += sizeof(pdu.uuid16);
} else {
memcpy(pdu.uuid, chrc->uuid->u128, sizeof(chrc->uuid->u128));
value_len = sizeof(chrc->uuid->u128);
value_len += sizeof(chrc->uuid->u128);
}
return bt_gatt_attr_read(peer, attr, buf, len, offset, &pdu, value_len);