Diff for /wikisrc/bluetooth.mdwn between versions 1.2 and 1.3

version 1.2, 2013/02/16 12:08:37 version 1.3, 2013/02/16 13:56:32
Line 5  Bluetooth is available since version 4 o Line 5  Bluetooth is available since version 4 o
 [[!toc]]  [[!toc]]
   
   
 #  Background  # Background
   
 Bluetooth is a digital radio protocol used for short range and low power communications. NetBSD 4.0 introduced support for the Bluetooth protocol stack, and some integration of device profiles into the NetBSD device framework.  Bluetooth is a digital radio protocol used for short range and low
   power communications. NetBSD 4.0 introduced support for the Bluetooth
   protocol stack, and some integration of device profiles into the
   NetBSD device framework.
   
   The lower layers of the Bluetooth protocol stack pertaining to
   actual radio links between devices are handled inside the Bluetooth
   Controller, which communicates with the Host computer using the
   Host Controller Interface (HCI) protocol which can be accessed via
   a raw packet BTPROTO_HCI socket interface.
   
   The lowest useable protocol is the Link Layer Control and Adaptation
   Protocol (L2CAP), which can be accessed via a BTPROTO_L2CAP socket
   interface. This provides sequential packet access to remote devices,
   with up to 64k channels per radio link. When an L2CAP channel is
   opened, the protocol or service that is required is identified by
   a Protocol/Service Multiplexer (PSM) value.
   
   One available protocol is RFCOMM, which provides up to 30 emulated
   serial connections multiplexed over a single L2CAP channel. This
   streamed data protocol can be accessed using the BTPROTO_RFCOMM
   socket interface though it is planned to also provide a direct tty
   interface later. Typically, many services use RFCOMM links to provide
   a control interface using the AT command set.
   
   Isochronous (SCO) Audio connections may be created on a baseband
   radio link using either the BTPROTO_SCO socket interface, or the
   [btsco(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-current)
   audio device driver. While the specification says that up to three
   such links can be made between devices, the current Bluetooth code
   can only handle one with any dignity.
   
   Support for Human Interface Devices, which operate using the USB
   HID protocol over a pair of L2CAP channels is provided by the
   [bthidev(4)](http://netbsd.gw.com/cgi-bin/man-cgi?bthidev+4+NetBSD-current)
   driver. Currently, keyboards and mice are catered for, and attach to
   [wscons(4)](http://netbsd.gw.com/cgi-bin/man-cgi?wscons+4+NetBSD-current)
   as normal.
   
   Service Discovery in the Bluetooth environment is made available
   by
   [libsdp(3)](http://netbsd.gw.com/cgi-bin/man-cgi?libsdp+3+NetBSD-current)
   and the
   [sdpd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?sdpd+8+NetBSD-current)
   daemon (both ported from FreeBSD), which allows programs to register
   services and makes the information available to remote devices
   performing queries. Limited querying can be done with the
   [sdpquery(1)](http://netbsd.gw.com/cgi-bin/man-cgi?sdpquery+1+NetBSD-current)
   program.
   
   Security on Bluetooth links is supplied by encryption and authentication
   options. In NetBSD-4.0, these can only be applied to all baseband
   links that a controller makes, by
   [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current).
   For NetBSD-current versions after 21 April 2007, L2CAP and RFCOMM
   connections may additionally specify a minimum link mode for the
   baseband link which is applied during connection establishment.
   When authentication is requested, a PIN is presented by each side,
   generally entered by the operator (some limited input devices have
   a fixed PIN). The controller uses this PIN to generate a Link Key
   and reports this to the host computer and will ask for it to
   authenticate subsequent connections. On NetBSD, the
   [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
   daemon is responsible for storing these and responding to Link Key
   requests, and also provides an interface to allow users to specify
   a PIN with a PIN client, such as
   [btpin(1)](http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-current) or
   [sysutils/btpin-qt](http://pkgsrc.se/sysutils/btpin-qt).
   
   
   # Requirements
   
   The relevant device declarations are included in the GENERIC kernel
   configurations for the following architectures:
   
   * alpha
   * amd64
   * i386
   * sparc64
   
   For other architectures, you will need to add the device declarations
   to your kernel config file. Bluetooth should work on any architecture
   that has USB and/or PCMCIA available.
   
   Please notice that you will need NetBSD 4.0 or higher to use
   bluetooth. Since 4.0 is tagged BETA as of August 31, you will need
   a fairly current kernel. To build a current kernel, please read
   [[How to build NetBSD-current]].
   
   If you are looking to purchase a Bluetooth controller for use with
   NetBSD, the better devices are USB based, and a v2.0 device is
   better than v1.2. The Class of the device indicates the power of
   the radio - Class 1 is 100m and Class 2 is 10m.
   
 The lower layers of the Bluetooth protocol stack pertaining to actual radio links between devices are handled inside the Bluetooth Controller, which communicates with the Host computer using the Host Controller Interface (HCI) protocol which can be accessed via a raw packet BTPROTO_HCI socket interface.  
   
 The lowest useable protocol is the Link Layer Control and Adaptation Protocol (L2CAP), which can be accessed via a BTPROTO_L2CAP socket interface. This provides sequential packet access to remote devices, with up to 64k channels per radio link. When an L2CAP channel is opened, the protocol or service that is required is identified by a Protocol/Service Multiplexer (PSM) value.  # Hardware
   
 One available protocol is RFCOMM, which provides up to 30 emulated serial connections multiplexed over a single L2CAP channel. This streamed data protocol can be accessed using the BTPROTO_RFCOMM socket interface though it is planned to also provide a direct tty interface later. Typically, many services use RFCOMM links to provide a control interface using the AT command set.  If Bluetooth is configured in your kernel, you should see Bluetooth
   controllers showing up in your boot messages, for example:
 Isochronous (SCO) Audio connections may be created on a baseband radio link using either the BTPROTO_SCO socket interface, or the [btsco(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-current) audio device driver. While the specification says that up to three such links can be made between devices, the current Bluetooth code can only handle one with any dignity.  
   
 Support for Human Interface Devices, which operate using the USB HID protocol over a pair of L2CAP channels is provided by the [bthidev(4)](http://netbsd.gw.com/cgi-bin/man-cgi?bthidev+4+NetBSD-current) driver. Currently, keyboards and mice are catered for, and attach to [wscons(4)](http://netbsd.gw.com/cgi-bin/man-cgi?wscons+4+NetBSD-current) as normal.  
   
 Service Discovery in the Bluetooth environment is made available by [libsdp(3)](http://netbsd.gw.com/cgi-bin/man-cgi?libsdp+3+NetBSD-current) and the [sdpd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?sdpd+8+NetBSD-current) daemon (both ported from FreeBSD), which allows programs to register services and makes the information available to remote devices performing queries. Limited querying can be done with the [sdpquery(1)](http://netbsd.gw.com/cgi-bin/man-cgi?sdpquery+1+NetBSD-current) program.  
   
 Security on Bluetooth links is supplied by encryption and authentication options. In NetBSD-4.0, these can only be applied to all baseband links that a controller makes, by [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current). For NetBSD-current versions after 21 April 2007, L2CAP and RFCOMM connections may additionally specify a minimum link mode for the baseband link which is applied during connection establishment. When authentication is requested, a PIN is presented by each side, generally entered by the operator (some limited input devices have a fixed PIN). The controller uses this PIN to generate a Link Key and reports this to the host computer and will ask for it to authenticate subsequent connections. On NetBSD, the [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current) daemon is responsible for storing these and responding to Link Key requests, and also provides an interface to allow users to specify a PIN with a PIN client, such as [btpin(1)](http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-current) or [sysutils/btpin-qt](http://pkgsrc.se/sysutils/btpin-qt).  
   
   
 #  Requirements  
   
 The relevant device declarations are included in the GENERIC kernel configurations for the following architectures:  
   
   * alpha  
   * amd64  
   * i386  
   * sparc64  
   
 For other architectures, you will need to add the device declarations to your kernel config file. Bluetooth should work on any architecture that has USB and/or PCMCIA available.  
   
 Please notice that you will need NetBSD 4.0 or higher to use bluetooth. Since 4.0 is tagged BETA as of August 31, you will need a fairly current kernel. To build a current kernel, please read [[How to build NetBSD-current]].  
   
 If you are looking to purchase a Bluetooth controller for use with NetBSD, the better devices are USB based, and a v2.0 device is better than v1.2. The Class of the device indicates the power of the radio - Class 1 is 100m and Class 2 is 10m.  
   
   
 #  Hardware  
   
 If Bluetooth is configured in your kernel, you should see Bluetooth controllers showing up in your boot messages, for example:  
   
     bt3c0 at pcmcia0 function 0: <3COM, 3CRWB60-A, Bluetooth PC Card>      bt3c0 at pcmcia0 function 0: <3COM, 3CRWB60-A, Bluetooth PC Card>
     ubt0 at uhub1 port 4 configuration 1 interface 0      ubt0 at uhub1 port 4 configuration 1 interface 0
Line 50  If Bluetooth is configured in your kerne Line 113  If Bluetooth is configured in your kerne
     ubt1 at uhub1 port 2 configuration 1 interface 0      ubt1 at uhub1 port 2 configuration 1 interface 0
     ubt1: Broadcom Belkin Bluetooth Device, rev 1.10/0.01, addr 5      ubt1: Broadcom Belkin Bluetooth Device, rev 1.10/0.01, addr 5
   
 Some PCMCIA and Cardbus devices will attach as serial devices, and they need to be configured to use the [btuart(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btuart+4+NetBSD-current) line discipline to interface to the Bluetooth protocol stack.  Some PCMCIA and Cardbus devices will attach as serial devices, and
   they need to be configured to use the
   [btuart(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btuart+4+NetBSD-current)
   line discipline to interface to the Bluetooth protocol stack.
   
   
 #  Userland configuration  # Userland configuration
   
 Please edit your [rc.conf(5)](http://netbsd.gw.com/cgi-bin/man-cgi?rc.conf+5+NetBSD-current) file and ensure it contains:  Please edit your
   [rc.conf(5)](http://netbsd.gw.com/cgi-bin/man-cgi?rc.conf+5+NetBSD-current)
   file and ensure it contains:
   
     # configure bluetooth controllers      # configure bluetooth controllers
     btconfig=YES      btconfig=YES
Line 70  Please edit your [rc.conf(5)](http://net Line 138  Please edit your [rc.conf(5)](http://net
     # start service discovery daemon      # start service discovery daemon
     sdpd=YES      sdpd=YES
   
 _i had to add 'auth' to the `btconfig_args` line to get my phone to pair._ --[[Jasper]] 22:50, 15 September 2006 (CEST)  > i had to add 'auth' to the `btconfig_args` line to get my phone
   > to pair. --[[Jasper]] 22:50, 15 September 2006 (CEST)
   
 _sdpd runs as (user:group) _sdpd:_sdpd, but these are not present in 4.0 -- PR [bin/37125](http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=37125)_ [[Shattered]] 14:53, 10 April 2008 (CEST)  > sdpd runs as (user:group) _sdpd:_sdpd, but these are not present
   > in 4.0 -- PR
   > [bin/37125](http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=37125)
   > --[[Shattered]] 14:53, 10 April 2008 (CEST)
   
 which should be ok. Reboot or enter:  which should be ok. Reboot or enter:
   
Line 108  and you should be able to see that your  Line 179  and you should be able to see that your 
         <EDR eSCO 2Mbps> <EDR eSCO 3Mbps> <3 slot EDR eSCO> <extended features>          <EDR eSCO 2Mbps> <EDR eSCO 3Mbps> <3 slot EDR eSCO> <extended features>
   
   
 #  HID configuration  # HID configuration
   
 **Very important**: [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current) must be running.  **Very important**:
   [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
   must be running.
   
 **Important**: [sysutils/hcidump](http://pkgsrc.se/sysutils/hcidump) is very useful.  **Important**: [sysutils/hcidump](http://pkgsrc.se/sysutils/hcidump)
   is very useful.
   
 Place device into discoverable mode, and peform an inquiry:   Place device into discoverable mode, and peform an inquiry: 
   
Line 126  Place device into discoverable mode, and Line 200  Place device into discoverable mode, and
        : page scan mode 0x00         : page scan mode 0x00
        : clock offset 30537         : clock offset 30537
   
 which should get you the BDADDR of the device. for ease of use you might want to add this to `/etc/bluetooth/hosts` so you can refer to it by name:   which should get you the BDADDR of the device. for ease of use you
   might want to add this to `/etc/bluetooth/hosts` so you can refer
   to it by name:
   
     00:0a:95:10:8d:8c   mouse      00:0a:95:10:8d:8c   mouse
   
 And now, you should be able to query the device. You will likely need to pair with it first which will happen the first time you connect, so set the PIN (which is probably 0000 for limited input devices but see the manual to be sure):  And now, you should be able to query the device. You will likely
   need to pair with it first which will happen the first time you
   connect, so set the PIN (which is probably 0000 for limited input
   devices but see the manual to be sure):
   
     % btpin -a mouse -p 0000      % btpin -a mouse -p 0000
     % btdevctl -a mouse -d ubt0 -s hid      % btdevctl -a mouse -d ubt0 -s hid
Line 154  Then try to attach it to the system: Line 233  Then try to attach it to the system:
   
     % btdevctl -a mouse -d ubt0 -s hid -A      % btdevctl -a mouse -d ubt0 -s hid -A
   
 which should attach the mouse to the system and attempt to open a bluetooth connection for it. You should see something like:   which should attach the mouse to the system and attempt to open a
   bluetooth connection for it. You should see something like:
   
     bthidev0 at bthub0 remote-bdaddr 00:0a:95:10:8d:8c link-mode auth      bthidev0 at bthub0 remote-bdaddr 00:0a:95:10:8d:8c link-mode auth
     btms0 at bthidev0 reportid 2: 1 button.      btms0 at bthidev0 reportid 2: 1 button.
Line 163  which should attach the mouse to the sys Line 243  which should attach the mouse to the sys
   
 on the console, and the mouse should work.  on the console, and the mouse should work.
   
 Keyboards are only a little more complex, in that you will need to enter the PIN onto the keyboard before you can pair. This will be done at the point where you are opening the first connection, eg:  Keyboards are only a little more complex, in that you will need to
   enter the PIN onto the keyboard before you can pair. This will be
   done at the point where you are opening the first connection, eg:
   
     % btpin -a keyboard -r      % btpin -a keyboard -r
     PIN: 3537      PIN: 3537
Line 209  And you see something like this on the c Line 291  And you see something like this on the c
     wskbd1: connecting to wsdisplay0      wskbd1: connecting to wsdisplay0
     bthidev0: connected      bthidev0: connected
   
 By default, on NetBSD systems that support it, [btdevctl(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-current) will request authentication for the baseband link, or encryption if the HID is a keyboard.  By default, on NetBSD systems that support it,
   [btdevctl(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-current)
   will request authentication for the baseband link, or encryption
   if the HID is a keyboard.
   
   
 #  Serial connections  # Serial connections
   
 **See [rfcomm_sppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?rfcomm_sppd+8+NetBSD-current)**  **See
   [rfcomm_sppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?rfcomm_sppd+8+NetBSD-current)**
   
 Set the phone into discoverable mode:  Set the phone into discoverable mode:
   
Line 225  add alias to `/etc/bluetooth/hosts`, the Line 311  add alias to `/etc/bluetooth/hosts`, the
     % btpin -a phone -p 334323      % btpin -a phone -p 334323
     % sdpquery -a phone browse      % sdpquery -a phone browse
   
 will make the initial connection and cause [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current) to store link keys. At this point, you should be paired with the phone and can do:  will make the initial connection and cause
   [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
   to store link keys. At this point, you should be paired with the
   phone and can do:
   
     % rfcomm_sppd -a phone -s DUN -t /dev/ttyp9      % rfcomm_sppd -a phone -s DUN -t /dev/ttyp9
     % cu -l /dev/ttyp9      % cu -l /dev/ttyp9
   
 and find yourself connected to the modem directly. In order to use PPP, you would add the line:  and find yourself connected to the modem directly. In order to use
   PPP, you would add the line:
   
     pty "rfcomm_sppd -a phone -s DUN"      pty "rfcomm_sppd -a phone -s DUN"
   
 to your `/etc/ppp/options` file in place of the normal tty declaration and starting [pppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?pppd+8+NetBSD-current) will cause the link to be created as required.  to your `/etc/ppp/options` file in place of the normal tty declaration
   and starting
 Phones are more complex than HIDs naturally, and you may not need to provide a PIN until later in the process (some wait until a RFCOMM channel is opened before requesting authentication for instance), although the PIN you specify with [btpin(1)](http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-current) will be cached by [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current) for 5 minutes or until used. For NetBSD-current systems after 21 April 2007, it is possible to specify the minimum link mode requirements, see [rfcomm_sppd(1)](http://netbsd.gw.com/cgi-bin/man-cgi?rfcomm_sppd+1+NetBSD-current) for details.  [pppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?pppd+8+NetBSD-current) will
   cause the link to be created as required.
   
 #  SCO Audio Headsets  Phones are more complex than HIDs naturally, and you may not need
   to provide a PIN until later in the process (some wait until a
 **important**: When using SCO Audio with USB devices, you will need to enable isochronous data, and calculate the MTU that the device will use, see [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current) and [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current)  RFCOMM channel is opened before requesting authentication for
   instance), although the PIN you specify with
 Discover the BDADDR and pair with the headset as normal (likely the PIN is "0000", but check your manual to be sure). Attach the [btsco(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-current) device to the system:  [btpin(1)](http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-current)
   will be cached by
   [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
   for 5 minutes or until used. For NetBSD-current systems after 21
   April 2007, it is possible to specify the minimum link mode requirements, see
   [rfcomm_sppd(1)](http://netbsd.gw.com/cgi-bin/man-cgi?rfcomm_sppd+1+NetBSD-current)
   for details.
   
   
   # SCO Audio Headsets
   
   **important**: When using SCO Audio with USB devices, you will need
   to enable isochronous data, and calculate the MTU that the device
   will use, see
   [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current) and
   [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current)
   
   Discover the BDADDR and pair with the headset as normal (likely the
   PIN is "0000", but check your manual to be sure). Attach the
   [btsco(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-current)
   device to the system:
   
     % btconfig ubt0 inquiry      % btconfig ubt0 inquiry
     [...]      [...]
Line 255  which should produce something like this Line 365  which should produce something like this
     btsco0 at bthub0 remote-bdaddr 00:07:a4:23:10:83      btsco0 at bthub0 remote-bdaddr 00:07:a4:23:10:83
     audio1 at btsco0: full duplex      audio1 at btsco0: full duplex
   
 on the system console. In order to utilise the audio device, you will need to open a control connection with [bthset(1)](http://netbsd.gw.com/cgi-bin/man-cgi?bthset+1+NetBSD-current) which conveys volume information to the mixer device. Using -v will let you see what is going on:   on the system console. In order to utilise the audio device, you
   will need to open a control connection with
   [bthset(1)](http://netbsd.gw.com/cgi-bin/man-cgi?bthset+1+NetBSD-current)
   which conveys volume information to the mixer device. Using -v will
   let you see what is going on:
   
     % bthset -m /dev/mixer1 -v      % bthset -m /dev/mixer1 -v
   
 and you should now be able to transfer 8khz samples to/from /dev/audio1 using [audioplay(1)](http://netbsd.gw.com/cgi-bin/man-cgi?audioplay+1+NetBSD-current) and [audiorecord(1)](http://netbsd.gw.com/cgi-bin/man-cgi?audiorecord+1+NetBSD-current). Adjusting the mixer values should work when playing though you may find that when opening a connection the headset will reset the volume to the last known settings. Note that you need to leave _bthset_ running while you use audiorecord or audioplay, so either use two terminal windows or a trailing '&' on the previous command to move it to the background.  and you should now be able to transfer 8khz samples to/from /dev/audio1
   using
   [audioplay(1)](http://netbsd.gw.com/cgi-bin/man-cgi?audioplay+1+NetBSD-current)
   and
   [audiorecord(1)](http://netbsd.gw.com/cgi-bin/man-cgi?audiorecord+1+NetBSD-current).
   Adjusting the mixer values should work when playing though you may
   find that when opening a connection the headset will reset the
   volume to the last known settings. Note that you need to leave
   _bthset_ running while you use audiorecord or audioplay, so either
   use two terminal windows or a trailing '&' on the previous command
   to move it to the background.
   
     % audiorecord -d /dev/audio1 voice.au      % audiorecord -d /dev/audio1 voice.au
 < TALK NONSENSE NOW >  < TALK NONSENSE NOW >
Line 269  and you should now be able to transfer 8 Line 393  and you should now be able to transfer 8
     % audioplay -d /dev/audio1 voice.au      % audioplay -d /dev/audio1 voice.au
 [in the headset!]   [in the headset!] 
   
 You can play with mpg123 and sox to play music (though only in mono), or it should hopefully be fairly easy to make the headset work with a VoIP application, please let me know if you get that working!   You can play with mpg123 and sox to play music (though only in
   mono), or it should hopefully be fairly easy to make the headset
   work with a VoIP application, please let me know if you get that
 #  SCO Audio Handsfree   working!
   
 **important**: When using SCO Audio with USB devices, you will need to enable isochronous data, and calculate the MTU that the device will use, see [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current) and [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current)  
   # SCO Audio Handsfree 
 The method shown above for SCO Audio Headsets also works to give [audio(4)](http://netbsd.gw.com/cgi-bin/man-cgi?audio+4+NetBSD-current) access to the Handsfree profile on a mobile phone (where the phone initiates audio connections), though in practice the [audio(4)][47] device does not quite handle the concept of 'connection lost' which we need. You can configure the 'HF' service with [btdevctl(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-current).  
   **important**: When using SCO Audio with USB devices, you will need
 Alternatively there is a partial implementation of a handsfree profile program that opens a control connection to an Audio Gateway (ie a phone) and copies audio data to and from the system audio device as appropriate. Currently it is shell only and really it would be better with a graphical interface. See [comms/bthfp](http://pkgsrc.se/comms/bthfp)  to enable isochronous data, and calculate the MTU that the device
   will use, see
   [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current) and
 #  OBEX Push/Ftp  [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current)
   
 See the [comms/obexftp](http://pkgsrc.se/comms/obexftp) and [comms/obexapp](http://pkgsrc.se/comms/obexapp) packages in pkgsrc.  The method shown above for SCO Audio Headsets also works to give
   [audio(4)](http://netbsd.gw.com/cgi-bin/man-cgi?audio+4+NetBSD-current)
 #  Why doesn't it work, eh?  access to the Handsfree profile on a mobile phone (where the phone
   initiates audio connections), though in practice the [audio(4)][47]
   1. A NetBSD version of the hcidump program is available in [sysutils/hcidump](http://pkgsrc.se/sysutils/hcidump) and can be very useful to snoop on packets in and out at the device level to find out what is happening when things are not going right.  device does not quite handle the concept of 'connection lost' which
   2. the [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current) program should be running, and logs debugging messages with facility "daemon.debug". See [syslog.conf(5)](http://netbsd.gw.com/cgi-bin/man-cgi?syslog.conf+5+NetBSD-current) for details.  we need. You can configure the 'HF' service with
   3. Dave Tyson has done some excellent testing and found that some devices fail to work unless you set the packet type to 0x0018, which indicates DM1 and DH1 packets only. (I've put that on my list to investigate further, it should not be so)  [btdevctl(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-current).
   4. for device configuration to persist across reboots, you need to add an entry to the `/etc/bluetooth/btdevctl.conf` file and set btdevctl=YES in `/etc/rc.conf`  
   5. to use SCO Audio with USB Bluetooth controllers, the MTU will need to be set. See the CAVEAT section of [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current) for details.  Alternatively there is a partial implementation of a handsfree
   6. Isochronous data is not well supported in some Belkin/Broadcom USB Bluetooth dongles.  profile program that opens a control connection to an Audio Gateway
   7. Isochronous data is not supported on [ehci(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ehci+4+NetBSD-current) USB host controllers.  (ie a phone) and copies audio data to and from the system audio
   8. SCO audio does not work really well with the [bt3c(4)](http://netbsd.gw.com/cgi-bin/man-cgi?bt3c+4+NetBSD-current) device  device as appropriate. Currently it is shell only and really it
   9. some older Belkin/Broadcom USB devices need firmware loaded before they will work. See the [sysutils/bcmfw](http://pkgsrc.se/sysutils/bcmfw) package.  would be better with a graphical interface. See
   [comms/bthfp](http://pkgsrc.se/comms/bthfp)
   
   
   # OBEX Push/Ftp
   
   See the [comms/obexftp](http://pkgsrc.se/comms/obexftp) and
   [comms/obexapp](http://pkgsrc.se/comms/obexapp) packages in pkgsrc.
   
   # Why doesn't it work, eh?
   
   1. A NetBSD version of the hcidump program is available in
      [sysutils/hcidump](http://pkgsrc.se/sysutils/hcidump) and can
      be very useful to snoop on packets in and out at the device level
      to find out what is happening when things are not going right.
   2. the
      [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
      program should be running, and logs debugging messages with
      facility "daemon.debug". See
      [syslog.conf(5)](http://netbsd.gw.com/cgi-bin/man-cgi?syslog.conf+5+NetBSD-current)
      for details.
   3. Dave Tyson has done some excellent testing and found that some
      devices fail to work unless you set the packet type to 0x0018,
      which indicates DM1 and DH1 packets only. (I've put that on my
      list to investigate further, it should not be so)
   4. for device configuration to persist across reboots, you need to
      add an entry to the `/etc/bluetooth/btdevctl.conf` file and set
      btdevctl=YES in `/etc/rc.conf`
   5. to use SCO Audio with USB Bluetooth controllers, the MTU will
      need to be set. See the CAVEAT section of
      [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current)
      for details.
   6. Isochronous data is not well supported in some Belkin/Broadcom
      USB Bluetooth dongles.
   7. Isochronous data is not supported on
      [ehci(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ehci+4+NetBSD-current) USB
      host controllers.
   8. SCO audio does not work really well with the
      [bt3c(4)](http://netbsd.gw.com/cgi-bin/man-cgi?bt3c+4+NetBSD-current)
      device
   9. some older Belkin/Broadcom USB devices need firmware loaded
      before they will work. See the
      [sysutils/bcmfw](http://pkgsrc.se/sysutils/bcmfw) package.
   
 #  References  # References
   
   * [Bluetooth Imported.](http://mail-index.netbsd.org/current-users/2006/06/19/0022.html)  * [Bluetooth Imported.](http://mail-index.netbsd.org/current-users/2006/06/19/0022.html)
   * [bthfp source.](http://homepages.rya-online.net/plunky/bthfp-0.1.tar.gz)  * [bthfp source.](http://homepages.rya-online.net/plunky/bthfp-0.1.tar.gz)

Removed from v.1.2  
changed lines
  Added in v.1.3


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb