Bluetooth: gatt: Fix non-passing service handles to the callback
Pass service handles to the callback during service discovery. Change-Id: I616de5188faf76c84cc02ceb29a6f5aab631b89c Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This commit is contained in:
parent
009ddade3a
commit
a679ffbfa8
2 changed files with 7 additions and 1 deletions
|
@ -117,6 +117,8 @@ struct bt_gatt_attr {
|
|||
struct bt_gatt_service {
|
||||
/** Service UUID. */
|
||||
const struct bt_uuid *uuid;
|
||||
/** Service end handle. */
|
||||
uint16_t end_handle;
|
||||
};
|
||||
|
||||
/** @brief Include Attribute Value. */
|
||||
|
|
|
@ -570,6 +570,7 @@ static void att_find_type_rsp(struct bt_conn *conn, uint8_t err,
|
|||
{
|
||||
const struct bt_att_find_type_rsp *rsp = pdu;
|
||||
struct bt_gatt_discover_params *params = user_data;
|
||||
struct bt_gatt_service value;
|
||||
uint8_t i;
|
||||
uint16_t end_handle = 0, start_handle;
|
||||
|
||||
|
@ -590,8 +591,11 @@ static void att_find_type_rsp(struct bt_conn *conn, uint8_t err,
|
|||
BT_DBG("start_handle 0x%04x end_handle 0x%04x\n", start_handle,
|
||||
end_handle);
|
||||
|
||||
value.end_handle = end_handle;
|
||||
value.uuid = params->uuid;
|
||||
|
||||
attr = (&(struct bt_gatt_attr)
|
||||
BT_GATT_PRIMARY_SERVICE(start_handle, params->uuid));
|
||||
BT_GATT_PRIMARY_SERVICE(start_handle, &value));
|
||||
|
||||
if (params->func(attr, params) == BT_GATT_ITER_STOP) {
|
||||
goto done;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue