Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NRF5: CCCDs aren't persisted for bonded peers #279

Open
jfedor2 opened this issue Oct 14, 2020 · 0 comments
Open

NRF5: CCCDs aren't persisted for bonded peers #279

jfedor2 opened this issue Oct 14, 2020 · 0 comments

Comments

@jfedor2
Copy link

jfedor2 commented Oct 14, 2020

Client Characteristic Configuration Descriptors are the "subscription bits" for notifications and indications. When a client wants to be notified of a characteristic change, it writes a 1 to the CCCD, therefore subscribing to the changes on the characteristic.

BLE spec says the values of these CCCDs have to be persisted (on a per-client basis) for peers that are bonded. For example Windows 10 only sets the CCCDs the first time the devices connect and so if they are not cached on the device, the client thinks it's subscribed, but it's not getting any notifications. This results in a situation where, say, a bonded (paired) mouse connects for the second time and the code sends some HID reports, but they are never actually delivered to the other side, because the BLE stack thinks the client is not subscribed to the relevant characteristic. The effect is that the mouse only works the first time it's connected and then the bonding state needs to be cleared (and the devices need to bond again) before it can work again.

macOS writes the CCCD every time the device is connected so the problem doesn't show up on mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant