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

Bluetooth: GATT: Fix BT_GATT_AUTO_DISCOVER_CCC #3

Conversation

petejohanson
Copy link

Backport of a Zephyr master fix for auto discover of GATT CCC descriptors when subscribing for notifications/indications. I'm using this for the cleaned up code in zmkfirmware/zmk#547 that @joelspadin noted. By adding this, we can avoid doing a bunch of extra discovery tracking ourselves, and let Zephyr stack handle it.

When using BT_GATT_AUTO_DISCOVER_CCC if the ccc_handle is not set
bt_gatt_subscribe would initiate a discovery to locate the CCC handle
but instead of awaiting it to complete the code does proceed to call
gatt_write_ccc even with ccc_handle being 0x0000 which is invalid.

Signed-off-by: Luiz Augusto von Dentz luiz.von.dentz@intel.com
(cherry picked from commit 64cc5a3)

When using BT_GATT_AUTO_DISCOVER_CCC if the ccc_handle is not set
bt_gatt_subscribe would initiate a discovery to locate the CCC handle
but instead of awaiting it to complete the code does proceed to call
gatt_write_ccc even with ccc_handle being 0x0000 which is invalid.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
(cherry picked from commit 64cc5a3)
@petejohanson petejohanson self-assigned this Jan 12, 2021
@petejohanson petejohanson merged commit 2227eb7 into zmkfirmware:v2.4.0+zmk-fixes Jan 15, 2021
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

Successfully merging this pull request may close these issues.

2 participants