mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 18:54:28 +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
|
#if USE_BLE
|
||||||
void cleanBleInstances() {
|
void cleanBleInstances() {
|
||||||
#if USE_BLE
|
|
||||||
if (!NimBLEDevice::isInitialized()) {
|
if (!NimBLEDevice::isInitialized()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -442,10 +441,13 @@ protected:
|
|||||||
NimBLEDevice::deleteClient(client);
|
NimBLEDevice::deleteClient(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pollingBleSensors() {
|
void pollingBleSensors() {
|
||||||
|
if (!Sensors::getAmountByType(Sensors::Type::BLUETOOTH, true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!NimBLEDevice::isInitialized() && millis() > 5000) {
|
if (!NimBLEDevice::isInitialized() && millis() > 5000) {
|
||||||
Log.sinfoln(FPSTR(L_SENSORS_BLE), F("Initialized"));
|
Log.sinfoln(FPSTR(L_SENSORS_BLE), F("Initialized"));
|
||||||
BLEDevice::init("");
|
BLEDevice::init("");
|
||||||
|
|||||||
Reference in New Issue
Block a user