Skip to content

Commit d15b758

Browse files
Szymon Jancnashif
authored andcommitted
Bluetooth: GATT: Fix primary service discovery response
Applications expect service end handle as attribute value in userdata on discovery response callback. Jira: ZEP-1354 Change-Id: I664da4a7e054a531ad1c2c8cbc74367cb679ff03 Signed-off-by: Szymon Janc <[email protected]>
1 parent 999c15d commit d15b758

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/bluetooth/host/gatt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ static void att_find_type_rsp(struct bt_conn *conn, uint8_t err,
838838
for (i = 0; length >= sizeof(rsp->list[i]);
839839
i++, length -= sizeof(rsp->list[i])) {
840840
struct bt_gatt_attr attr = {};
841+
struct bt_gatt_service value;
841842

842843
start_handle = sys_le16_to_cpu(rsp->list[i].start_handle);
843844
end_handle = sys_le16_to_cpu(rsp->list[i].end_handle);
@@ -851,7 +852,11 @@ static void att_find_type_rsp(struct bt_conn *conn, uint8_t err,
851852
attr.uuid = BT_UUID_GATT_SECONDARY;
852853
}
853854

855+
value.end_handle = end_handle;
856+
value.uuid = params->uuid;
857+
854858
attr.handle = start_handle;
859+
attr.user_data = &value;
855860

856861
if (params->func(conn, &attr, params) == BT_GATT_ITER_STOP) {
857862
return;

0 commit comments

Comments
 (0)