The btsco driver must be configured at run time with the btdevctl(8) program. The following properties are used by the btsco driver during autoconfiguration:
BTSCO_INFO
ioctl as below:
SCO connections require a baseband connection between the two devices before
they can be created.
The
btsco
driver does not create this, but can provide information to facilitate
an application setting up a control channel prior to use, via the
BTSCO_INFO
ioctl(2)
call on the mixer device, which returns a
btsco_info
structure as follows:
#include <dev/bluetooth/btsco.h>
struct btsco_info {
bdaddr_t laddr; /* controller bdaddr */
bdaddr_t raddr; /* headset bdaddr */
uint8_t channel; /* RFCOMM channel */
int vgs; /* mixer index speaker */
int vgm; /* mixer index mic */
};
#define BTSCO_INFO _IOR('b', 16, struct btsco_info)
The btsco driver can be configured to act in Connect or Listen mode. In Connect mode, the btsco driver will initate a connection to the remote device on an open(2) call, whereas in Listen mode, open(2) will block until the remote device initiates the connection.