diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-07-07 00:07:47 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2019-07-07 00:07:47 -0400 |
| commit | 09ddff8df1349c590e6c0533b6f5085fbcb92483 (patch) | |
| tree | 0d7e167b231f892937eaead1390a2fcaee65b6ce /shared-bindings/bleio/Peripheral.c | |
| parent | bf8a35b2f835fbc97d54867f8e21b486a46c245b (diff) | |
WIP: Need descriptors for Central CCCD discovery; not done yet
Diffstat (limited to 'shared-bindings/bleio/Peripheral.c')
| -rw-r--r-- | shared-bindings/bleio/Peripheral.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/shared-bindings/bleio/Peripheral.c b/shared-bindings/bleio/Peripheral.c index 665f5baaf..320d83471 100644 --- a/shared-bindings/bleio/Peripheral.c +++ b/shared-bindings/bleio/Peripheral.c @@ -250,10 +250,26 @@ STATIC mp_obj_t bleio_peripheral_stop_advertising(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_peripheral_stop_advertising_obj, bleio_peripheral_stop_advertising); +//| .. method:: disconnect() +//| +//| Disconnects from the remote central. +//| Normally the central initiates a disconnection. Use this only +//| if necessary for your application. +//| +STATIC mp_obj_t bleio_peripheral_disconnect(mp_obj_t self_in) { + bleio_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); + + common_hal_bleio_peripheral_disconnect(self); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_peripheral_disconnect_obj, bleio_peripheral_disconnect); + STATIC const mp_rom_map_elem_t bleio_peripheral_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_start_advertising), MP_ROM_PTR(&bleio_peripheral_start_advertising_obj) }, { MP_ROM_QSTR(MP_QSTR_stop_advertising), MP_ROM_PTR(&bleio_peripheral_stop_advertising_obj) }, + { MP_ROM_QSTR(MP_QSTR_disconnect), MP_ROM_PTR(&bleio_peripheral_disconnect_obj) }, // Properties { MP_ROM_QSTR(MP_QSTR_connected), MP_ROM_PTR(&bleio_peripheral_connected_obj) }, |
