diff --git a/nrf5/modules/ubluepy/ubluepy_peripheral.c b/nrf5/modules/ubluepy/ubluepy_peripheral.c index d8f450c3a5..7afa3839bc 100644 --- a/nrf5/modules/ubluepy/ubluepy_peripheral.c +++ b/nrf5/modules/ubluepy/ubluepy_peripheral.c @@ -372,7 +372,7 @@ STATIC mp_obj_t peripheral_connect(mp_obj_t self_in, mp_obj_t dev_addr) { ; } - ble_drv_gattc_event_handler_set(MP_OBJ_FROM_PTR(s), gattc_event_handler); + ble_drv_gattc_event_handler_set(MP_OBJ_FROM_PTR(self), gattc_event_handler); bool retval = ble_drv_discover_services(self, self->conn_handle, disc_add_service); if (retval != true) {