Bluetooth: GATT: set subscribe value to zero for unsubscription
Subscribe value is set to zero before calling notify callback, to distinguish a subscription failure from an unsubscription on disconnection (when flag BT_GATT_SUBSCRIBE_FLAG_VOLATILE is set). Change-Id: Ia91220492d82041b2c385bf88a15180387e7a483 Signed-off-by: Jonathan Gelie <jonathanx.gelie@intel.com>
This commit is contained in:
parent
ccecfaac6a
commit
a42e4f694f
2 changed files with 2 additions and 0 deletions
|
@ -1220,6 +1220,7 @@ static void remove_subscriptions(struct bt_conn *conn)
|
|||
|
||||
if (params->flags & BT_GATT_SUBSCRIBE_FLAG_VOLATILE) {
|
||||
/* Remove subscription */
|
||||
params->value = 0;
|
||||
gatt_subscription_remove(conn, prev, params);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -761,6 +761,7 @@ static void remove_subscriptions(struct bt_conn *conn)
|
|||
if (!bt_addr_le_is_bonded(&conn->le.dst) ||
|
||||
(params->flags & BT_GATT_SUBSCRIBE_FLAG_VOLATILE)) {
|
||||
/* Remove subscription */
|
||||
params->value = 0;
|
||||
gatt_subscription_remove(conn, prev, params);
|
||||
} else {
|
||||
update_subscription(conn, params);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue