Fixes bug where the descriptor UUID16 was not set even thought it had one.

When deserializeing a characteristic_descriptor the UUID16 wouldn't be set even
thought it had an 16 bit UUID. This adds check to see if the descriptor has a
UUID16, if so, we read the UUID16 and set it to the gatt_client_characteristic_descriptor_t.
This commit is contained in:
Jakob Krantz 2017-12-14 15:35:41 +01:00 committed by Matthias Ringwald
parent cbe54ab248
commit b489552907

View File

@ -1880,4 +1880,7 @@ void gatt_client_deserialize_characteristic(const uint8_t * packet, int offset,
void gatt_client_deserialize_characteristic_descriptor(const uint8_t * packet, int offset, gatt_client_characteristic_descriptor_t * descriptor){
descriptor->handle = little_endian_read_16(packet, offset);
reverse_128(&packet[offset+2], descriptor->uuid128);
if (uuid_has_bluetooth_prefix(descriptor->uuid128)){
descriptor->uuid16 = big_endian_read_32(descriptor->uuid128, 0);
}
}