mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-31 23:21:06 +00:00
ble works again after sleep - but we are still leaking
This commit is contained in:
@@ -319,3 +319,7 @@ BLEService *createMeshBluetoothService(BLEServer *server)
|
||||
|
||||
return service;
|
||||
}
|
||||
|
||||
void destroyMeshBluetoothService() {
|
||||
meshFromNumCharacteristic = NULL;
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
BLEService *createMeshBluetoothService(BLEServer* server);
|
||||
void destroyMeshBluetoothService();
|
||||
|
||||
/**
|
||||
* Tell any bluetooth clients that the number of rx packets has changed
|
||||
|
||||
@@ -264,6 +264,10 @@ void setup()
|
||||
void initBluetooth()
|
||||
{
|
||||
DEBUG_MSG("Starting bluetooth\n");
|
||||
|
||||
// FIXME - we are leaking like crazy
|
||||
// AllocatorScope scope(btPool);
|
||||
|
||||
BLEServer *serve = initBLE(getDeviceName(), HW_VENDOR, str(APP_VERSION)); // FIXME, use a real name based on the macaddr
|
||||
createMeshBluetoothService(serve);
|
||||
|
||||
@@ -284,7 +288,8 @@ void setBluetoothEnable(bool on)
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME - we are leaking like crazy
|
||||
// We have to totally teardown our bluetooth objects to prevent leaks
|
||||
destroyMeshBluetoothService();
|
||||
deinitBLE();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user