We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 19dc219 + e30dde0 commit d50f930Copy full SHA for d50f930
shared-bindings/_bleio/Connection.c
@@ -80,14 +80,12 @@ STATIC void ensure_connected(bleio_connection_obj_t *self) {
80
//|
81
//| .. method:: disconnect()
82
83
-//| Disconnects from the remote peripheral.
+//| Disconnects from the remote peripheral. Does nothing if already disconnected.
84
85
STATIC mp_obj_t bleio_connection_disconnect(mp_obj_t self_in) {
86
bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in);
87
- ensure_connected(self);
88
-
+ // common_hal_bleio_connection_disconnect() does nothing if already disconnected.
89
common_hal_bleio_connection_disconnect(self->connection);
90
91
return mp_const_none;
92
}
93
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_disconnect_obj, bleio_connection_disconnect);
0 commit comments