File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -427,7 +427,6 @@ void bluetoothStart()
427
427
// }
428
428
429
429
// This function stops BT so that it can be restarted later
430
- // It also releases as many system resources as possible so that WiFi/caster is more stable
431
430
void bluetoothStop ()
432
431
{
433
432
#ifdef COMPILE_BT
@@ -438,22 +437,26 @@ void bluetoothStop()
438
437
bluetoothSerialBle->flush (); // Complete any transfers
439
438
bluetoothSerialBle->disconnect (); // Drop any clients
440
439
bluetoothSerialBle->end (); // Release resources
440
+ bluetoothSerialBle->register_callback (nullptr );
441
441
442
442
bluetoothSerialSpp->flush (); // Complete any transfers
443
443
bluetoothSerialSpp->disconnect (); // Drop any clients
444
444
bluetoothSerialSpp->end (); // Release resources
445
+ bluetoothSerialSpp->register_callback (nullptr );
445
446
}
446
447
else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP)
447
448
{
448
449
bluetoothSerialSpp->flush (); // Complete any transfers
449
450
bluetoothSerialSpp->disconnect (); // Drop any clients
450
451
bluetoothSerialSpp->end (); // Release resources
452
+ bluetoothSerialSpp->register_callback (nullptr );
451
453
}
452
454
else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_BLE)
453
455
{
454
456
bluetoothSerialBle->flush (); // Complete any transfers
455
457
bluetoothSerialBle->disconnect (); // Drop any clients
456
458
bluetoothSerialBle->end (); // Release resources
459
+ bluetoothSerialBle->register_callback (nullptr );
457
460
}
458
461
459
462
log_d (" Bluetooth turned off" );
You can’t perform that action at this time.
0 commit comments