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:
1 parent
454a062b3b
commit
ecd23b9680
2 files changed
+15
-15
No files matched your search
+9
-9
@@ -70,13 +70,13 @@ vector<BLEAction> BLEactions;
|
||||
vector<BLEdevice*> devices;
|
||||
int newDevices = 0;
|
||||
|
||||
static BLEdevice NO_DEVICE_FOUND = {{0},
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL};
|
||||
static BLEdevice NO_BT_DEVICE_FOUND = {{0},
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL};
|
||||
static bool oneWhite = false;
|
||||
|
||||
void BTConfig_init() {
|
||||
@@ -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();
|
||||
|
||||
@@ -47,9 +47,9 @@ SemaphoreHandle_t semaphorecreateOrUpdateDeviceRTL_433;
|
||||
std::vector<RTL_433device*> RTL_433devices;
|
||||
int newRTL_433Devices = 0;
|
||||
|
||||
static RTL_433device NO_DEVICE_FOUND = {{0},
|
||||
0,
|
||||
false};
|
||||
static RTL_433device NO_RTL_433_DEVICE_FOUND = {{0},
|
||||
0,
|
||||
false};
|
||||
|
||||
RTL_433device* getDeviceById(const char* id); // Declared here to avoid pre-compilation issue (misplaced auto declaration by pio)
|
||||
RTL_433device* getDeviceById(const char* id) {
|
||||
@@ -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();
|
||||
@@ -360,4 +360,4 @@ extern int getOOKThresh() {
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Reference in new issue
Block a user