bluetooth: host: Fix endianness issue for group end_handle.
Convert end_handle to native endianness before comparison. Signed-off-by: Wolfgang Puffitsch <wopu@oticon.com>
This commit is contained in:
parent
8b6204b7ae
commit
aed74024b5
1 changed files with 4 additions and 2 deletions
|
@ -537,7 +537,8 @@ static u8_t find_type_cb(const struct bt_gatt_attr *attr, void *user_data)
|
|||
|
||||
/* Update group end_handle if not a primary service */
|
||||
if (bt_uuid_cmp(attr->uuid, BT_UUID_GATT_PRIMARY)) {
|
||||
if (data->group && attr->handle > data->group->end_handle) {
|
||||
if (data->group &&
|
||||
attr->handle > sys_le16_to_cpu(data->group->end_handle)) {
|
||||
data->group->end_handle = sys_cpu_to_le16(attr->handle);
|
||||
}
|
||||
return BT_GATT_ITER_CONTINUE;
|
||||
|
@ -1047,7 +1048,8 @@ static u8_t read_group_cb(const struct bt_gatt_attr *attr, void *user_data)
|
|||
/* Update group end_handle if attribute is not a service */
|
||||
if (bt_uuid_cmp(attr->uuid, BT_UUID_GATT_PRIMARY) &&
|
||||
bt_uuid_cmp(attr->uuid, BT_UUID_GATT_SECONDARY)) {
|
||||
if (data->group && attr->handle > data->group->end_handle) {
|
||||
if (data->group &&
|
||||
attr->handle > sys_le16_to_cpu(data->group->end_handle)) {
|
||||
data->group->end_handle = sys_cpu_to_le16(attr->handle);
|
||||
}
|
||||
return BT_GATT_ITER_CONTINUE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue