From 5f645b6c8ea27b041e5b259fac2a86b3b7647eaa Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Sun, 2 Apr 2017 00:31:28 +0200 Subject: [PATCH] nrf5/modules/ubluepy: Adding compile guard for UBLUEPY_CENTRAL around the char_read() call to ble_drv_attr_c_read(). --- nrf5/modules/ubluepy/ubluepy_characteristic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nrf5/modules/ubluepy/ubluepy_characteristic.c b/nrf5/modules/ubluepy/ubluepy_characteristic.c index f8e7a29eef..1a68e070b0 100644 --- a/nrf5/modules/ubluepy/ubluepy_characteristic.c +++ b/nrf5/modules/ubluepy/ubluepy_characteristic.c @@ -95,6 +95,7 @@ void char_data_callback(mp_obj_t self_in, uint16_t length, uint8_t * p_data) { STATIC mp_obj_t char_read(mp_obj_t self_in) { ubluepy_characteristic_obj_t * self = MP_OBJ_TO_PTR(self_in); +#if MICROPY_PY_UBLUEPY_CENTRAL // TODO: free any previous allocation of value_data ble_drv_attr_c_read(self->p_service->p_periph->conn_handle, @@ -103,6 +104,10 @@ STATIC mp_obj_t char_read(mp_obj_t self_in) { char_data_callback); return self->value_data; +#else + (void)self; + return mp_const_none; +#endif } STATIC MP_DEFINE_CONST_FUN_OBJ_1(ubluepy_characteristic_read_obj, char_read);