Skip to content

Conversation

@carlescufi
Copy link
Member

The open source controller did not expose support for shutting it down
via the close() API in the HCI driver. Add support for it, which
completes the support for disabling and enabling the Bluetooth stack in
Zephyr.

Closes #3192.

Signed-off-by: Carles Cufi carles.cufi@nordicsemi.no

ppryga-nordic
ppryga-nordic previously approved these changes Jun 1, 2022
Copy link
Contributor

@ppryga-nordic ppryga-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carlescufi carlescufi force-pushed the hci-close branch 2 times, most recently from 641cdea to 6c31dc2 Compare June 2, 2022 14:01
@cvinayak cvinayak dismissed their stale review June 2, 2022 14:07

Dismissing, my change requests are addressed. Will approve after I get a chance to test it.

@carlescufi carlescufi requested a review from jhedberg June 2, 2022 14:10
@cvinayak
Copy link
Contributor

cvinayak commented Jun 2, 2022

I get segmentation fault when using bt_enable() after bt_disable() in a modified samples/bluetooth/broadcaster sample.

image

image

@github-actions github-actions bot added the area: Bluetooth Host Bluetooth Host (excluding BR/EDR) label Jun 2, 2022
@carlescufi carlescufi requested a review from Thalley June 2, 2022 16:58
@carlescufi carlescufi force-pushed the hci-close branch 2 times, most recently from 819fd14 to f56c5e0 Compare June 2, 2022 17:05
When bt_disable() was introduced, some of the global variables that
handle key aspects of Bluetooth were not converted to be also
re-initialized every time that the stack was disabled and the enabled
again. This meant that the FIFO and semaphore in the device structure
were not reset whenever the corresponding threads using them were shut
down and then restarted.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Allow the controller to be deinitialized, adding the whole chain of
calls:

- ll_deinit()
- lll_deinit()
- lll_clock_deinit()

in order to be able to turn everything off, including the controller's
refcount of the LF clock.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The open source controller did not expose support for shutting it down
via the close() API in the HCI driver. Add support for it, which
completes the support for disabling and enabling the Bluetooth stack in
Zephyr.

Closes zephyrproject-rtos#3192.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
@carlescufi
Copy link
Member Author

@ppryga @Thalley @cvinayak please take another look

Copy link
Contributor

@asbjornsabo asbjornsabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@ppryga-nordic ppryga-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carlescufi carlescufi merged commit b41d7f0 into zephyrproject-rtos:main Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shutting down BLE support

5 participants