QML UI: try to match BT names to known dive computers

So far this just adds data to the log.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-05-29 12:25:21 -07:00
parent b9ac6334c7
commit a568562503
2 changed files with 9 additions and 3 deletions

View file

@ -98,7 +98,7 @@ struct mydescriptor {
* stay like this for now.
*/
void fill_computer_list();
extern QStringList vendorList;
extern QStringList vendorList;
extern QHash<QString, QStringList> productList;
extern QMap<QString, dc_descriptor_t *> descriptorLookup;

View file

@ -206,8 +206,14 @@ void QMLManager::mergeLocalRepo()
#if BT_SUPPORT
void QMLManager::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
{
QString newDevice = "Found new device " + device.name() + " (" + device.address().toString() + ")";
appendTextToLog(newDevice);
QString newDevice = device.name();
appendTextToLog("Found new device " + newDevice + " (" + device.address().toString() + ")");
QString vendor, product;
foreach (vendor, productList.keys()) {
if (productList[vendor].contains(newDevice)) {
appendTextToLog("this could be a " + vendor + " " + newDevice);
}
}
}
#endif