@@ -123,7 +123,7 @@ STATIC uint32_t ble_stack_enable(void) {
123
123
return err_code ;
124
124
}
125
125
126
- // Double the GATT Server attribute size to accomodate both the CircuitPython built-in service
126
+ // Triple the GATT Server attribute size to accomodate both the CircuitPython built-in service
127
127
// and anything the user does.
128
128
memset (& ble_conf , 0 , sizeof (ble_conf ));
129
129
ble_conf .gatts_cfg .attr_tab_size .attr_tab_size = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 3 ;
@@ -163,7 +163,8 @@ STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
163
163
164
164
switch (ble_evt -> header .evt_id ) {
165
165
case BLE_GAP_EVT_CONNECTED : {
166
- // Find an empty connection
166
+ // Find an empty connection. One must always be available because the SD has the same
167
+ // total connection limit.
167
168
bleio_connection_internal_t * connection ;
168
169
for (size_t i = 0 ; i < BLEIO_TOTAL_CONNECTION_COUNT ; i ++ ) {
169
170
connection = & connections [i ];
@@ -369,7 +370,7 @@ STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) {
369
370
return true;
370
371
}
371
372
372
- mp_obj_t common_hal_bleio_adapter_start_scan (bleio_adapter_obj_t * self , uint8_t * prefixes , uint8_t prefix_length , bool extended , mp_int_t buffer_size , mp_float_t timeout , mp_float_t interval , mp_float_t window , mp_int_t minimum_rssi , bool active ) {
373
+ mp_obj_t common_hal_bleio_adapter_start_scan (bleio_adapter_obj_t * self , uint8_t * prefixes , size_t prefix_length , bool extended , mp_int_t buffer_size , mp_float_t timeout , mp_float_t interval , mp_float_t window , mp_int_t minimum_rssi , bool active ) {
373
374
if (self -> scan_results != NULL ) {
374
375
if (!shared_module_bleio_scanresults_get_done (self -> scan_results )) {
375
376
mp_raise_RuntimeError (translate ("Scan already in progess. Stop with stop_scan." ));
0 commit comments