Fix discovery of connectable devices (#1173)
This commit is contained in:
1 parent
9059547d12
commit
0e45f7cca0
1 file changed
+8
-9
+8
-9
@@ -844,11 +844,11 @@ void launchBTDiscovery() {
|
||||
# endif
|
||||
BLEdevice* p = *it;
|
||||
Log.trace(F("Device mac %s" CR), p->macAdr);
|
||||
if (p->sensorModel_id > TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL &&
|
||||
p->sensorModel_id < TheengsDecoder::BLE_ID_NUM::BLE_ID_MAX &&
|
||||
!isDiscovered(p)) {
|
||||
if (!isDiscovered(p)) {
|
||||
String macWOdots = String(p->macAdr);
|
||||
macWOdots.replace(":", "");
|
||||
if (p->sensorModel_id > TheengsDecoder::BLE_ID_NUM::UNKNOWN_MODEL &&
|
||||
p->sensorModel_id < TheengsDecoder::BLE_ID_NUM::BLE_ID_MAX) {
|
||||
Log.trace(F("Looking for Model_id: %d" CR), p->sensorModel_id);
|
||||
std::string properties = decoder.getTheengProperties(p->sensorModel_id);
|
||||
Log.trace(F("properties: %s" CR), properties.c_str());
|
||||
@@ -878,7 +878,9 @@ void launchBTDiscovery() {
|
||||
model.c_str(), brand.c_str(), model_id.c_str(), macWOdots.c_str(), false,
|
||||
stateClassMeasurement);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
} else if (p->sensorModel_id > BLEconectable::id::MIN &&
|
||||
p->sensorModel_id < BLEconectable::id::MAX) {
|
||||
// Discovery of sensors from which we retrieve data only by connect
|
||||
if (p->sensorModel_id == BLEconectable::id::DT24_BLE) {
|
||||
DT24Discovery(macWOdots.c_str(), "DT24-BLE");
|
||||
@@ -892,18 +894,15 @@ void launchBTDiscovery() {
|
||||
if (p->sensorModel_id == BLEconectable::id::XMWSDJ04MMC) {
|
||||
XMWSDJ04MMCDiscovery(macWOdots.c_str(), "XMWSDJ04MMC");
|
||||
}
|
||||
} else {
|
||||
Log.trace(F("Device UNKNOWN_MODEL %s" CR), p->macAdr);
|
||||
}
|
||||
p->isDisc = true; // we don't need the semaphore and all the search magic via createOrUpdateDevice
|
||||
} else {
|
||||
if (!isDiscovered(p)) {
|
||||
Log.trace(F("Device UNKNOWN_MODEL %s" CR), p->macAdr);
|
||||
p->isDisc = true;
|
||||
} else {
|
||||
Log.trace(F("Device already discovered %s" CR), p->macAdr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
void PublishDeviceData(JsonObject& BLEdata, bool processBLEData) {
|
||||
|
||||
Reference in new issue
Block a user