summaryrefslogtreecommitdiff
path: root/extmod/nimble/modbluetooth_nimble.h
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-02-24 15:45:57 +1100
committerDamien George <damien.p.george@gmail.com>2020-03-11 13:01:35 +1100
commit1937fb22abc8e6192f6acfc037f2e9fd59fc6d8c (patch)
tree6803d817f17261db198dbf11458ebce106cea189 /extmod/nimble/modbluetooth_nimble.h
parenta01757670687b3f5cd207b8f5e1008b687be27ea (diff)
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.
Diffstat (limited to 'extmod/nimble/modbluetooth_nimble.h')
-rw-r--r--extmod/nimble/modbluetooth_nimble.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/extmod/nimble/modbluetooth_nimble.h b/extmod/nimble/modbluetooth_nimble.h
index 745ff9682..f44e1d69d 100644
--- a/extmod/nimble/modbluetooth_nimble.h
+++ b/extmod/nimble/modbluetooth_nimble.h
@@ -44,6 +44,7 @@ enum {
MP_BLUETOOTH_NIMBLE_BLE_STATE_OFF,
MP_BLUETOOTH_NIMBLE_BLE_STATE_STARTING,
MP_BLUETOOTH_NIMBLE_BLE_STATE_ACTIVE,
+ MP_BLUETOOTH_NIMBLE_BLE_STATE_STOPPING,
};
extern volatile int mp_bluetooth_nimble_ble_state;