[BRLTTY] Bluetooth

Stéphane Doyon s.doyon at videotron.ca
Wed Jan 16 23:52:54 EST 2008


I have had success connecting my Brailliant (Baum driver) through 
bluetooth on Fedora 8 and Ubuntu Gutsy, using a USB bluetooth dongle.

Both distros have a passkey-agent utility as part of bluez-utils package, 
but that utility is not the same on each distro!

On Fedora 8:
passkey-agent <pin> <address>
or passkey-agent --default <pin>

On Ubuntu Gutsy:
passkey-agent --default /usr/local/bin/bluepin-dave
(using Dave's script).

On FC6, I had to compile passkey-agent by hand from the bluez sources.

This is of course somewhat clunky. The right thing to do would probably be 
for BRLTTY to register as an agent over dbus and provide the PIN directly. 
I haven't looked closely at how this is done, but it should be possible to 
start from the passkey-agent code. There may be interesting details such 
as when to register and reregister...

The probe attempts over bluetooth seem to take a bit longer. I don't know 
if there are any timeouts we can tweak... If you try this be patient, 
sometimes it might take like 20secs to connect.

One glitch I've had is if the USB bluetooth dongle is disconnected: brltty 
keeps writing to the dead bluetooth interface indefinitely, all the while 
flooding your log with "Transport endpoint is not connected". The attached 
patch is my quick&dirty fix for this: perhaps this could be better done 
at a higher level that would apply to all drivers?

Note that disconnection of the USB bluetooth dongle doesn't just happen 
when you pull it out: in my case it was happening on suspending my 
laptop. With the attached patch, my bluetooth connection is reestablished 
on resume.

Thanks

-- 
Stéphane Doyon
<s.doyon at videotron.ca>
http://pages.videotron.com/sdoyon/
-------------- next part --------------
Index: BrailleDrivers/Baum/braille.c
===================================================================
--- BrailleDrivers/Baum/braille.c	(revision 3406)
+++ BrailleDrivers/Baum/braille.c	(working copy)
@@ -1817,6 +1817,10 @@
   int count = writeData(bluetoothConnection, buffer, length);
   if (count != length) {
     if (count == -1) {
+      if(errno == ENOTCONN) {
+        LogPrint(LOG_WARNING, "Bluetooth disconnect");
+        pendingCommand = BRL_CMD_RESTARTBRL;
+      }
       LogError("Baum Bluetooth write");
     } else {
       LogPrint(LOG_WARNING, "Trunccated bluetooth write: %d < %d", count, length);


More information about the BRLTTY mailing list