diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2020-02-24 15:45:57 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-03-11 13:01:35 +1100 |
commit | 1937fb22abc8e6192f6acfc037f2e9fd59fc6d8c (patch) | |
tree | 6803d817f17261db198dbf11458ebce106cea189 /extmod/modbluetooth.c | |
parent | a01757670687b3f5cd207b8f5e1008b687be27ea (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/modbluetooth.c')
-rw-r--r-- | extmod/modbluetooth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/modbluetooth.c b/extmod/modbluetooth.c index 75fbeedb5..37fa31476 100644 --- a/extmod/modbluetooth.c +++ b/extmod/modbluetooth.c @@ -275,7 +275,7 @@ STATIC mp_obj_t bluetooth_ble_active(size_t n_args, const mp_obj_t *args) { } } // Return current state. - return mp_obj_new_bool(mp_bluetooth_is_enabled()); + return mp_obj_new_bool(mp_bluetooth_is_active()); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bluetooth_ble_active_obj, 1, 2, bluetooth_ble_active); |