Bluetooth: GATT: Fix notifications to non-bonded peers
GATT implementation fixed so that two or more non-bonded peers can now independently enable/disable notification and/or indications; and subsequently receive them too. Change-id: Ifae78297b6ba13f8ea3db58694302bb7f3449e97 Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This commit is contained in:
parent
91c7d938e3
commit
f77d06ae09
1 changed files with 4 additions and 3 deletions
|
@ -359,8 +359,7 @@ ssize_t bt_gatt_attr_write_ccc(struct bt_conn *conn,
|
|||
}
|
||||
|
||||
bt_addr_le_copy(&ccc->cfg[i].peer, &conn->le.dst);
|
||||
/* Only set valid if bonded */
|
||||
ccc->cfg[i].valid = bt_addr_le_is_bonded(&conn->le.dst);
|
||||
ccc->cfg[i].valid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -672,11 +671,13 @@ static uint8_t disconnected_cb(const struct bt_gatt_attr *attr, void *user_data)
|
|||
}
|
||||
} else {
|
||||
/* Clear value if not paired */
|
||||
if (!ccc->cfg[i].valid)
|
||||
if (!bt_addr_le_is_bonded(&conn->le.dst)) {
|
||||
ccc->cfg[i].valid = false;
|
||||
memset(&ccc->cfg[i].value, 0,
|
||||
sizeof(ccc->cfg[i].value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset value while disconnected */
|
||||
memset(&ccc->value, 0, sizeof(ccc->value));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue