8000 extmod/btstack: Report timeout in deinit. · micropython/micropython@5ddd3d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ddd3d2

Browse files
committed
extmod/btstack: Report timeout in deinit.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent 9f221d3 commit 5ddd3d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

extmod/btstack/modbluetooth_btstack.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,12 +705,12 @@ int mp_bluetooth_init(void) {
705705
return 0;
706706
}
707707

708-
void mp_bluetooth_deinit(void) {
708+
int mp_bluetooth_deinit(void) {
709709
DEBUG_printf("mp_bluetooth_deinit\n");
710710

711711
// Nothing to do if not initialised.
712712
if (!MP_STATE_PORT(bluetooth_btstack_root_pointers)) {
713-
return;
713+
return 0;
714714
}
715715

716716
mp_bluetooth_gap_advertise_stop();
@@ -737,6 +737,9 @@ void mp_bluetooth_deinit(void) {
737737
deinit_stack();
738738

739739
DEBUG_printf("mp_bluetooth_deinit: complete\n");
740+
741+
bool timeout = mp_bluetooth_btstack_state == MP_BLUETOOTH_BTSTACK_STATE_TIMEOUT;
742+
return timeout ? MP_ETIMEDOUT : 0;
740743
}
741744

742745
bool mp_bluetooth_is_active(void) {

0 commit comments

Comments
 (0)
0