BLE on macOS and many requests for testing

Dirk Hohndel dirk at hohndel.org
Sun Sep 17 16:41:17 PDT 2017


I finally found some time to look more into BLE on macOS. Things there are
rather different because Qt doesn't give us BT addresses. Or, actually, it
never gives us BT addresses for BLE devices, it seems, it sometimes (but I
can't quite figure out when) gives us BT addresses for BT classic devices.

Anyway, our whole BLE setup was designed around the idea that we'd have a
BT address to use in order to create our QLowEnergyController. Sadly that
doesn't work at all on macOS (or iOS), and is deprecated on Linux (I
haven't checked if it will still be in 5.10, though).

Instead, what you are supposed to do is to create that controller using
your QBluetoothDeviceInfo. But sadly I haven't figured out a way to get
this unless I am scanning for BT/BLE devices. So what this means is that
at least in the BLE case you now need to scan for and pick your dive
computer every time you want to download. :-(

At first I tried to use that newer method on all OSs, but it turns out
that that was a bad idea. For one thing, our Android implementation
doesn't use Qt to scan for devices, so a lot more code would have to be
rewritten there. And additionally, the new interfaces were only introduced
in Qt 5.7, so the Linux distros with Qt 5.6 would fail to build Subsurface
after I made those changes.

So for now I went back to the old code for all the non-Apple OSs.

So what has been tested (and works) so far:

BLE download on Mac, right after scanning for and selecting the dive
computer appears to work with Shearwater Petrel AI, Shearwater Petrel 2,
and Suunto EON Steel.

More testing (especially with other BT and BLE dive computers) would be
extremely useful:

http://subsurface-divelog.org/downloads/test/Subsurface-4.6.4-830-gae209a3d9f8e.dmg

BLE download on Linux (Fedora with a manual install of Qt 5.9.1) works
with a Shearwater Petrel AI. I couldn't get the Petrel 2 to work because
BT and BLE code somehow stepped all over each other there (this is a dual
mode dive computer). I need to investigate a bit more what's going wrong
there.

I have NOT checked Windows, yet; obviously, BLE isn't supported there at
all, but I would love to know if BT still works or if I inadvertandly
broke something there.

http://subsurface-divelog.org/downloads/test/subsurface-4.6.4-831-g753c00a4936f.exe

I did a quick test on Android and things seem to continue to work there.
Again, there's a new test APK and testing would be appreciated.

http://subsurface-divelog.org/downloads/test/Subsurface-mobile-4.6.4.831-arm.apk

And I haven't had enough time to try to build a new iOS binary based on
this latest code. This will require me to write some Qt based BLE scanning
for Subsurface-mobile (which might eventually allow us to migrate the
Android binary to the new way of doing things).
But in general, I'm hoping that we might be getting closer to having
working BLE download for iPads and iPhones.

Please test and let me know.

Thanks

/D



More information about the subsurface mailing list