Comment 50 for bug 1674509

Revision history for this message
Simon Fels (morphis) wrote :

Btw. you guys should see if the more modern btattach utility does the job instead of hciattach too. See http://manpages.ubuntu.com/manpages/xenial/man1/btattach.1.html for a few details. Sooner or later btattach will replace hciattach as the way to attach serial lines to the kernel bluetooth stack.

btattach is much smarter as it only sets the line discipline for a serial port and leaves everything else up to the kernel.

Only supporting btattach would simply the whole implementation as we just have to provide a serial port plug on the bluez snap the user can plug any serial port to and then (via interface hooks) the bluez snap will figure out what to do with it, without having to know anything device specific. The relevant UART options (speed, noflow, vendor protocol) should be all specified via the connecting slot. Can we set arbitrary attributes on a slot definition and implement with that our own meta data needed for such a thing? Something like this would be possible then:

gadget:
  bt-serial:
    interface: serial-port
    path: /dev/ttyUSB0
    speed: 115200
    flow-control: false
    hci-uart-protocol: h4

The plug side in the bluez could then just figure out everything on its own by inspecting the attributes of the connecting slot.