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.
This commit is contained in:
committed by
Damien George
parent
a017576706
commit
1937fb22ab
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user