BLE dive computer detection

Both Shearwater Petrel and Petrel 2 identify as 'Petrel' as their BT and BLE
names. But only the Petrel 2 supports BLE, thus only the Petrel 2 shows up in
the list of known dive computers on iOS (which supports only BLE but not
BT-only). By switching this around to always pick Petrel 2 we now correctly
detect such a dive computer on iOS.

Fixes #2739

Reported-by: Rick Holcombe <wrh@nc.rr.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-04-10 14:47:36 -07:00
parent b241d09694
commit 55bbdc2728

View file

@ -42,7 +42,10 @@ static dc_descriptor_t *getDeviceType(QString btName)
btName.startsWith("Teric") ||
btName.startsWith("NERD")) {
vendor = "Shearwater";
if (btName.startsWith("Petrel")) product = "Petrel"; // or petrel 2?
// both the Petrel and Petrel 2 identify as "Petrel" as BT/BLE device
// but only the Petrel 2 is listed as available dive computer on iOS (which requires BLE support)
// so always pick the "Petrel 2" as product when seeing a Petrel
if (btName.startsWith("Petrel")) product = "Petrel 2";
if (btName.startsWith("Perdix")) product = "Perdix";
if (btName.startsWith("Predator")) product = "Predator";
if (btName.startsWith("Teric")) product = "Teric";