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:
Jim Mussared
2020-02-24 15:45:57 +11:00
committed by Damien George
parent a017576706
commit 1937fb22ab
5 changed files with 96 additions and 6 deletions

View File

@@ -164,8 +164,8 @@ int mp_bluetooth_init(void);
// Disables the Bluetooth stack. Is a no-op when not enabled.
void mp_bluetooth_deinit(void);
// Returns true when the Bluetooth stack is enabled.
bool mp_bluetooth_is_enabled(void);
// Returns true when the Bluetooth stack is active.
bool mp_bluetooth_is_active(void);
// Gets the MAC addr of this device in big-endian format.
void mp_bluetooth_get_device_addr(uint8_t *addr);