Annotation of wikisrc/bluetooth.mdwn, revision 1.3

1.2       wiki        1: Bluetooth is available since version 4 of NetBSD.
1.1       mspo        2: 
                      3: **Contents**
                      4: 
                      5: [[!toc]]
                      6: 
                      7: 
1.3     ! schmonz     8: # Background
1.1       mspo        9: 
1.3     ! schmonz    10: Bluetooth is a digital radio protocol used for short range and low
        !            11: power communications. NetBSD 4.0 introduced support for the Bluetooth
        !            12: protocol stack, and some integration of device profiles into the
        !            13: NetBSD device framework.
        !            14: 
        !            15: The lower layers of the Bluetooth protocol stack pertaining to
        !            16: actual radio links between devices are handled inside the Bluetooth
        !            17: Controller, which communicates with the Host computer using the
        !            18: Host Controller Interface (HCI) protocol which can be accessed via
        !            19: a raw packet BTPROTO_HCI socket interface.
        !            20: 
        !            21: The lowest useable protocol is the Link Layer Control and Adaptation
        !            22: Protocol (L2CAP), which can be accessed via a BTPROTO_L2CAP socket
        !            23: interface. This provides sequential packet access to remote devices,
        !            24: with up to 64k channels per radio link. When an L2CAP channel is
        !            25: opened, the protocol or service that is required is identified by
        !            26: a Protocol/Service Multiplexer (PSM) value.
        !            27: 
        !            28: One available protocol is RFCOMM, which provides up to 30 emulated
        !            29: serial connections multiplexed over a single L2CAP channel. This
        !            30: streamed data protocol can be accessed using the BTPROTO_RFCOMM
        !            31: socket interface though it is planned to also provide a direct tty
        !            32: interface later. Typically, many services use RFCOMM links to provide
        !            33: a control interface using the AT command set.
        !            34: 
        !            35: Isochronous (SCO) Audio connections may be created on a baseband
        !            36: radio link using either the BTPROTO_SCO socket interface, or the
        !            37: [btsco(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-current)
        !            38: audio device driver. While the specification says that up to three
        !            39: such links can be made between devices, the current Bluetooth code
        !            40: can only handle one with any dignity.
        !            41: 
        !            42: Support for Human Interface Devices, which operate using the USB
        !            43: HID protocol over a pair of L2CAP channels is provided by the
        !            44: [bthidev(4)](http://netbsd.gw.com/cgi-bin/man-cgi?bthidev+4+NetBSD-current)
        !            45: driver. Currently, keyboards and mice are catered for, and attach to
        !            46: [wscons(4)](http://netbsd.gw.com/cgi-bin/man-cgi?wscons+4+NetBSD-current)
        !            47: as normal.
        !            48: 
        !            49: Service Discovery in the Bluetooth environment is made available
        !            50: by
        !            51: [libsdp(3)](http://netbsd.gw.com/cgi-bin/man-cgi?libsdp+3+NetBSD-current)
        !            52: and the
        !            53: [sdpd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?sdpd+8+NetBSD-current)
        !            54: daemon (both ported from FreeBSD), which allows programs to register
        !            55: services and makes the information available to remote devices
        !            56: performing queries. Limited querying can be done with the
        !            57: [sdpquery(1)](http://netbsd.gw.com/cgi-bin/man-cgi?sdpquery+1+NetBSD-current)
        !            58: program.
        !            59: 
        !            60: Security on Bluetooth links is supplied by encryption and authentication
        !            61: options. In NetBSD-4.0, these can only be applied to all baseband
        !            62: links that a controller makes, by
        !            63: [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current).
        !            64: For NetBSD-current versions after 21 April 2007, L2CAP and RFCOMM
        !            65: connections may additionally specify a minimum link mode for the
        !            66: baseband link which is applied during connection establishment.
        !            67: When authentication is requested, a PIN is presented by each side,
        !            68: generally entered by the operator (some limited input devices have
        !            69: a fixed PIN). The controller uses this PIN to generate a Link Key
        !            70: and reports this to the host computer and will ask for it to
        !            71: authenticate subsequent connections. On NetBSD, the
        !            72: [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
        !            73: daemon is responsible for storing these and responding to Link Key
        !            74: requests, and also provides an interface to allow users to specify
        !            75: a PIN with a PIN client, such as
        !            76: [btpin(1)](http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-current) or
        !            77: [sysutils/btpin-qt](http://pkgsrc.se/sysutils/btpin-qt).
        !            78: 
        !            79: 
        !            80: # Requirements
        !            81: 
        !            82: The relevant device declarations are included in the GENERIC kernel
        !            83: configurations for the following architectures:
        !            84: 
        !            85: * alpha
        !            86: * amd64
        !            87: * i386
        !            88: * sparc64
        !            89: 
        !            90: For other architectures, you will need to add the device declarations
        !            91: to your kernel config file. Bluetooth should work on any architecture
        !            92: that has USB and/or PCMCIA available.
        !            93: 
        !            94: Please notice that you will need NetBSD 4.0 or higher to use
        !            95: bluetooth. Since 4.0 is tagged BETA as of August 31, you will need
        !            96: a fairly current kernel. To build a current kernel, please read
        !            97: [[How to build NetBSD-current]].
        !            98: 
        !            99: If you are looking to purchase a Bluetooth controller for use with
        !           100: NetBSD, the better devices are USB based, and a v2.0 device is
        !           101: better than v1.2. The Class of the device indicates the power of
        !           102: the radio - Class 1 is 100m and Class 2 is 10m.
1.1       mspo      103: 
                    104: 
1.3     ! schmonz   105: # Hardware
1.1       mspo      106: 
1.3     ! schmonz   107: If Bluetooth is configured in your kernel, you should see Bluetooth
        !           108: controllers showing up in your boot messages, for example:
1.1       mspo      109: 
1.2       wiki      110:     bt3c0 at pcmcia0 function 0: <3COM, 3CRWB60-A, Bluetooth PC Card>
                    111:     ubt0 at uhub1 port 4 configuration 1 interface 0
                    112:     ubt0: Cambridge Silicon Radio Bluetooth USB Adapter, rev 2.00/19.58, addr 4
                    113:     ubt1 at uhub1 port 2 configuration 1 interface 0
                    114:     ubt1: Broadcom Belkin Bluetooth Device, rev 1.10/0.01, addr 5
1.1       mspo      115: 
1.3     ! schmonz   116: Some PCMCIA and Cardbus devices will attach as serial devices, and
        !           117: they need to be configured to use the
        !           118: [btuart(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btuart+4+NetBSD-current)
        !           119: line discipline to interface to the Bluetooth protocol stack.
1.1       mspo      120: 
                    121: 
1.3     ! schmonz   122: # Userland configuration
1.1       mspo      123: 
1.3     ! schmonz   124: Please edit your
        !           125: [rc.conf(5)](http://netbsd.gw.com/cgi-bin/man-cgi?rc.conf+5+NetBSD-current)
        !           126: file and ensure it contains:
1.1       mspo      127: 
1.2       wiki      128:     # configure bluetooth controllers
                    129:     btconfig=YES
                    130:     btconfig_args="up pscan switch class 0x02010c"
1.1       mspo      131:     
1.2       wiki      132:     # configure bluetooth devices
                    133:     btdevctl=YES
1.1       mspo      134:     
1.2       wiki      135:     # start bluetooth key daemon
                    136:     bthcid=YES
1.1       mspo      137:     
1.2       wiki      138:     # start service discovery daemon
                    139:     sdpd=YES
1.1       mspo      140: 
1.3     ! schmonz   141: > i had to add 'auth' to the `btconfig_args` line to get my phone
        !           142: > to pair. --[[Jasper]] 22:50, 15 September 2006 (CEST)
1.1       mspo      143: 
1.3     ! schmonz   144: > sdpd runs as (user:group) _sdpd:_sdpd, but these are not present
        !           145: > in 4.0 -- PR
        !           146: > [bin/37125](http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=37125)
        !           147: > --[[Shattered]] 14:53, 10 April 2008 (CEST)
1.1       mspo      148: 
1.2       wiki      149: which should be ok. Reboot or enter:
1.1       mspo      150: 
1.2       wiki      151:     /etc/rc.d/btconfig start
                    152:     /etc/rc.d/bthcid start
                    153:     /etc/rc.d/sdpd start
1.1       mspo      154: 
1.2       wiki      155: and you should be able to see that your device is configured, e.g:
1.1       mspo      156: 
1.2       wiki      157:     % btconfig -vvvv ubt0
                    158:         ubt0: bdaddr 00:08:1b:8d:ba:6d flags 0x3<UP,RUNNING>
                    159:         num_cmd = 1
                    160:         num_acl = 8, acl_mtu = 384
                    161:         num_sco = 8, sco_mtu = 64
                    162:         class: [0x02010c] Laptop Computer <Networking>
                    163:         name: "CSR - bc4"
                    164:         voice: [0x0060]
                    165:         Input Coding: Linear PCM [16-bit, pos 0], 2's complement
                    166:         Air Coding: CVSD
                    167:         pin: variable
                    168:         options: -iscan pscan -auth -encrypt switch -hold sniff -park
                    169:         ptype: [0xcc18] DM1 DH1 DM3 DH3 DM5 DH5 2-DH1 3-DH1 2-DH3 3-DH3 2-DH5 3-DH5
                    170:         page timeout: 5120 ms
                    171:         features: <3 slot> <5 slot> <encryption> <slot offset> <timing accuracy>
                    172:         <role switch> <hold mode> <sniff mode> <park mode> <RSSI> <channel quality>
                    173:         <SCO link> <HV2> <HV3> <mu-Law log> <A-Law log> <CVSD data> <paging parameter>
                    174:         <power control> <transparent SCO> <broadcast encryption> <EDR ACL 2Mbps>
                    175:         <EDR ACL 3Mbps> <enhanced inquiry scan> <interlaced inquiry scan>
                    176:         <interlaced page scan> <RSSI with inquiry result> <EV3 packets>
                    177:         <EV4 packets> <EV5 packets> <AFH capable slave> <AFH class slave>
                    178:         <3 slot EDR ACL> <5 slot EDR ACL> <AFH capable master> <AFH class master>
                    179:         <EDR eSCO 2Mbps> <EDR eSCO 3Mbps> <3 slot EDR eSCO> <extended features>
1.1       mspo      180: 
                    181: 
1.3     ! schmonz   182: # HID configuration
1.1       mspo      183: 
1.3     ! schmonz   184: **Very important**:
        !           185: [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
        !           186: must be running.
1.1       mspo      187: 
1.3     ! schmonz   188: **Important**: [sysutils/hcidump](http://pkgsrc.se/sysutils/hcidump)
        !           189: is very useful.
1.1       mspo      190: 
1.2       wiki      191: Place device into discoverable mode, and peform an inquiry: 
1.1       mspo      192: 
1.2       wiki      193:     % btconfig ubt0 inquiry
                    194:     Device Discovery from device: ubt0 .... 1 response
                    195:       1: bdaddr 00:0a:95:10:8d:8c (unknown)
                    196:        : name "Apple Wireless Mouse"
                    197:        : class [0x002580] Peripheral Mouse <Limited Discoverable>
                    198:        : page scan rep mode 0x01
                    199:        : page scan period mode 0x00
                    200:        : page scan mode 0x00
                    201:        : clock offset 30537
1.1       mspo      202: 
1.3     ! schmonz   203: which should get you the BDADDR of the device. for ease of use you
        !           204: might want to add this to `/etc/bluetooth/hosts` so you can refer
        !           205: to it by name:
1.1       mspo      206: 
1.2       wiki      207:     00:0a:95:10:8d:8c  mouse
1.1       mspo      208: 
1.3     ! schmonz   209: And now, you should be able to query the device. You will likely
        !           210: need to pair with it first which will happen the first time you
        !           211: connect, so set the PIN (which is probably 0000 for limited input
        !           212: devices but see the manual to be sure):
1.1       mspo      213: 
1.2       wiki      214:     % btpin -a mouse -p 0000
                    215:     % btdevctl -a mouse -d ubt0 -s hid
                    216:     local bdaddr: 00:04:76:e1:4a:f5
                    217:     remote bdaddr: 00:0a:95:10:8d:8c
                    218:     link mode: auth
                    219:     device type: bthidev
                    220:     control psm: 0x0011
                    221:     interrupt psm: 0x0013
                    222:     Collection page=Generic_Desktop usage=Mouse
                    223:     Collection page=Generic_Desktop usage=Pointer
                    224:       Input id=2 size=1 count=1 page=Button usage=Button_1 Variable, logical range 0..1
                    225:       Input id=2 size=7 count=1 page=0x0000 usage=0x0000 Const, logical range 0..1
                    226:       Input id=2 size=8 count=1 page=Generic_Desktop usage=X Variable Relative, logical range -127..127
                    227:       Input id=2 size=8 count=1 page=Generic_Desktop usage=Y Variable Relative, logical range -127..127
                    228:     Feature id=71 size=8 count=1 page=0x0006 usage=0x0020 Variable NoPref, logical range 0..100
                    229:     End collection
                    230:     End collection
1.1       mspo      231: 
1.2       wiki      232: Then try to attach it to the system:
1.1       mspo      233: 
1.2       wiki      234:     % btdevctl -a mouse -d ubt0 -s hid -A
1.1       mspo      235: 
1.3     ! schmonz   236: which should attach the mouse to the system and attempt to open a
        !           237: bluetooth connection for it. You should see something like:
1.1       mspo      238: 
1.2       wiki      239:     bthidev0 at bthub0 remote-bdaddr 00:0a:95:10:8d:8c link-mode auth
                    240:     btms0 at bthidev0 reportid 2: 1 button.
                    241:     wsmouse2 at btms0 mux 0
                    242:     bthidev0: connected
                    243: 
                    244: on the console, and the mouse should work.
                    245: 
1.3     ! schmonz   246: Keyboards are only a little more complex, in that you will need to
        !           247: enter the PIN onto the keyboard before you can pair. This will be
        !           248: done at the point where you are opening the first connection, eg:
1.2       wiki      249: 
                    250:     % btpin -a keyboard -r
                    251:     PIN: 3537
                    252:     % btdevctl -a keyboard -d ubt0 -s hid -A -v
1.1       mspo      253: 
                    254: < ENTER PIN ON BLUETOOTH KEYBOARD NOW >
                    255: 
1.2       wiki      256:     local bdaddr: 00:04:76:e1:4a:f5
                    257:     remote bdaddr: 00:0a:95:45:a4:a0
                    258:     link mode: encrypt
                    259:     device type: bthidev
                    260:     control psm: 0x0011
                    261:     interrupt psm: 0x0013
                    262:     Collection page=Generic_Desktop usage=Keyboard
                    263:       Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftControl Variable, logical range 0..1
                    264:       Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftShift Variable, logical range 0..1
                    265:       Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftAlt Variable, logical range 0..1
                    266:       Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_Left_GUI Variable, logical range 0..1
                    267:       Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_RightControl Variable, logical range 0..1
                    268:       Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_RightShift Variable, logical range 0..1
                    269:       Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_RightAlt Variable, logical range 0..1
                    270:       Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_Right_GUI Variable, logical range 0..1
                    271:       Input id=1 size=8 count=1 page=0x0000 usage=0x0000 Const, logical range 0..1
                    272:      Output id=1 size=1 count=1 page=LEDs usage=Num_Lock Variable, logical range 0..1
                    273:      Output id=1 size=1 count=1 page=LEDs usage=Caps_Lock Variable, logical range 0..1
                    274:      Output id=1 size=1 count=1 page=LEDs usage=Scroll_Lock Variable, logical range 0..1
                    275:      Output id=1 size=1 count=1 page=LEDs usage=Compose Variable, logical range 0..1
                    276:      Output id=1 size=1 count=1 page=LEDs usage=Kana Variable, logical range 0..1
                    277:      Output id=1 size=3 count=1 page=0x0000 usage=0x0000 Const, logical range 0..1
                    278:       Input id=1 size=8 count=6 page=Keyboard usage=No_Event, logical range 0..255
                    279:       Input id=1 size=1 count=1 page=Consumer usage=Eject Variable Relative, logical range 0..1
                    280:       Input id=1 size=1 count=1 page=Consumer usage=Mute Variable Relative, logical range 0..1
                    281:       Input id=1 size=1 count=1 page=Consumer usage=Volume_Up Variable, logical range 0..1
                    282:       Input id=1 size=1 count=1 page=Consumer usage=Volume_Down Variable, logical range 0..1
                    283:       Input id=1 size=1 count=4 page=0x0000 usage=0x0000 Const, logical range 0..1
                    284:     End collection
                    285: 
                    286: And you see something like this on the console: 
                    287: 
                    288:     bthidev0 at bthub0 remote-bdaddr 00:0a:95:45:a4:a0 link-mode encrypt
                    289:     btkbd0 at bthidev0 reportid 1
                    290:     wskbd1 at btkbd0 mux 1
                    291:     wskbd1: connecting to wsdisplay0
                    292:     bthidev0: connected
1.1       mspo      293: 
1.3     ! schmonz   294: By default, on NetBSD systems that support it,
        !           295: [btdevctl(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-current)
        !           296: will request authentication for the baseband link, or encryption
        !           297: if the HID is a keyboard.
1.1       mspo      298: 
                    299: 
1.3     ! schmonz   300: # Serial connections
1.1       mspo      301: 
1.3     ! schmonz   302: **See
        !           303: [rfcomm_sppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?rfcomm_sppd+8+NetBSD-current)**
1.1       mspo      304: 
1.2       wiki      305: Set the phone into discoverable mode:
1.1       mspo      306: 
1.2       wiki      307:     % btconfig ubt0 inq
1.1       mspo      308: 
1.2       wiki      309: add alias to `/etc/bluetooth/hosts`, then:
1.1       mspo      310: 
1.2       wiki      311:     % btpin -a phone -p 334323
                    312:     % sdpquery -a phone browse
1.1       mspo      313: 
1.3     ! schmonz   314: will make the initial connection and cause
        !           315: [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
        !           316: to store link keys. At this point, you should be paired with the
        !           317: phone and can do:
1.1       mspo      318: 
1.2       wiki      319:     % rfcomm_sppd -a phone -s DUN -t /dev/ttyp9
                    320:     % cu -l /dev/ttyp9
1.1       mspo      321: 
1.3     ! schmonz   322: and find yourself connected to the modem directly. In order to use
        !           323: PPP, you would add the line:
1.1       mspo      324: 
1.2       wiki      325:     pty "rfcomm_sppd -a phone -s DUN"
1.1       mspo      326: 
1.3     ! schmonz   327: to your `/etc/ppp/options` file in place of the normal tty declaration
        !           328: and starting
        !           329: [pppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?pppd+8+NetBSD-current) will
        !           330: cause the link to be created as required.
        !           331: 
        !           332: Phones are more complex than HIDs naturally, and you may not need
        !           333: to provide a PIN until later in the process (some wait until a
        !           334: RFCOMM channel is opened before requesting authentication for
        !           335: instance), although the PIN you specify with
        !           336: [btpin(1)](http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-current)
        !           337: will be cached by
        !           338: [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
        !           339: for 5 minutes or until used. For NetBSD-current systems after 21
        !           340: April 2007, it is possible to specify the minimum link mode requirements, see
        !           341: [rfcomm_sppd(1)](http://netbsd.gw.com/cgi-bin/man-cgi?rfcomm_sppd+1+NetBSD-current)
        !           342: for details.
        !           343: 
        !           344: 
        !           345: # SCO Audio Headsets
        !           346: 
        !           347: **important**: When using SCO Audio with USB devices, you will need
        !           348: to enable isochronous data, and calculate the MTU that the device
        !           349: will use, see
        !           350: [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current) and
        !           351: [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current)
        !           352: 
        !           353: Discover the BDADDR and pair with the headset as normal (likely the
        !           354: PIN is "0000", but check your manual to be sure). Attach the
        !           355: [btsco(4)](http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-current)
        !           356: device to the system:
1.1       mspo      357: 
1.2       wiki      358:     % btconfig ubt0 inquiry
                    359:     [...]
                    360:     % btpin -a headset -p 0000
                    361:     % btdevctl -a headset -d ubt0 -s hset -A
1.1       mspo      362: 
                    363: which should produce something like this: 
                    364: 
1.2       wiki      365:     btsco0 at bthub0 remote-bdaddr 00:07:a4:23:10:83
                    366:     audio1 at btsco0: full duplex
1.1       mspo      367: 
1.3     ! schmonz   368: on the system console. In order to utilise the audio device, you
        !           369: will need to open a control connection with
        !           370: [bthset(1)](http://netbsd.gw.com/cgi-bin/man-cgi?bthset+1+NetBSD-current)
        !           371: which conveys volume information to the mixer device. Using -v will
        !           372: let you see what is going on:
1.1       mspo      373: 
1.2       wiki      374:     % bthset -m /dev/mixer1 -v
1.1       mspo      375: 
1.3     ! schmonz   376: and you should now be able to transfer 8khz samples to/from /dev/audio1
        !           377: using
        !           378: [audioplay(1)](http://netbsd.gw.com/cgi-bin/man-cgi?audioplay+1+NetBSD-current)
        !           379: and
        !           380: [audiorecord(1)](http://netbsd.gw.com/cgi-bin/man-cgi?audiorecord+1+NetBSD-current).
        !           381: Adjusting the mixer values should work when playing though you may
        !           382: find that when opening a connection the headset will reset the
        !           383: volume to the last known settings. Note that you need to leave
        !           384: _bthset_ running while you use audiorecord or audioplay, so either
        !           385: use two terminal windows or a trailing '&' on the previous command
        !           386: to move it to the background.
1.1       mspo      387: 
1.2       wiki      388:     % audiorecord -d /dev/audio1 voice.au
1.1       mspo      389: < TALK NONSENSE NOW >
1.2       wiki      390:     ^C
                    391:     % audioplay -d /dev/audio voice.au
1.1       mspo      392: [gosh, do I really sound like that?] 
1.2       wiki      393:     % audioplay -d /dev/audio1 voice.au
1.1       mspo      394: [in the headset!] 
                    395: 
1.3     ! schmonz   396: You can play with mpg123 and sox to play music (though only in
        !           397: mono), or it should hopefully be fairly easy to make the headset
        !           398: work with a VoIP application, please let me know if you get that
        !           399: working!
        !           400: 
        !           401: 
        !           402: # SCO Audio Handsfree 
        !           403: 
        !           404: **important**: When using SCO Audio with USB devices, you will need
        !           405: to enable isochronous data, and calculate the MTU that the device
        !           406: will use, see
        !           407: [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current) and
        !           408: [btconfig(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-current)
        !           409: 
        !           410: The method shown above for SCO Audio Headsets also works to give
        !           411: [audio(4)](http://netbsd.gw.com/cgi-bin/man-cgi?audio+4+NetBSD-current)
        !           412: access to the Handsfree profile on a mobile phone (where the phone
        !           413: initiates audio connections), though in practice the [audio(4)][47]
        !           414: device does not quite handle the concept of 'connection lost' which
        !           415: we need. You can configure the 'HF' service with
        !           416: [btdevctl(8)](http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-current).
        !           417: 
        !           418: Alternatively there is a partial implementation of a handsfree
        !           419: profile program that opens a control connection to an Audio Gateway
        !           420: (ie a phone) and copies audio data to and from the system audio
        !           421: device as appropriate. Currently it is shell only and really it
        !           422: would be better with a graphical interface. See
        !           423: [comms/bthfp](http://pkgsrc.se/comms/bthfp)
        !           424: 
        !           425: 
        !           426: # OBEX Push/Ftp
        !           427: 
        !           428: See the [comms/obexftp](http://pkgsrc.se/comms/obexftp) and
        !           429: [comms/obexapp](http://pkgsrc.se/comms/obexapp) packages in pkgsrc.
        !           430: 
        !           431: # Why doesn't it work, eh?
        !           432: 
        !           433: 1. A NetBSD version of the hcidump program is available in
        !           434:    [sysutils/hcidump](http://pkgsrc.se/sysutils/hcidump) and can
        !           435:    be very useful to snoop on packets in and out at the device level
        !           436:    to find out what is happening when things are not going right.
        !           437: 2. the
        !           438:    [bthcid(8)](http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-current)
        !           439:    program should be running, and logs debugging messages with
        !           440:    facility "daemon.debug". See
        !           441:    [syslog.conf(5)](http://netbsd.gw.com/cgi-bin/man-cgi?syslog.conf+5+NetBSD-current)
        !           442:    for details.
        !           443: 3. Dave Tyson has done some excellent testing and found that some
        !           444:    devices fail to work unless you set the packet type to 0x0018,
        !           445:    which indicates DM1 and DH1 packets only. (I've put that on my
        !           446:    list to investigate further, it should not be so)
        !           447: 4. for device configuration to persist across reboots, you need to
        !           448:    add an entry to the `/etc/bluetooth/btdevctl.conf` file and set
        !           449:    btdevctl=YES in `/etc/rc.conf`
        !           450: 5. to use SCO Audio with USB Bluetooth controllers, the MTU will
        !           451:    need to be set. See the CAVEAT section of
        !           452:    [ubt(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-current)
        !           453:    for details.
        !           454: 6. Isochronous data is not well supported in some Belkin/Broadcom
        !           455:    USB Bluetooth dongles.
        !           456: 7. Isochronous data is not supported on
        !           457:    [ehci(4)](http://netbsd.gw.com/cgi-bin/man-cgi?ehci+4+NetBSD-current) USB
        !           458:    host controllers.
        !           459: 8. SCO audio does not work really well with the
        !           460:    [bt3c(4)](http://netbsd.gw.com/cgi-bin/man-cgi?bt3c+4+NetBSD-current)
        !           461:    device
        !           462: 9. some older Belkin/Broadcom USB devices need firmware loaded
        !           463:    before they will work. See the
        !           464:    [sysutils/bcmfw](http://pkgsrc.se/sysutils/bcmfw) package.
1.1       mspo      465: 
1.3     ! schmonz   466: # References
1.1       mspo      467: 
1.3     ! schmonz   468: * [Bluetooth Imported.](http://mail-index.netbsd.org/current-users/2006/06/19/0022.html)
        !           469: * [bthfp source.](http://homepages.rya-online.net/plunky/bthfp-0.1.tar.gz)

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