[BRLTTY] Focus Blue 5th gen and multiple bluetooth connections

Dave Mielke Dave at mielke.cc
Sat Oct 14 00:54:07 EDT 2023


[quoted lines by Aura Kelloniemi on 2023/10/14 at 00:13 +0300]

>Would you mind explaining what the issue was? As I Said, I'm not very familiar
>with bluetooth, and would like to understand this issue in case I encounter
>something similar in the future.

The layer of Bluetooth that we're using is TCP/IP-like in that it offers a number of channels which provide reliable byte streams in both directions. There are 31 of these channels which you can think of as port-like. Each of these channels, if in use, imllements a profile, which is roughly analogous to a service. A profile provides a capability that you'd use a Bluetooth device for. For example, there's HSP (headset profile), HFP (handslfree profile), and, the one we're talking about, SPP (serial port profile).

In TCP/IP, a given service is provided on a well-known port. In Bluetooth, however, a given profile can be provided on any channel. Also, there can be several instances (each entirely separate) of the same profile with each being provided on its own channel. There's a feature called SDP (service discovery protocol) with which you can ask a Bluetooth device for the channel numbers that provide a given profile - for example, which channels on this device provide the serial port profile.

A lot of older braille devices simply offered the serial profile on channel 1. This was the case for Freedom Scientific devices. In those days, therefore, we just hard-coded that channel number as it saved significant time on connect. It seems that your Focus is using four different channels, one for each serial connection, with channel 1 still being used for the first one.

That's why brltty's fs driver, still relying on that hard-coding of channel 1, was always trying to connect to the first one. And that, in turn, was why an attempt at a second connection would return that the resource was in use. With service discovery now having been enbled, the driver first asks the device which channel provides the serial port profile. It seems that each of the four connections is publishing a different channel number for that. These days, by the way, that hard-coded channel number is still used but only if the device doesn't implement SDP or if the driver doesn't enable service discovery.

-- 
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke            | 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: Dave at Mielke.cc  | Ottawa, Ontario   | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada  K2A 1H7   |


More information about the BRLTTY mailing list