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 <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-11-24 17:31:45 +01:00 committed by Johan Hedberg
commit a081e0a57f

View file

@ -838,6 +838,7 @@ static void gatt_find_type_rsp(struct bt_conn *conn, uint8_t err,
for (i = 0; length >= sizeof(rsp->list[i]);
i++, length -= sizeof(rsp->list[i])) {
struct bt_gatt_attr attr = {};
struct bt_gatt_service value;
start_handle = sys_le16_to_cpu(rsp->list[i].start_handle);
end_handle = sys_le16_to_cpu(rsp->list[i].end_handle);
@ -851,7 +852,11 @@ static void gatt_find_type_rsp(struct bt_conn *conn, uint8_t err,
attr.uuid = BT_UUID_GATT_SECONDARY;
}
value.end_handle = end_handle;
value.uuid = params->uuid;
attr.handle = start_handle;
attr.user_data = &value;
if (params->func(conn, &attr, params) == BT_GATT_ITER_STOP) {
return;