@@ -63,7 +63,7 @@ int bleio_connection_event_cb(struct ble_gap_event *event, void *connection_in)
63
63
connection -> pair_status = PAIR_NOT_PAIRED ;
64
64
65
65
#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 );
67
67
#endif
68
68
if (connection -> connection_obj != mp_const_none ) {
69
69
bleio_connection_obj_t * obj = connection -> connection_obj ;
@@ -209,6 +209,7 @@ STATIC int _discovered_characteristic_cb(uint16_t conn_handle,
209
209
_last_discovery_status = error -> status ;
210
210
xTaskNotifyGive (discovery_task );
211
211
}
212
+ return 0 ;
212
213
}
213
214
// If any of these memory allocations fail, we set _last_discovery_status
214
215
// and let the process continue.
@@ -233,11 +234,14 @@ STATIC int _discovered_characteristic_cb(uint16_t conn_handle,
233
234
((chr -> properties & BLE_GATT_CHR_PROP_WRITE_NO_RSP ) != 0 ? CHAR_PROP_WRITE_NO_RESPONSE : 0 );
234
235
235
236
// 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
+
236
240
common_hal_bleio_characteristic_construct (
237
241
characteristic , service , chr -> val_handle , uuid ,
238
242
props , SECURITY_MODE_OPEN , SECURITY_MODE_OPEN ,
239
243
0 , false, // max_length, fixed_length: values don't matter for gattc
240
- mp_const_empty_bytes ,
244
+ & mp_const_empty_bytes_bufinfo ,
241
245
NULL );
242
246
// Set def_handle directly since it is only used in discovery.
243
247
characteristic -> def_handle = chr -> def_handle ;
@@ -260,6 +264,7 @@ STATIC int _discovered_descriptor_cb(uint16_t conn_handle,
260
264
_last_discovery_status = error -> status ;
261
265
}
262
266
xTaskNotifyGive (discovery_task );
267
+ return 0 ;
263
268
}
264
269
// If any of these memory allocations fail, we set _last_discovery_status
265
270
// and let the process continue.
0 commit comments