From 1937fb22abc8e6192f6acfc037f2e9fd59fc6d8c Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Mon, 24 Feb 2020 15:45:57 +1100 Subject: extmod/nimble: Clarify active state and check for active in all methods. This commit ensures that the BLE stack is active before allowing operations that may otherwise crash if it's not active. It also clarifies the state better (adding the "stopping" state) and renames mp_bluetooth_is_enabled to the more self-explanatory mp_bluetooth_is_active. --- extmod/btstack/modbluetooth_btstack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extmod/btstack/modbluetooth_btstack.c') diff --git a/extmod/btstack/modbluetooth_btstack.c b/extmod/btstack/modbluetooth_btstack.c index f5ae40a3a..285f2c816 100644 --- a/extmod/btstack/modbluetooth_btstack.c +++ b/extmod/btstack/modbluetooth_btstack.c @@ -271,7 +271,7 @@ void mp_bluetooth_deinit(void) { MP_STATE_PORT(bluetooth_btstack_root_pointers) = NULL; } -bool mp_bluetooth_is_enabled(void) { +bool mp_bluetooth_is_active(void) { return mp_bluetooth_btstack_state == MP_BLUETOOTH_BTSTACK_STATE_ACTIVE; } -- cgit v1.2.3