-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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: Auto init if bt_gatt_service_register is called #9848
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9848 +/- ##
=======================================
Coverage 52.28% 52.28%
=======================================
Files 213 213
Lines 25964 25964
Branches 5598 5598
=======================================
Hits 13576 13576
Misses 10150 10150
Partials 2238 2238 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I verified that this patch fixes the issue I reported.
subsys/bluetooth/host/gatt.c
Outdated
@@ -237,6 +238,9 @@ static void sc_process(struct k_work *work) | |||
|
|||
void bt_gatt_init(void) | |||
{ | |||
if (!atomic_cas(&init, 0, 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curly braces for this if statement...
This ensures the core services are always registered first and the gatt_sc work is initialized. Fixes zephyrproject-rtos#9785 Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Anas Nashif <[email protected]>
This ensures the core services are always registered first and the
gatt_sc work is initialized.
Fixes #9785
Signed-off-by: Luiz Augusto von Dentz [email protected]