mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 18:29:56 +00:00
oops - I was previously stopping bluetooth before stopping the mesh bluetooth service
which was bad bad
This commit is contained in:
parent
425c570757
commit
d1b7b6c5c5
@ -329,10 +329,17 @@ BLEService *createMeshBluetoothService(BLEServer *server)
|
|||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroyMeshBluetoothService()
|
void stopMeshBluetoothService()
|
||||||
{
|
{
|
||||||
assert(meshService);
|
assert(meshService);
|
||||||
meshService->stop();
|
meshService->stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void destroyMeshBluetoothService()
|
||||||
|
{
|
||||||
|
assert(meshService);
|
||||||
delete meshService;
|
delete meshService;
|
||||||
|
|
||||||
meshFromNumCharacteristic = NULL;
|
meshFromNumCharacteristic = NULL;
|
||||||
|
@ -12,8 +12,4 @@ void destroyMeshBluetoothService();
|
|||||||
*/
|
*/
|
||||||
void bluetoothNotifyFromNum(uint32_t newValue);
|
void bluetoothNotifyFromNum(uint32_t newValue);
|
||||||
|
|
||||||
/**
|
|
||||||
* Super skanky FIXME - when we start a software update we force the mesh service to shutdown.
|
|
||||||
* If the sw update fails, the user will have to manually reset the board to get things running again.
|
|
||||||
*/
|
|
||||||
void stopMeshBluetoothService();
|
void stopMeshBluetoothService();
|
@ -288,6 +288,7 @@ void setBluetoothEnable(bool on)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We have to totally teardown our bluetooth objects to prevent leaks
|
// We have to totally teardown our bluetooth objects to prevent leaks
|
||||||
|
stopMeshBluetoothService(); // Must do before shutting down bluetooth
|
||||||
deinitBLE();
|
deinitBLE();
|
||||||
destroyMeshBluetoothService(); // must do after deinit, because it frees our service
|
destroyMeshBluetoothService(); // must do after deinit, because it frees our service
|
||||||
Serial.printf("Shutdown BT: %u heap size\n", ESP.getFreeHeap());
|
Serial.printf("Shutdown BT: %u heap size\n", ESP.getFreeHeap());
|
||||||
|
Loading…
Reference in New Issue
Block a user