diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-03-29 17:49:12 +0100 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-03-29 17:49:12 +0100 |
commit | 4683efe227cd1cf81ff7d7ad845e2a6f53bcd6e1 (patch) | |
tree | 03448543acdaeddf378f130e9e6847494fcdb5cf /metawatch/metawatchscanner.cpp | |
parent | 1fac65b02e813a446d9ae01c90b67c700f18de32 (diff) | |
download | sowatch-4683efe227cd1cf81ff7d7ad845e2a6f53bcd6e1.tar.gz sowatch-4683efe227cd1cf81ff7d7ad845e2a6f53bcd6e1.zip |
recognize every mw as digital, workaround btns issuesowatch_0_4_4
Diffstat (limited to 'metawatch/metawatchscanner.cpp')
-rw-r--r-- | metawatch/metawatchscanner.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/metawatch/metawatchscanner.cpp b/metawatch/metawatchscanner.cpp index 1e43115..6abe4a6 100644 --- a/metawatch/metawatchscanner.cpp +++ b/metawatch/metawatchscanner.cpp @@ -30,28 +30,21 @@ void MetaWatchScanner::handleDiscoveredService(const QBluetoothServiceInfo &info { const QBluetoothDeviceInfo dev = info.device(); QString deviceName = dev.name(); - if (deviceName.startsWith("MetaWatch", Qt::CaseInsensitive)) { + if (deviceName.startsWith("MetaWatch")) { QVariantMap foundInfo; foundInfo["address"] = dev.address().toString(); foundInfo["name"] = deviceName; qDebug() << "metawatch bluetooth scan found:" << deviceName; - // "MetaWatch Digital" was AU2000 with preSTRATA firmware - // "MetaWatch SW12" seems to be STRATA - // "MetaWatch 99" seems to be AU2000 with STRATA firmware - if (deviceName.contains("Digital", Qt::CaseInsensitive) || - deviceName.contains("SW12") || deviceName.contains("99")) { - foundInfo["driver"] = QString("metawatch-digital"); - foundInfo["next-watchlet-button"] = QString("A"); - emit watchFound(foundInfo); - // "MetaWatch Analog" is the only analog watch released so far, preSTRATA fw - // "MetaWatch WDS111" (seems) analog watch with STRATA fw - } else if (deviceName.contains("Analog", Qt::CaseInsensitive) || - deviceName.contains("WDS111", Qt::CaseInsensitive)) { + if (deviceName.contains("Analog")) { + // This is Analog metawatch. foundInfo["driver"] = QString("metawatch-analog"); foundInfo["next-watchlet-button"] = QString("A"); emit watchFound(foundInfo); } else { - qWarning() << "Unknown MetaWatch device found:" << deviceName; + // For now, assume Digital metawatch. + foundInfo["driver"] = QString("metawatch-digital"); + foundInfo["next-watchlet-button"] = QString("A"); + emit watchFound(foundInfo); } } } |