On Tue, Sep 8, 2020 at 10:24 AM David Carron <
david.d...@gmail.com> wrote:
>
> As you point out, since the Bluetooth SIG haven't formalised a specific serial emulation GATT for bluetooth LE, so unless somebody, somewhere in the code is specifically looking for the bespoke Microchip transparent UART service and characteristic IDs there's no real reason for it to work.
See, we're pretty much the only project out there that actively tries
to be cross-platform and cross-manufacturer.
Which means that we don't do special BLE drivers for different devices.
We don't care about the service ID. We see "oh, this is a dive
computer that does BLE, let's just see what services it has and if
they might be a serial thing".
We have a couple of special service ID's that we particularly
recognize, but for most cases it actually works fine without them. In
fact, the only one we really do *special* things for is the
Heinrich-Weikamp one, because that one has some special flow control
stuff that nobody else does.
The other services we recognize is because some dive computers have
multiple services that all *migth* be serial lines. But that's
actually fairly unusual. Most of the time, it's "oh, only this service
has both a readable and a writable characteristic that can be a serial
service".
So I'm serious: the subsurface code probably "JustWorks(tm)".
> I took a quick look at the subsurface code but I couldn't really find if the service and charactersitic selection and interpretation is implemented there or delegated to a lower-level library. If you could point me in the right general direction I could take a look through and implement the missing parts if required.
The core code is in core/qt-ble.cpp
But note that the "uud_match[]" arrays (yes, I typoed uuid, and then
it got duplicated with cut-and-paste ;) are really just "Oh, we know
abotu these". You can add the service UUID's you have to them, but you
don't have to. It likely works without them - we made do without those
known services arrays for years.
Linus