-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
GATT: bt_gatt_is_subscribed does not work as expected when called from bt_conn_cb->connected #42829
Labels
area: Bluetooth Host
Bluetooth Host (excluding BR/EDR)
area: Bluetooth
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Comments
MariuszSkamra
added
bug
The issue is a bug, or the PR is fixing a bug
area: Bluetooth Host
Bluetooth Host (excluding BR/EDR)
labels
Feb 15, 2022
I agree. Rationale:
Possible fixes:
|
@MariuszSkamra are you planning to send a PR to fix this? |
@alwa-nordic I would go with the revert, since the |
MariuszSkamra
added a commit
to MariuszSkamra/zephyr
that referenced
this issue
Mar 21, 2022
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]>
carlescufi
pushed a commit
that referenced
this issue
Mar 22, 2022
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]>
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
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
CONFIG_BT_SETTINGS_CCC_LAZY_LOADING is set.
bt_gatt_is_subscribed will always return false when called from bt_conn_cb->connected callback.
It is because bt_gatt_connected is called after all other registered callbacks were called. The change that introduced such behavior: 6bb75a5
GATT as the stack layer shall be ready when the application is notified about connection.
To Reproduce
Expected behavior
bt_gatt_is_subscribed shall return true.
Impact
App does not know whether the device is subscribed unless it stores the value itself (it's not preferred solution since the value is stored in BT_SETTINGS).
The text was updated successfully, but these errors were encountered: