Bluetooth: GATT: Fix gatt indicate using wrong pointer for attribute

Fix bt_gatt_indicate using the wrong attribute pointer when a uuid was
provided as input.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-02-12 15:03:23 +01:00 committed by Johan Hedberg
commit 1f0f3ca9ba

View file

@ -1889,13 +1889,13 @@ int bt_gatt_indicate(struct bt_conn *conn,
/* Check if attribute is a characteristic then adjust the handle */
if (!bt_uuid_cmp(attr->uuid, BT_UUID_GATT_CHRC)) {
struct bt_gatt_chrc *chrc = params->attr->user_data;
struct bt_gatt_chrc *chrc = attr->user_data;
if (!(chrc->properties & BT_GATT_CHRC_INDICATE)) {
return -EINVAL;
}
handle = bt_gatt_attr_value_handle(params->attr);
handle = bt_gatt_attr_value_handle(attr);
}
if (conn) {