1.\" $NetBSD: btsco.4,v 1.13 2017/07/03 21:30:58 wiz Exp $ 2.\" 3.\" Copyright (c) 2006 Itronix Inc. 4.\" All rights reserved. 5.\" 6.\" Written by Iain Hibbert for Itronix Inc. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 3. The name of Itronix Inc. may not be used to endorse 17.\" or promote products derived from this software without specific 18.\" prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY 24.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27.\" ON ANY THEORY OF LIABILITY, WHETHER IN 28.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30.\" POSSIBILITY OF SUCH DAMAGE. 31.\" 32.Dd November 29, 2014 33.Dt BTSCO 4 34.Os 35.Sh NAME 36.Nm btsco 37.Nd Bluetooth SCO Audio 38.Sh SYNOPSIS 39.Cd "btsco* at bthub?" 40.Cd "audio* at audiobus?" 41.Sh DESCRIPTION 42The 43.Nm 44driver provides support for Bluetooth SCO (Synchronous connection-oriented) 45Audio devices through the 46.Xr audio 4 47driver. 48.Pp 49The 50.Nm 51driver must be configured at run time with the 52.Xr btdevctl 8 53program. 54The following properties are used by the 55.Nm 56driver during autoconfiguration: 57.Pp 58.Bl -tag -width listenXX 59.It local-bdaddr 60Local device address. 61.It remote-bdaddr 62Remote device address. 63.It service-name 64The 65.Nm 66driver matches the 67.Sq HF 68and 69.Sq HSET 70services. 71For the 72.Sq HF 73service, the 74.Nm 75device will, on 76.Xr open 2 , 77listen for incoming connections from the remote device. 78Otherwise, 79.Nm 80will attempt to initiate a connection to the remote device. 81.It rfcomm-channel 82This integer value is not used directly, but will be stored and 83passed via the 84.Dv BTSCO_INFO 85ioctl as below: 86.El 87.Pp 88SCO connections require a baseband connection between the two devices before 89they can be created. 90The 91.Nm 92driver does not create this, but can provide information to facilitate 93an application setting up a control channel prior to use, via the 94.Dv BTSCO_INFO 95.Xr ioctl 2 96call on the mixer device, which returns a 97.Ar btsco_info 98structure as follows: 99.Bd -literal 100#include <dev/bluetooth/btsco.h> 101 102struct btsco_info { 103 bdaddr_t laddr; /* controller bdaddr */ 104 bdaddr_t raddr; /* headset bdaddr */ 105 uint8_t channel; /* RFCOMM channel */ 106 int vgs; /* mixer index speaker */ 107 int vgm; /* mixer index mic */ 108}; 109 110#define BTSCO_INFO _IOR('b', 16, struct btsco_info) 111.Ed 112.Pp 113The 114.Nm 115driver can be configured to act in Connect or Listen mode. 116In Connect mode, the 117.Nm 118driver will initiate a connection to the remote device on an 119.Xr open 2 120call, whereas in Listen mode, 121.Xr open 2 122will block until the remote device initiates the connection. 123.Sh SEE ALSO 124.Xr bthset 1 , 125.Xr ioctl 2 , 126.Xr audio 4 , 127.Xr bluetooth 4 , 128.Xr bthub 4 , 129.Xr btdevctl 8 130.Sh HISTORY 131The 132.Nm 133driver 134was written for 135.Nx 4.0 136by 137.An Iain Hibbert 138under the sponsorship of Itronix, Inc. 139.Sh BUGS 140.Nm 141takes no notice of the HCI Voice Setting in the Bluetooth controller, and this 142must be 0x0060 (the default) as alternate values are currently unsupported. 143