Skip to content

Revert "Bluetooth: gatt: ccc changed cb after connection cb" #44015

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

Merged

Conversation

MariuszSkamra
Copy link
Collaborator

This reverts commit 6bb75a5.
This fixes GATT that was uninitalized when application received
bt_conn_cb->connected callback. As the result, the bt_gatt_is_subscribed
was not working as expected when called from bt_conn_cb->connected.

The _bt_gatt_ccc->cfg_changed callback does not carry information about
the device that subscribed for notifications but rather is says the
app when it should start/stop broadcasting notifications.

This leads to the conclusion that the bt_gatt_ccc->cfg_changed can be
called before bt_conn_cb->connected callback.

Fixes: #42829
Signed-off-by: Mariusz Skamra [email protected]

This reverts commit 6bb75a5.
This fixes GATT that was uninitalized when application received
bt_conn_cb->connected callback. As the result, the bt_gatt_is_subscribed
was not working as expected when called from bt_conn_cb->connected.

The _bt_gatt_ccc->cfg_changed callback does not carry information about
the device that subscribed for notifications but rather is says the
app when it should start/stop broadcasting notifications.

This leads to the conclusion that the bt_gatt_ccc->cfg_changed can be
called before bt_conn_cb->connected callback.

Fixes: zephyrproject-rtos#42829
Signed-off-by: Mariusz Skamra <[email protected]>
@Thalley
Copy link
Collaborator

Thalley commented Mar 21, 2022

The change was introduced in #13473 which fixed #13316. Does reverting the commit re-introduce the issue from #13316?

@MariuszSkamra
Copy link
Collaborator Author

MariuszSkamra commented Mar 21, 2022

The change was introduced in #13473 which fixed #13316. Does reverting the commit re-introduce the issue from #13316?

I think the #13316 is not an issue in the stack, but rather the API was misused

@alwa-nordic
Copy link
Collaborator

I created a PR with new doc for cfg_changed. Please have a look here: #44030

@carlescufi carlescufi merged commit d0111f7 into zephyrproject-rtos:main Mar 22, 2022
@MariuszSkamra MariuszSkamra deleted the fix_gatt_connected_behavior branch March 28, 2022 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GATT: bt_gatt_is_subscribed does not work as expected when called from bt_conn_cb->connected
5 participants