mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-06 07:00:59 +00:00
gatt_client: set uuid16 to zero when deserializing uuid128 services, characteristics, and descriptors
This commit is contained in:
parent
908a73e370
commit
c839c6f943
@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
### Fixed
|
||||
- L2CAP ERTM: avoid read-after-free on decline of incoming connection
|
||||
|
||||
- GATT Client: set uuid16 to zero when deserializing uuid128 services, characteristics, and descriptors
|
||||
|
||||
### Added
|
||||
- att_db_util: provide GATT Database Hash via att_db_util_hash_calc
|
||||
- GATT Compiler: provide GATT Database Hash via GATT_DATABASE_HASH Characteristic
|
||||
|
@ -2087,6 +2087,8 @@ void gatt_client_deserialize_service(const uint8_t *packet, int offset, gatt_cli
|
||||
reverse_128(&packet[offset + 4], service->uuid128);
|
||||
if (uuid_has_bluetooth_prefix(service->uuid128)){
|
||||
service->uuid16 = big_endian_read_32(service->uuid128, 0);
|
||||
} else {
|
||||
service->uuid16 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2098,6 +2100,8 @@ void gatt_client_deserialize_characteristic(const uint8_t * packet, int offset,
|
||||
reverse_128(&packet[offset+8], characteristic->uuid128);
|
||||
if (uuid_has_bluetooth_prefix(characteristic->uuid128)){
|
||||
characteristic->uuid16 = big_endian_read_32(characteristic->uuid128, 0);
|
||||
} else {
|
||||
characteristic->uuid16 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2106,6 +2110,8 @@ void gatt_client_deserialize_characteristic_descriptor(const uint8_t * packet, i
|
||||
reverse_128(&packet[offset+2], descriptor->uuid128);
|
||||
if (uuid_has_bluetooth_prefix(descriptor->uuid128)){
|
||||
descriptor->uuid16 = big_endian_read_32(descriptor->uuid128, 0);
|
||||
} else {
|
||||
descriptor->uuid16 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user