Accepting SCO Connections in a Bluetooth Profile Driver
A SCO profile driver can register itself to respond to incoming Synchronous Connection-Oriented (SCO) connection requests from remote devices. For example, a SCO profile driver for a cordless telephony profile (CTP) device responds to an incoming SCO connection request from the CTP device, either accepting or rejecting the request. If the server profile driver accepts the request, the server profile driver responds to input from the device and passes that input to the Bluetooth driver stack.
Server profile drivers must perform the following steps to accept incoming SCO connection requests from remote Bluetooth devices.
To Receive Incoming SCO Connection Requests from Remote Devices
Profile drivers should build and send a BRB_SCO_REGISTER_SERVER request to register a SCO Callback Function with the Bluetooth driver stack so the stack can notify the profile driver of incoming SCO connection requests.
When the Bluetooth driver stack receives an incoming SCO connection request from a remote device, it calls the SCO Callback Function registered earlier by the profile driver. The Bluetooth driver stack passes the value ScoIndicationRemoteConnect to the Indication parameter of the callback function.
To respond to incoming connection requests, profile drivers should build and send a BRB_SCO_OPEN_CHANNEL_RESPONSE request. Based on the value of the Response member of the _BRB_SCO_OPEN_CHANNEL structure passed with this request, the server profile driver accepts or rejects the connection request.
If the server profile driver accepts the connection, the Bluetooth driver stack can then call the SCO Callback Function as specified in the Callback member of the _BRB_SCO_OPEN_CHANNEL structure to notify the server profile driver of any changes to the SCO connection.
After the profile driver accepts a connection request, it can use other BRBs to send and receive data over the newly established SCO connection.
To stop receiving notifications of remote device SCO connection attempts, profile drivers should build and send a BRB_SCO_UNREGISTER_SERVER request to unregister a server when the profile driver processes IRP_MN_REMOVE_DEVICE Plug and Play remove notifications.
For more information about notifications and callback functions, see Supporting Bluetooth Event Notifications.