diff --git a/CHANGELOG.md b/CHANGELOG.md index a41040f62..bde48a266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ divelist: do not include planned versions of a dive if there is real data desktop: fix key composition in tag widgets and dive site widget mobile: allow cloud account deletion (Apple app store requirement) mobile: fix listing of local cloud cache directories +dive computer support: +- fix Ratio dive computer detection for BLE only devices --- * Always add new entries at the very top of this file above other existing entries and this note. diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp index c420ef96c..9fe071506 100644 --- a/core/btdiscovery.cpp +++ b/core/btdiscovery.cpp @@ -100,19 +100,19 @@ static dc_descriptor_t *getDeviceType(QString btName) else if (btName.mid(4,2) == "2-") product = "OSTC 2N"; else if (btName.mid(4,2) == "+ ") product = "OSTC 2"; // all BT/BLE enabled OSTCs are HW_FAMILY_OSTC_3, so when we do not know, - // just use a default product that allows the codoe to download from the + // just use a default product that allows the code to download from the // user's dive computer else product = "OSTC 2"; } else if (btName.contains(QRegularExpression("^DS\\d{6}"))) { // The Ratio bluetooth name looks like the Pelagic ones, // but that seems to be just happenstance. vendor = "Ratio"; - product = "iX3M GPS Easy"; // we don't know which of the GPS models, so set one + product = "iX3M 2021 GPS Easy"; // we don't know which of the Bluetooth models, so set one that supports BLE } else if (btName.contains(QRegularExpression("^IX5M\\d{6}"))) { // The 2021 iX3M models (square buttons) report as iX5M, // eventhough the physical model states iX3M. vendor = "Ratio"; - product = "iX3M GPS Easy"; // we don't know which of the GPS models, so set one + product = "iX3M 2021 GPS Easy"; // we don't know which of the Bluetooth models, so set one that supports BLE } else if (btName.contains(QRegularExpression("^[A-Z]{2}\\d{6}"))) { // try the Pelagic/Aqualung name patterns // the source of truth for this data is in libdivecomputer/src/descriptor.c @@ -142,11 +142,21 @@ static dc_descriptor_t *getDeviceType(QString btName) // check if we found a known dive computer if (!vendor.isEmpty() && !product.isEmpty()) { dc_descriptor_t *lookup = descriptorLookup.value(vendor.toLower() + product.toLower()); - if (!lookup) - qWarning("known dive computer %s not found in descriptorLookup", qPrintable(QString(vendor + product))); + if (!lookup) { + // the Ratio dive computers come in BT only or BLE only and we can't tell + // which just from the name; so while this is fairly unlikely, the user + // could be on an older computer / device that only supports BT and no BLE + // and giving the BLE only name might therefore not work, so try the other + // one just in case + if (vendor == "Ratio" && product == "iX3M 2021 GPS Easy") { + product = "iX3M GPS Easy"; // this one is BT only + lookup = descriptorLookup.value(vendor.toLower() + product.toLower()); + } + if (!lookup) // still nothing? + qWarning("known dive computer %s not found in descriptorLookup", qPrintable(QString(vendor + product))); + } return lookup; } - return nullptr; }