From d570cb789f4960b890b045a1512b0350dad5a795 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 24 Aug 2019 14:10:25 -0700 Subject: Update libdivecomputer to support the Aqualung i200c I got confirmation from Tiago Thedim Dias that my libdivecomputer patch makes BLE downloading work from the i200c, and already pushed out the libdivecomputer changes earlier. This updates the subproject in subsurface to have those changes. This also adds the bluetooth name patterns for the i300c and a few other Aqualung dive computers we hadn't added yet. That should make them show up in the bleutooth device list even without having to check the "Show all bluetooth devices" check-box. Tiago claims he didn't need that, and I wonder if we have some overly permissive match somewhere, but it's the right thing to do regardless. Signed-off-by: Linus Torvalds --- core/btdiscovery.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'core/btdiscovery.cpp') diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp index 175ecf932..8db1e02cc 100644 --- a/core/btdiscovery.cpp +++ b/core/btdiscovery.cpp @@ -78,11 +78,30 @@ static dc_descriptor_t *getDeviceType(QString btName) product = "Quad"; } + // The Pelagic dive computers (generally branded as Oceanic or Aqualung) + // show up with a two-byte model code followed by six bytes of serial + // number. The model code matches the hex model (so "FQ" is 0x4651, + // where 'F' is 46h and 'Q' is 51h in ASCII). + if (btName.contains(QRegularExpression("^FI\\d{6}$"))) { + vendor = "Aqualung"; + product = "i200c"; + } + + if (btName.contains(QRegularExpression("^FH\\d{6}$"))) { + vendor = "Aqualung"; + product = "i300c"; + } + if (btName.contains(QRegularExpression("^FQ\\d{6}$"))) { vendor = "Aqualung"; product = "i770R"; } + if (btName.contains(QRegularExpression("^FR\\d{6}$"))) { + vendor = "Aqualung"; + product = "i550c"; + } + if (btName.contains(QRegularExpression("^ER\\d{6}$"))) { vendor = "Oceanic"; product = "Pro Plus X"; @@ -93,6 +112,8 @@ static dc_descriptor_t *getDeviceType(QString btName) product = "Geo 4.0"; } + // The Ratio bluetooth name looks like the Pelagic ones, + // but that seems to be just happenstance. if (btName.contains(QRegularExpression("^DS\\d{6}"))) { vendor = "Ratio"; product = "iX3M GPS Easy"; // we don't know which of the GPS models, so set one -- cgit v1.2.3-70-g09d2