Skip to content

Commit

Permalink
Try to improve theengs model id detection
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Oct 21, 2022
1 parent 30a9a05 commit 9093941
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/DeviceManager_theengs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,14 @@ QString DeviceManager::getDeviceModelIdTheengs_fromAdv(const QBluetoothDeviceInf
if (dec.decodeBLEJson(obj) >= 0)
{
QString model = QString::fromStdString(doc["model"]);
QString modelId = QString::fromStdString(doc["model_id"]);

if (model == "IBEACON") continue;
if (model == "MS-CDP") continue;
if (model == "GAEN") continue;
return QString::fromStdString(doc["model_id"]);
if (modelId.isEmpty()) continue;

return modelId;
}
}

Expand All @@ -344,10 +348,14 @@ QString DeviceManager::getDeviceModelIdTheengs_fromAdv(const QBluetoothDeviceInf
if (dec.decodeBLEJson(obj) >= 0)
{
QString model = QString::fromStdString(doc["model"]);
QString modelId = QString::fromStdString(doc["model_id"]);

if (model == "IBEACON") continue;
if (model == "MS-CDP") continue;
if (model == "GAEN") continue;
return QString::fromStdString(doc["model_id"]);
if (modelId.isEmpty()) continue;

return modelId;
}
}

Expand Down

0 comments on commit 9093941

Please sign in to comment.