Allow for both BT and RTL_433 Gateways at the same time. (#1491)

* Allow for both BT and RTL_433 Gateways at the same time.

* Fix linting error.
This commit is contained in:
Mark Smith authored and GitHub committed 2023-03-01 14:09:51 -06:00
1 parent 454a062b3b
commit ecd23b9680
2 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -70,7 +70,7 @@ vector<BLEAction> BLEactions;
vector<BLEdevice*> devices;
int newDevices = 0;
static BLEdevice NO_DEVICE_FOUND = {{0},
static BLEdevice NO_BT_DEVICE_FOUND = {{0},
0,
false,
false,
@@ -361,7 +361,7 @@ BLEdevice* getDeviceByMac(const char* mac) {
return *it;
}
}
return &NO_DEVICE_FOUND;
return &NO_BT_DEVICE_FOUND;
}
bool updateWorB(JsonObject& BTdata, bool isWhite) {
@@ -388,7 +388,7 @@ void createOrUpdateDevice(const char* mac, uint8_t flags, int model, int mac_typ
}
BLEdevice* device = getDeviceByMac(mac);
if (device == &NO_DEVICE_FOUND) {
if (device == &NO_BT_DEVICE_FOUND) {
Log.trace(F("add %s" CR), mac);
//new device
device = new BLEdevice();
+3 -3
View File
@@ -47,7 +47,7 @@ SemaphoreHandle_t semaphorecreateOrUpdateDeviceRTL_433;
std::vector<RTL_433device*> RTL_433devices;
int newRTL_433Devices = 0;
static RTL_433device NO_DEVICE_FOUND = {{0},
static RTL_433device NO_RTL_433_DEVICE_FOUND = {{0},
0,
false};
@@ -60,7 +60,7 @@ RTL_433device* getDeviceById(const char* id) {
return *it;
}
}
return &NO_DEVICE_FOUND;
return &NO_RTL_433_DEVICE_FOUND;
}
void dumpRTL_433Devices() {
@@ -79,7 +79,7 @@ void createOrUpdateDeviceRTL_433(const char* id, const char* model, uint8_t flag
}
RTL_433device* device = getDeviceById(id);
if (device == &NO_DEVICE_FOUND) {
if (device == &NO_RTL_433_DEVICE_FOUND) {
Log.trace(F("add %s" CR), id);
//new device
device = new RTL_433device();