mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
refactor: not initialize Bluetooth if BLE sensors are not used
This commit is contained in:
@@ -405,7 +405,6 @@ protected:
|
||||
|
||||
#if USE_BLE
|
||||
void cleanBleInstances() {
|
||||
#if USE_BLE
|
||||
if (!NimBLEDevice::isInitialized()) {
|
||||
return;
|
||||
}
|
||||
@@ -442,10 +441,13 @@ protected:
|
||||
NimBLEDevice::deleteClient(client);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void pollingBleSensors() {
|
||||
if (!Sensors::getAmountByType(Sensors::Type::BLUETOOTH, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!NimBLEDevice::isInitialized() && millis() > 5000) {
|
||||
Log.sinfoln(FPSTR(L_SENSORS_BLE), F("Initialized"));
|
||||
BLEDevice::init("");
|
||||
|
||||
Reference in New Issue
Block a user