@@ -63,7 +63,7 @@ int bleio_connection_event_cb(struct ble_gap_event *event, void *connection_in)
6363 connection -> pair_status = PAIR_NOT_PAIRED ;
6464
6565 #if CIRCUITPY_VERBOSE_BLE
66- mp_printf (& mp_plat_print , "disconnected %02x \n" , event -> disconnect .reason );
66+ mp_printf (& mp_plat_print , "event->disconnect.reason: 0x%x \n" , event -> disconnect .reason );
6767 #endif
6868 if (connection -> connection_obj != mp_const_none ) {
6969 bleio_connection_obj_t * obj = connection -> connection_obj ;
@@ -209,6 +209,7 @@ STATIC int _discovered_characteristic_cb(uint16_t conn_handle,
209209 _last_discovery_status = error -> status ;
210210 xTaskNotifyGive (discovery_task );
211211 }
212+ return 0 ;
212213 }
213214 // If any of these memory allocations fail, we set _last_discovery_status
214215 // and let the process continue.
@@ -233,11 +234,14 @@ STATIC int _discovered_characteristic_cb(uint16_t conn_handle,
233234 ((chr -> properties & BLE_GATT_CHR_PROP_WRITE_NO_RSP ) != 0 ? CHAR_PROP_WRITE_NO_RESPONSE : 0 );
234235
235236 // Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler.
237+ mp_buffer_info_t mp_const_empty_bytes_bufinfo ;
238+ mp_get_buffer_raise (mp_const_empty_bytes , & mp_const_empty_bytes_bufinfo , MP_BUFFER_READ );
239+
236240 common_hal_bleio_characteristic_construct (
237241 characteristic , service , chr -> val_handle , uuid ,
238242 props , SECURITY_MODE_OPEN , SECURITY_MODE_OPEN ,
239243 0 , false, // max_length, fixed_length: values don't matter for gattc
240- mp_const_empty_bytes ,
244+ & mp_const_empty_bytes_bufinfo ,
241245 NULL );
242246 // Set def_handle directly since it is only used in discovery.
243247 characteristic -> def_handle = chr -> def_handle ;
@@ -260,6 +264,7 @@ STATIC int _discovered_descriptor_cb(uint16_t conn_handle,
260264 _last_discovery_status = error -> status ;
261265 }
262266 xTaskNotifyGive (discovery_task );
267+ return 0 ;
263268 }
264269 // If any of these memory allocations fail, we set _last_discovery_status
265270 // and let the process continue.
0 commit comments