Remove std::string as the model id and use decoder enum. (#1143)
* Remove std::string as the model id and use decoder enum. * Update decoder version * Check model id is in decoder range when launching discovery. * Add BLEconnect enum MIN/MAX
This commit is contained in:
1 parent
91ab8dcdf1
commit
e838d3cee0
5 files changed
+67
-44
No files matched your search
@@ -145,10 +145,10 @@ void LYWSD03MMC_connect::notifyCB(NimBLERemoteCharacteristic* pChar, uint8_t* pD
|
||||
for (std::vector<BLEdevice*>::iterator it = devices.begin(); it != devices.end(); ++it) {
|
||||
BLEdevice* p = *it;
|
||||
if ((strcmp(p->macAdr, (char*)mac_address.c_str()) == 0)) {
|
||||
if (p->sensorModel_id.compare("LYWSD03MMC") == 0)
|
||||
if (p->sensorModel_id == BLEconectable::id::LYWSD03MMC)
|
||||
BLEdata["model"] = "LYWSD03MMC";
|
||||
else if (p->sensorModel_id.compare("MHO_C401") == 0)
|
||||
BLEdata["model"] = "MHO_C401";
|
||||
else if (p->sensorModel_id == BLEconectable::id::MHO_C401)
|
||||
BLEdata["model"] = "MHO-C401";
|
||||
}
|
||||
}
|
||||
BLEdata["id"] = (char*)mac_address.c_str();
|
||||
|
||||
Reference in new issue
Block a user