[BACK]Return to chap-bluetooth.html CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / htdocs / docs / guide / en

File: [cvs.NetBSD.org] / htdocs / docs / guide / en / chap-bluetooth.html (download) (as text)

Revision 1.24, Sun Feb 1 23:42:37 2015 UTC (9 years, 2 months ago) by snj
Branch: MAIN
Changes since 1.23: +1 -1 lines

regen

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter1. Âluetooth on NetBSD</title>
<link rel="stylesheet" type="text/css" href="/global.css">
<meta name="generator" content="DocBook XSL Stylesheets VX.X.X">
<link rel="home" href="index.html" title="The NetBSD Guide">
<link rel="up" href="part-config.html" title="Part ÉII. Óystem configuration, administration and tuning">
<link rel="prev" href="chap-veriexec.html" title="Chapter0. ÎetBSD Veriexec subsystem">
<link rel="next" href="chap-misc.html" title="Chapter2. Íiscellaneous operations">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Chapter1. Âluetooth on NetBSD</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="chap-veriexec.html">Prev</a>/td>
<th width="60%" align="center">Part ÉII. Óystem configuration, administration and tuning</th>
<td width="20%" align="right">a accesskey="n" href="chap-misc.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
<a name="chap-bluetooth"></a>Chapter1. Âluetooth on NetBSD</h2></div></div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-intro">21.1. Introduction</a></span></dt>
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-hardware">21.2. Supported Hardware</a></span></dt>
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-config">21.3. System Configuration</a></span></dt>
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-hid">21.4. Human Interface Devices</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="chap-bluetooth.html#chap-bluetooth-hid-mouse">21.4.1. Mice</a></span></dt>
<dt><span class="sect2"><a href="chap-bluetooth.html#chap-bluetooth-hid-keyboard">21.4.2. Keyboards</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-networking">21.5. Personal Area Networking</a></span></dt>
<dd><dl><dt><span class="sect2"><a href="chap-bluetooth.html#chap-bluetooth-networking-panu">21.5.1. Personal Area Networking User</a></span></dt></dl></dd>
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-serial">21.6. Serial Connections</a></span></dt>
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-audio">21.7. Audio</a></span></dt>
<dd><dl>
<dt><span class="sect2"><a href="chap-bluetooth.html#chap-bluetooth-audio-headset">21.7.1. SCO Audio Headsets</a></span></dt>
<dt><span class="sect2"><a href="chap-bluetooth.html#chap-bluetooth-audio-handsfree">21.7.2. SCO Audio Handsfree</a></span></dt>
</dl></dd>
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-obex">21.8. Object Exchange</a></span></dt>
<dt><span class="sect1"><a href="chap-bluetooth.html#chap-bluetooth-trouble">21.9. Troubleshooting</a></span></dt>
</dl>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-intro"></a>21.1. Éntroduction</h2></div></div></div>
<p>
      Bluetooth is a digital radio protocol used for short range
      and low power communications. NetBSD includes support
      for the Bluetooth protocol stack, and some integration of
      service profiles into the NetBSD device framework.
    </p>
<p>
      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 <span class="quote">&#8220;<span class="quote">Host Controller Interface</span>&#8221;</span> (HCI)
      protocol which can be accessed via a raw packet BTPROTO_HCI
      socket interface.
    </p>
<p>
      Most of the Bluetooth protocols or services layer atop the
      <span class="quote">&#8220;<span class="quote">Link Layer Control and Adaptation Protocol</span>&#8221;</span>
      (L2CAP), which can be accessed via a BTPROTO_L2CAP socket
      interface. This provides sequential packet connections to
      remote devices, with up to 64k channels. When an L2CAP
      channel is opened, the protocol or service that is required
      is identified by a <span class="quote">&#8220;<span class="quote">Protocol/Service Multiplexer</span>&#8221;</span>
      (PSM) value.
    </p>
<p>
      Service Discovery in the Bluetooth environment is provided for
      by the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?sdp+3+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">sdp</span>(3)</span></a> library functions and the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?sdpd+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">sdpd</span>(8)</span></a> daemon,
      which keeps a database of locally registered services and makes
      the information available to remote devices performing queries.
      The <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?sdpquery+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">sdpquery</span>(1)</span></a> tool can be used to query local and remote
      service databases.
    </p>
<p>
      Security on Bluetooth links can be enabled by encryption and
      authentication options to <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btconfig</span>(8)</span></a> which apply to all
      baseband links that a controller makes, or encryption and
      authentication can be enabled for individual RFCOMM and L2CAP
      links as required. 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
      which may be asked to produce it to authenticate subsequent
      connections. On NetBSD, the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bthcid</span>(8)</span></a> daemon is
      responsible for storing link keys and responding to Link Key
      Requests, and also provides an interface to allow unprivileged
      users to specify a PIN with a PIN client, such as
      <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btpin</span>(1)</span></a>.
    </p>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-hardware"></a>21.2. Óupported Hardware</h2></div></div></div>
<p>
      Because Bluetooth controllers normally use the standard
      HCI protocol as specified in the <span class="quote">&#8220;<span class="quote">Bluetooth 2.0
      Core</span>&#8221;</span> documentation to communicate with the host,
      the NetBSD Bluetooth stack is compatible with most controllers,
      only requiring an interface driver, with the following drivers
      available in NetBSD 5.0:
    </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
          <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bcsp+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bcsp</span>(4)</span></a> provides a <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?tty+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">tty</span>(4)</span></a> line discipline to send
          and receive BlueCore Serial Protocol packets over a serial
          line as described in the <span class="quote">&#8220;<span class="quote">BlueCore Serial Protocol
          (BCSP)</span>&#8221;</span> specification.
        </p></li>
<li class="listitem"><p>
          <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bt3c+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bt3c</span>(4)</span></a> provides an interface to the 3Com
          Bluetooth PC Card, model 3CRWB6096-A.
        </p></li>
<li class="listitem"><p>
          <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btbc+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btbc</span>(4)</span></a> provides support for the AnyCom BlueCard
          (LSE041, LSE039, LSE139) PCMCIA devices.
        </p></li>
<li class="listitem"><p>
          <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btuart+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btuart</span>(4)</span></a> provides a <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?tty+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">tty</span>(4)</span></a> line discipline to
          send and receive Bluetooth packets over a serial line as
          described in the <span class="quote">&#8220;<span class="quote">Bluetooth Host Controller Interface
          [Transport Layer] specification, Vol 4 part A</span>&#8221;</span>.
        </p></li>
<li class="listitem"><p>
          <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?sbt+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">sbt</span>(4)</span></a> provides support for Secure Digital IO
	  Bluetooth adapters.
        </p></li>
<li class="listitem"><p>
          <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">ubt</span>(4)</span></a> interfaces to all USB Bluetooth
          controllers conforming to the <span class="quote">&#8220;<span class="quote">HCI USB Transport
          Layer</span>&#8221;</span> specification.
        </p></li>
</ul></div>
<p>
      If support for the NetBSD Bluetooth stack is enabled in the
      kernel, autoconfiguration messages will show up in the
      <span class="command"><strong>dmesg</strong></span> output, for example:
    </p>
<pre class="screen">
bt3c0 at pcmcia0 function 0: &lt;3COM, 3CRWB60-A, Bluetooth PC Card&gt;

ubt0 at uhub1 port 4 configuration 1 interface 0
ubt0: Cambridge Silicon Radio Bluetooth USB Adapter, rev 2.00/19.58, addr 4

ubt1 at uhub1 port 2 configuration 1 interface 0
ubt1: Broadcom Belkin Bluetooth Device, rev 1.10/0.01, addr 5
    </pre>
<p>
      When support is not already compiled in, it can be added to
      the kernel configuration file for any platform that supports
      USB and/or PCMCIA (see <a class="xref" href="chap-tuning.html#tuning-kernel" title="19.9. Ëernel Tuning">Section9.9, &#8220;Kernel Tuning&#8221;</a>),
      using the following declarations, as required:
    </p>
<pre class="screen">
# Bluetooth Controller and Device support

pseudo-device   bcsp                   # BlueCore Serial Protocol
pseudo-device   btuart                 # Bluetooth HCI UART

# Bluetooth PCMCIA Controllers
bt3c* at pcmcia? function ?             # 3Com 3CRWB6096-A
btbc* at pcmcia? function ?             # AnyCom BlueCard LSE041/039/139

# Bluetooth SDIO Controllers
sbt* at sdmmc?

# Bluetooth USB Controllers
ubt* at uhub? port ?

# Bluetooth Device Hub
bthub* at bcsp?
bthub* at bt3c?
bthub* at btbc?
bthub* at btuart?
bthub* at sbt?
bthub* at ubt?

# Bluetooth HID support
bthidev* at bthub?

# Bluetooth Mouse
btms* at bthidev? reportid ?
wsmouse* at btms? mux 0

# Bluetooth Keyboard
btkbd* at bthidev? reportid ?
wskbd* at btkbd? console ? mux 1

# Bluetooth Audio support
btsco* at bthub?
    </pre>
<p>
      Some older USB Bluetooth dongles based on the Broadcom
      BCM2033 chip require firmware to be loaded before they can
      function, and these devices will be attached to <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?ugen+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">ugen</span>(4)</span></a>.
      Use the <span class="quote">&#8220;<span class="quote">sysutils/bcmfw</span>&#8221;</span> package from the NetBSD
      Package Collection, to load firmware and enable these.
    </p>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-config"></a>21.3. Óystem Configuration</h2></div></div></div>
<p>
      To fully enable Bluetooth services on NetBSD, the following
      line should be added to the <code class="filename">/etc/rc.conf</code>
      file.
    </p>
<pre class="screen">
<code class="varname">bluetooth=YES</code>
    </pre>
<p>
      and either reboot, or execute the following command:
    </p>
<pre class="screen">
<code class="prompt">#</code> <strong class="userinput"><code>/etc/rc.d/bluetooth start</code></strong>
    </pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
        Configuration of Bluetooth controllers is done with the
        <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btconfig</span>(8)</span></a> program, and the above argument enables
        only basic functionality, see the manual page for other
        useful options.
      </p>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Important</h3>
<p>
	<a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bthcid+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bthcid</span>(8)</span></a> <span class="emphasis"><em>must</em></span> be running in order
	to make authenticated connections with remote devices, and
	authentication may be requested by either device.
      </p>
</div>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-hid"></a>21.4. Èuman Interface Devices</h2></div></div></div>
<p>
      Support for <span class="quote">&#8220;<span class="quote">Human Interface Devices</span>&#8221;</span> (HIDs),
      which operate using the USB HID protocol over a pair of L2CAP
      channels is provided by the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bthidev+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bthidev</span>(4)</span></a> driver. Currently,
      keyboards and mice are catered for, and attach to <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?wscons+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">wscons</span>(4)</span></a>
      as normal.
    </p>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="chap-bluetooth-hid-mouse"></a>21.4.1. Íice</h3></div></div></div>
<p>
        Bluetooth Mice can be attached to the system with the
        <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btms+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btms</span>(4)</span></a> driver, using <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btdevctl</span>(8)</span></a>.
      </p>
<p>
        First, you must discover the BDADDR of the device. This
        may be printed on the box, but the easiest way is to place
        the device into discoverable mode and perform a device inquiry
        with the appropriate controller:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btconfig ubt0 inquiry</code></strong>
Device Discovery on ubt0 .... 1 response
  1: bdaddr 00:14:51:c1:b9:2d (unknown)
   : name "Mighty Mouse"
   : class: [0x002580] Peripheral Mouse &lt;Limited Discoverable&gt;
   : page scan rep mode 0x01
   : page scan period mode 0x02
   : page scan mode 0x00
   : clock offset 6944
      </pre>
<p>
        For ease of use, you may want to add the address to the
        <code class="filename">/etc/bluetooth/hosts</code> file, so that
        you can refer to the mouse by alias:
      </p>
<pre class="screen">
<code class="prompt">#</code> <strong class="userinput"><code>echo "00:14:51:c1:b9:2d mouse" &gt;&gt;/etc/bluetooth/hosts</code></strong>
      </pre>
<p>
        Now, you can query the mouse, which will likely request
        authentication before it accepts connections. The fixed
        PIN should be listed in the documentation, though
        <span class="quote">&#8220;<span class="quote">0000</span>&#8221;</span> is often used. Set the PIN first
        using the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btpin</span>(1)</span></a> program:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btpin -d ubt0 -a mouse -p 0000</code></strong>
<code class="prompt">#</code> <strong class="userinput"><code>btdevctl -d ubt0 -a mouse -s HID</code></strong>
local bdaddr: 00:08:1b:8d:ba:6d
remote bdaddr: 00:14:51:c1:b9:2d
link mode: auth
device type: bthidev
control psm: 0x0011
interrupt psm: 0x0013
Collection page=Generic_Desktop usage=Mouse
  Input id=2 size=1 count=1 page=Button usage=Button_1 Variable, logical range 0..1
  Input id=2 size=1 count=1 page=Button usage=Button_2 Variable, logical range 0..1
  Input id=2 size=1 count=1 page=Button usage=Button_3 Variable, logical range 0..1
  Input id=2 size=1 count=1 page=Button usage=Button_4 Variable, logical range 0..1
  Input id=2 size=4 count=1 page=0x0000 usage=0x0000 Const Variable, logical range 0..1
Collection page=Generic_Desktop usage=Pointer
  Input id=2 size=8 count=1 page=Generic_Desktop usage=X Variable Relative, logical range -127..127
  Input id=2 size=8 count=1 page=Generic_Desktop usage=Y Variable Relative, logical range -127..127
  Input id=2 size=8 count=1 page=Consumer usage=AC_Pan Variable Relative, logical range -127..127
  Input id=2 size=8 count=1 page=Generic_Desktop usage=Wheel Variable Relative, logical range -127..127
End collection
  Input id=2 size=8 count=1 page=0x00ff usage=0x00c0 Variable, logical range -127..127
Feature id=71 size=8 count=1 page=0x0006 usage=0x0020 Variable NoPref Volatile, logical range 0..100
End collection
      </pre>
<p>
        This tells you that the mouse has responded to an SDP
        query, and the device capabilities are shown. Note that
	 authentication is enabled by default for Bluetooth mice.
	 You may now attach to the system:
      </p>
<pre class="screen">
<code class="prompt">#</code> <strong class="userinput"><code>btdevctl -d ubt0 -a mouse -s HID -A</code></strong>
      </pre>
<p>
        which should generate some messages on the system console:
      </p>
<pre class="screen">
bthidev0 at bthub0 remote-bdaddr 00:14:51:c1:b9:2d link-mode auth
btms0 at bthidev1 reportid 2: 4 buttons, W and Z dirs.
wsmouse1 at btms0 mux 0
bthidev1: reportid 71 not configured
bthidev1: connected
      </pre>
<p>
        and the mouse should work.
      </p>
<p>
        The device capabilities are cached by <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btdevctl</span>(8)</span></a>, and
        to reattach the mouse at system startup, place an entry in
        <code class="filename">/etc/bluetooth/btdevctl.conf</code>.  The
	<a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bthidev+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bthidev</span>(4)</span></a> driver will attempt to connect once, though
	mice will usually be sleeping and may require a tap on the
	shoulder to awaken, in which case they should initiate the
	connection to the host computer.
      </p>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="chap-bluetooth-hid-keyboard"></a>21.4.2. Ëeyboards</h3></div></div></div>
<p>
        Bluetooth Keyboards can be attached to the system with
        the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btkbd+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btkbd</span>(4)</span></a> driver, using <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btdevctl</span>(8)</span></a>.
      </p>
<p>
        First, you must discover the BDADDR of the device. This
        may be printed on the box, but the easiest way is to place
        the device into discoverable mode and perform a device
        inquiry with the appropriate controller:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btconfig ubt0 inquiry</code></strong>
Device Discovery on ubt0 .... 1 response
  1: bdaddr 00:0a:95:45:a4:a0 (unknown)
   : name "Apple Wireless Keyboard"
   : class: [0x002540] Peripheral Keyboard &lt;Limited Discoverable&gt;
   : page scan rep mode 0x01
   : page scan period mode 0x00
   : page scan mode 0x00
   : clock offset 18604
      </pre>
<p>
        For ease of use, you may want to add the address to the
        <code class="filename">/etc/bluetooth/hosts</code> file, so that
        you can refer to the keyboard by alias:
      </p>
<pre class="screen">
<code class="prompt">#</code> <strong class="userinput"><code>echo "00:0a:95:45:a4:a0 keyboard" &gt;&gt;/etc/bluetooth/hosts</code></strong>
      </pre>
<p>
        Now, you can query the keyboard, which will likely request
        authentication before it accepts connections. The PIN will
        need to be entered on the keyboard, and we can generate a
        random PIN, using the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btpin</span>(1)</span></a> program.
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btpin -d ubt0 -a keyboard -r -l 8</code></strong>
PIN: 18799632
<code class="prompt">#</code> <strong class="userinput"><code>btdevctl -d ubt0 -a keyboard -s HID</code></strong>

    &lt; ENTER PIN ON BLUETOOTH KEYBOARD NOW &gt;

local bdaddr: 00:08:1b:8d:ba:6d
remote bdaddr: 00:0a:95:45:a4:a0
link mode: encrypt
device type: bthidev
control psm: 0x0011
interrupt psm: 0x0013
Collection page=Generic_Desktop usage=Keyboard
  Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftControl Variable, logical range 0..1
  Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftShift Variable, logical range 0..1
  Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftAlt Variable, logical range 0..1
  Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_Left_GUI Variable, logical range 0..1
  Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_RightControl Variable, logical range 0..1
  Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_RightShift Variable, logical range 0..1
  Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_RightAlt Variable, logical range 0..1
  Input id=1 size=1 count=1 page=Keyboard usage=Keyboard_Right_GUI Variable, logical range 0..1
  Input id=1 size=8 count=1 page=0x0000 usage=0x0000 Const, logical range 0..1
 Output id=1 size=1 count=1 page=LEDs usage=Num_Lock Variable, logical range 0..1
 Output id=1 size=1 count=1 page=LEDs usage=Caps_Lock Variable, logical range 0..1
 Output id=1 size=1 count=1 page=LEDs usage=Scroll_Lock Variable, logical range 0..1
 Output id=1 size=1 count=1 page=LEDs usage=Compose Variable, logical range 0..1
 Output id=1 size=1 count=1 page=LEDs usage=Kana Variable, logical range 0..1
 Output id=1 size=3 count=1 page=0x0000 usage=0x0000 Const, logical range 0..1
  Input id=1 size=8 count=6 page=Keyboard usage=No_Event, logical range 0..255
  Input id=1 size=1 count=1 page=Consumer usage=Eject Variable Relative, logical range 0..1
  Input id=1 size=1 count=1 page=Consumer usage=Mute Variable Relative, logical range 0..1
  Input id=1 size=1 count=1 page=Consumer usage=Volume_Up Variable, logical range 0..1
  Input id=1 size=1 count=1 page=Consumer usage=Volume_Down Variable, logical range 0..1
  Input id=1 size=1 count=4 page=0x0000 usage=0x0000 Const, logical range 0..1
End collection
      </pre>
<p>
        This tells you that the keyboard has responded to an SDP
        query, and the device capabilities are shown.  Note that
	 encryption is enabled by default, since encrypted connection
	 support is mandatory for Bluetooth keyboards.  You may now
	 attach to the system:
      </p>
<pre class="screen">
<code class="prompt">#</code> <strong class="userinput"><code>btdevctl -d ubt0 -a keyboard -s HID -A</code></strong>
      </pre>
<p>
        which should generate some messages on the system console:
      </p>
<pre class="screen">
bthidev1 at bthub0 remote-bdaddr 00:0a:95:45:a4:a0 link-mode encrypt
btkbd0 at bthidev0 reportid 1
wskbd1 at btkbd0 mux 1
wskbd1: connecting to wsdisplay0
bthidev1: connected
      </pre>
<p>
        and the keyboard should work.
      </p>
<p>
        The device capabilities are cached by <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btdevctl</span>(8)</span></a>, and
        to reattach the keyboard at system startup, place an entry in
        <code class="filename">/etc/bluetooth/btdevctl.conf</code>.  The
	<a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bthidev+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bthidev</span>(4)</span></a> driver will attempt to connect once when
	attached, but if the keyboard is not available at that time,
	you may find that pressing a key will cause it to wake up and
	initiate a connection to the last paired host.
      </p>
</div>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-networking"></a>21.5. Ðersonal Area Networking</h2></div></div></div>
<p>
      Personal Area Networking services over Bluetooth are provided
      by the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btpand+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btpand</span>(8)</span></a> daemon which can assume all roles from
      the PAN profile and connects remote devices to the system
      through a <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?tap+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">tap</span>(4)</span></a> virtual Ethernet interface.
    </p>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="chap-bluetooth-networking-panu"></a>21.5.1. Ðersonal Area Networking User</h3></div></div></div>
<p>
        The "Personal Area Networking User" role is the client that
	accesses Network services on another device.  For instance,
	in order to connect to the Internet via a smart phone with
	the NAP profile, make sure that the phone is discoverable,
	then:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btconfig ubt0 inquiry</code></strong>
Device Discovery from device: ubt0 .... 1 response
  1: bdaddr 00:17:83:30:bd:5e (unknown)
   : name "HTC Touch"
   : class: [0x5a020c] Smart Phone &lt;Networking&gt; &lt;Capturing&gt; &lt;Object Transfer&gt;
	&lt;Telephony&gt;
   : page scan rep mode 0x01
   : clock offset 9769
   : rssi -42

<code class="prompt">#</code> <strong class="userinput"><code>echo "00:17:83:30:bd:5e phone" &gt;&gt;/etc/bluetooth/hosts</code></strong>
      </pre>
<p>
        You will see that the phone should have the &lt;Networking&gt; flag set
        in the Class of Device. Checking for the NAP service:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>sdpquery -a phone search NAP</code></strong>
ServiceRecordHandle: 0x00010000
ServiceClassIDList: 
    Network Access Point
ProtocolDescriptorList: 
    L2CAP (PSM 0x000f)
    BNEP (v1.0; IPv4, ARP, IPv6)
LanguageBaseAttributeIDList: 
    en.UTF-8 base 0x0100
BluetoothProfileDescriptorList: 
    Network Access Point, v1.0
ServiceName: "Network Access Point"
ServiceDescription: "Bluetooth NAP Service"
SecurityDescription: None
NetAccessType: 100Mb Ethernet
MaxNetAccessRate: 100000
      </pre>
<p>
        reveals that the NAP service is available and that it
        provides IPv4, ARP and IPv6 protocols.
      </p>
<p>
        Most likely, the phone will request authentication before
        it allows connections to the NAP service, so before you
        make the first connection you may need to provide a PIN,
        which can be randomly generated. Then start <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btpand+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btpand</span>(8)</span></a>:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btpin -d ubt0 -a phone -r -l 6</code></strong>
PIN: 862048
<code class="prompt">#</code> <strong class="userinput"><code>btpand -d ubt0 -a phone -s NAP</code></strong>

    &lt; ENTER PIN ON PHONE NOW &gt;

Searching for NAP service at 00:17:83:30:bd:5e
Found PSM 15 for service NAP
Opening connection to service 0x1116 at 00:17:83:30:bd:5e
Using interface tap0 with addr 00:10:60:e1:50:3d
      </pre>
<p>
        Finally, you will need to configure the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?tap+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">tap</span>(4)</span></a> interface,
        but the phone should have a DHCP server so <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?dhcpcd+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">dhcpcd</span>(8)</span></a>
        will do that for you.
      </p>
<pre class="screen">
<code class="prompt">#</code> <strong class="userinput"><code>dhcpcd tap0</code></strong>
      </pre>
<p>
        Now you can surf the World Wide Web, but watch your data
        usage unless you have a comprehensive data plan.
      </p>
</div>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-serial"></a>21.6. Óerial Connections</h2></div></div></div>
<p>
      Serial connections over Bluetooth are provided for by the
      RFCOMM protocol, which provides up to 30 channels multiplexed
      over a single L2CAP channel. This streamed data protocol can be
      accessed using the BTPROTO_RFCOMM socket interface, or via the
      <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?rfcomm_sppd+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">rfcomm_sppd</span>(1)</span></a> program.
    </p>
<p>
      For instance, you can make a serial connection to the
      <span class="quote">&#8220;<span class="quote">Dial Up Networking</span>&#8221;</span> (DUN) service of a mobile
      phone in order to connect to the Internet with PPP. First you
      should discover the BDADDR of the phone, and add this to your
      <code class="filename">/etc/bluetooth/hosts</code> for ease of use.
      Place the phone into Discoverable mode, and perform an inquiry
      from the appropriate controller:
    </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btconfig ubt0 inquiry</code></strong>
Device Discovery from device: ubt0 ..... 1 response
  1: bdaddr 00:16:bc:00:e8:48 (unknown)
   : name "Nokia 6103"
   : class: [0x520204] Cellular Phone &lt;Networking&gt; &lt;Object Transfer&gt; &lt;Telephony&gt;
   : page scan rep mode 0x01
   : page scan period mode 0x02
   : page scan mode 0x00
   : clock offset 30269

<code class="prompt">#</code> <strong class="userinput"><code>echo "00:16:bc:00:e8:48 phone" &gt;&gt;/etc/bluetooth/hosts</code></strong>
    </pre>
<p>
      Now, you can query the phone to confirm that it supports
      the DUN profile:
    </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>sdpquery -d ubt0 -a phone search DUN</code></strong>
ServiceRecordHandle: 0x00010003
ServiceClassIDList: 
    Dialup Networking
    Generic Networking
ProtocolDescriptorList: 
    L2CAP
    RFCOMM (channel 1)
BrowseGroupList: 
    Public Browse Root
LanguageBaseAttributeIDList: 
    en.UTF-8 base 0x0100
BluetoothProfileDescriptorList: 
    Dialup Networking, v1.0
ServiceName: "Dial-up networking"
    </pre>
<p>
      Most likely, the phone will request authentication before
      it allows connections to the DUN service, so before you
      make the first connection you may need to provide a PIN,
      which can be randomly generated. You can use
      <span class="command"><strong>rfcomm_sppd</strong></span> in stdio mode to check that
      the connection is working ok, press <strong class="userinput"><code>^C</code></strong>
      to disconnect and return to the shell, for example:
    </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btpin -d ubt0 -a phone -r -l 6</code></strong>
PIN: 904046
<code class="prompt">%</code> <strong class="userinput"><code>rfcomm_sppd -d ubt0 -a phone -s DUN</code></strong>

    &lt; ENTER PIN ON PHONE NOW &gt;

rfcomm_sppd[24635]: Starting on stdio...
<strong class="userinput"><code>at</code></strong>
OK
<strong class="userinput"><code>ati</code></strong>
Nokia

OK
<strong class="userinput"><code>ati3</code></strong>
Nokia 6103

OK
<strong class="userinput"><code>at&amp;v</code></strong>
ACTIVE PROFILE:
E1 Q0 V1 X5 &amp;C1 &amp;D2 &amp;S0 &amp;Y0
+CMEE=0 +CSTA=129 +CBST=0,0,1 +CRLP=61,61,48,6 +CR=0 +CRC=0 +CLIP=0,2
+CLIR=0,2 +CSNS=0 +CVHU=1 +DS=0,0,2048,32 +DR=0 +ILRR=0
+CHSN=0,0,0,0 +CHSR=0 +CPBS="SM"
S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S07:060 S08:002
S10:100 S12:050 S25:000

OK
<strong class="userinput"><code>^C</code></strong>
rfcomm_sppd[24635]: Completed on stdio
    </pre>
<p>
      To have <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?pppd+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">pppd</span>(8)</span></a> connect to the DUN service of your
      phone automatically when making outbound connections, add the
      following line to the <code class="filename">/etc/ppp/options</code>
      file in place of the normal tty declaration:
    </p>
<pre class="screen">
pty "rfcomm_sppd -d ubt0 -a phone -s DUN -m encrypt"
    </pre>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-audio"></a>21.7. Áudio</h2></div></div></div>
<p>
      Isochronous (SCO) Audio connections may be created on a
      baseband radio link using either the BTPROTO_SCO socket
      interface, or the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btsco</span>(4)</span></a> audio device driver. While
      the specification says that up to three such links can be
      made between devices, the current Bluetooth stack can only
      handle one with any dignity.
    </p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Important</h3>
<p>
        When using SCO Audio with USB Bluetooth controllers,
        you will need to enable isochronous data, and calculate
        the MTU that the device will use, see <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?ubt+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">ubt</span>(4)</span></a> and
        <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btconfig+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btconfig</span>(8)</span></a>.
      </p>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
        SCO Audio does not work properly with the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bt3c+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bt3c</span>(4)</span></a>
        driver, use a USB controller for best results.
      </p>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
        SCO Audio will not work with <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?ehci+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">ehci</span>(4)</span></a> USB controllers,
        since support for Isochronous data over EHCI is missing
        in NetBSD.
      </p>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="chap-bluetooth-audio-headset"></a>21.7.1. ÓCO Audio Headsets</h3></div></div></div>
<p>
        Audio connections to Bluetooth Headsets are possible
        using the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btsco</span>(4)</span></a> audio driver, and the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bthset+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bthset</span>(1)</span></a>
        program. First, you need to discover the BDADDR of the
        headset, and will probably wish to make an alias in your
        <code class="filename">/etc/bluetooth/hosts</code> file for ease
        of use. Place the headset into discoverable mode and
        perform an inquiry with the appropriate controller:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btconfig ubt0 inquiry</code></strong>
Device Discovery from device: ubt0 ..... 1 response
 1: bdaddr 00:07:a4:23:10:83 (unknown)
  : name "JABRA 250"
  : class: [0x200404] Wearable Headset &lt;Audio&gt;
  : page scan rep mode 0x01
  : page scan period mode 0x00
  : page scan mode 0x00
  : clock offset 147

<code class="prompt">#</code> <strong class="userinput"><code>echo "00:07:a4:23:10:83 headset" &gt;&gt;/etc/bluetooth/hosts</code></strong>
      </pre>
<p>
        You will need to pair with the headset the first time you
        connect, the fixed PIN should be listed in the manual (often,
        <span class="quote">&#8220;<span class="quote">0000</span>&#8221;</span> is used). <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btdevctl</span>(8)</span></a> will query the
        device and attach the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btsco</span>(4)</span></a> audio driver.
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btpin -d ubt0 -a headset -p 0000</code></strong>
<code class="prompt">#</code> <strong class="userinput"><code>btdevctl -d ubt0 -a headset -s HSET -A</code></strong>
local bdaddr: 00:08:1b:8d:ba:6d
remote bdaddr: 00:07:a4:23:10:83
link mode: none
device type: btsco
mode: connect
channel: 1
      </pre>
<p>
        which should generate some messages on the system console:
      </p>
<pre class="screen">
btsco0 at bthub0 remote-bdaddr 00:07:a4:23:10:83 channel 1
audio1 at btsco0: full duplex
      </pre>
<p>
        In order to use the audio device, you will need to open
        a control connection with <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?bthset+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">bthset</span>(1)</span></a> which conveys
        volume information to the mixer device.
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>bthset -m /dev/mixer1 -v</code></strong>
Headset Info:
        mixer: /dev/mixer1
        laddr: 00:08:1b:8d:ba:6d
        raddr: 00:07:a4:23:10:83
        channel: 1
        vgs.dev: 0, vgm.dev: 1
      </pre>
<p>
        and you should now be able to transfer 8khz samples to
        and from <code class="filename">/dev/audio1</code> using any program
        that supports audio, such as <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?audioplay+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">audioplay</span>(1)</span></a> or
        <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?audiorecord+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">audiorecord</span>(1)</span></a>. 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.
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>audiorecord -d /dev/audio1 voice.au</code></strong>

        &lt; TALK NONSENSE NOW &gt;

<strong class="userinput"><code>^C</code></strong>
<code class="prompt">%</code> <strong class="userinput"><code>audioplay -d /dev/audio voice.au</code></strong>

        &lt; THATS REALLY WHAT YOU SOUND LIKE &gt;

<code class="prompt">%</code> <strong class="userinput"><code>audioplay -d /dev/audio1 voice.au</code></strong>

        &lt; IN THE HEADSET &gt;
      </pre>
<p>
        The device capabilities are cached by <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btdevctl+8+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btdevctl</span>(8)</span></a>, and
        to reattach the <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btsco+4+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btsco</span>(4)</span></a> driver at system startup, add
        an entry to <code class="filename">/etc/bluetooth/btdevctl.conf</code>.
      </p>
</div>
<div class="sect2">
<div class="titlepage"><div><div><h3 class="title">
<a name="chap-bluetooth-audio-handsfree"></a>21.7.2. ÓCO Audio Handsfree</h3></div></div></div>
<p>
        Audio connections to Bluetooth mobile phones using
        the Handsfree profile are possible with the
        <span class="quote">&#8220;<span class="quote">comms/bthfp</span>&#8221;</span> program from the NetBSD Package
        Collection.
      </p>
<p>
        First, you need to discover the BDADDR of the phone,
        and will probably wish to make an alias in your
        <code class="filename">/etc/bluetooth/hosts</code> file for ease of
        use. Place the phone into discoverable mode and perform
        an inquiry with the appropriate controller:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btconfig ubt0 inquiry</code></strong>
Device Discovery from device: ubt0 ..... 1 response
  1: bdaddr 00:16:bc:00:e8:48 (unknown)
   : name "Nokia 6103"
   : class: [0x520204] Cellular Phone &lt;Networking;gt; &lt;Object Transfer;gt; &lt;Telephony;gt;
   : page scan rep mode 0x01
   : page scan period mode 0x02
   : page scan mode 0x00
   : clock offset 10131

<code class="prompt">#</code> <strong class="userinput"><code>echo "00:16:bc:00:e8:48 phone" &gt;&gt;/etc/bluetooth/hosts</code></strong>
      </pre>
<p>
        Now, you should be able to query the phone to confirm that
        it supports the Handsfree profile:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>sdpquery -d ubt0 -a phone search HF</code></strong>
ServiceRecordHandle: 0x00010006
ServiceClassIDList: 
    Handsfree Audio Gateway
    Generic Audio
ProtocolDescriptorList: 
    L2CAP
    RFCOMM (channel 13)
BrowseGroupList: 
    Public Browse Root
LanguageBaseAttributeIDList: 
    en.UTF-8 base 0x0100
BluetoothProfileDescriptorList: 
    Handsfree, v1.5
ServiceName: "Voice Gateway"
Network: Ability to reject a call
SupportedFeatures: 
    3 Way Calling
    Echo Cancellation/Noise Reduction
    Voice Recognition
    In-band Ring Tone
      </pre>
<p>
        and you will be able to use the
        <span class="application">bthfp</span> program to access the
        Handsfree profile. The first time you connect, you may
        need to use a PIN to pair with the phone, which can be
        generated randomly by <a class="citerefentry" href="http://netbsd.gw.com/cgi-bin/man-cgi?btpin+1+NetBSD-6.0.1+i386"><span class="citerefentry"><span class="refentrytitle">btpin</span>(1)</span></a>:
      </p>
<pre class="screen">
<code class="prompt">%</code> <strong class="userinput"><code>btpin -d ubt0 -a phone -r -l 6</code></strong>
PIN: 349163
<code class="prompt">%</code> <strong class="userinput"><code>bthfp -d ubt0 -a phone -v</code></strong>

      &lt; ENTER PIN ON PHONE NOW &gt;
Handsfree channel: 13
Press ? for commands
Connecting.. ok
&lt; AT+BRSF=20
&gt; +BRSF: 47
Features: [0x002f] &lt;3 way calling&gt; &lt;EC/NR&gt; &lt;Voice Recognition&gt; &lt;In-band ringtone&gt; &lt;reject ability&gt;
&gt; OK
&lt; AT+CIND=?
&gt; +CIND: ("call",(0,1)),("service",(0,1)),("call_setup",(0-3)),("callsetup",(0-3))
&gt; OK
&lt; AT+CIND?
&gt; +CIND: 0,1,0,0
&gt; OK
&lt; AT+CMER=3,0,0,1
&gt; OK
&lt; AT+CLIP=1
&gt; OK
Service Level established
      </pre>
<p>
        When the phone rings, just press <strong class="userinput"><code>a</code></strong>
        to answer, and audio should be routed through the
        <code class="filename">/dev/audio</code> device. Note that you will
        need a microphone connected in order to speak to the remote
        party.
      </p>
</div>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-obex"></a>21.8. Ïbject Exchange</h2></div></div></div>
<p>
      NetBSD does not currently have any native OBEX
      capability, see the <span class="quote">&#8220;<span class="quote">comms/obexapp</span>&#8221;</span> or
      <span class="quote">&#8220;<span class="quote">comms/obexftp</span>&#8221;</span> packages from the NetBSD
      Package Collection.
    </p>
</div>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="chap-bluetooth-trouble"></a>21.9. Ôroubleshooting</h2></div></div></div>
<p>
      When nothing seems to be happening, it may be useful to try
      the <span class="application">hcidump</span> program from the
      <span class="quote">&#8220;<span class="quote">sysutils/netbt-hcidump</span>&#8221;</span> package in the NetBSD
      Package Collection. This has the capability to dump packets
      entering and leaving Bluetooth controllers on NetBSD, which
      is greatly helpful in pinpointing problems.
    </p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="chap-veriexec.html">Prev</a>/td>
<td width="20%" align="center"><a accesskey="u" href="part-config.html">Up</a></td>
<td width="40%" align="right">a accesskey="n" href="chap-misc.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter0. ÎetBSD Veriexec subsystem/td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> Ãhapter2. Íiscellaneous operations</td>
</tr>
</table>
</div>
</body>
</html>