#include <bt_sock.h>
class CBluetoothSynchronousLink : public CBase |
Provides Bluetooth SCO functionality.
This allows Bluetooth SCO (synchronous) link Connect, Disconnect, Send and Receive.
IMPORT_C TInt | AcceptConnection | ( | ) |
Prepare for a remote device to set up a synchronous link on the local device.
Whilst this facility is set, a response can be sent to a remote device trying to set up a synchronous link, allowing that synchronous link to be brought up. This object will represent that synchronous link locally when/if it does come up.
Returns: Error code
IMPORT_C TInt | AcceptConnection | ( | const TBTSyncPackets & | aPacketTypes | ) |
Prepare for a remote device to set up a synchronous link on the local device.
Whilst this facility is set, a response can be sent to a remote device trying to set up a synchronous link, allowing that synchronous link to be brought up. This object will represent that synchronous link locally when/if it does come up.
See also: TBTPacketType
Parameter | Description |
---|---|
aPacketTypes | Bitmask of supported packets. |
Returns: Error code
IMPORT_C void | CancelAccept | ( | ) |
Cancel ability to respond to a remote request to set up a synchronous link.
It is possible for a race condition to mean that a connection has been established but the notifier has not yet received the call-back. In this case no call-back will be received and the link (if established) will be immediately shutdown.
IMPORT_C void | CancelSetup | ( | ) |
Cancel creating a synchronous link. This cancels the asynchronous request to prevent the callback reaching the client. It makes no claims about the resultant state of the CBluetoothSynchronousLink. If a client wishes to continue using the CBluetoothSynchronousLink it is strongly recommended to follow a call to CancelSetup with a call to Disconnect, which will ensure that any established connection is tidied up.
See also: CBluetoothSynchronousLink::Disconnect
IMPORT_C TUint16 | Coding | ( | ) |
Return the air coding portion only of the coding specified on the link. See section 6.12 in Bluetooth Core Specification v1.2, Vol. 2, Part E.
IMPORT_C TInt | Disconnect | ( | ) |
Disconnect a synchronous link.
The physical link will remain unless no other services are running on it.
Returns: Error code
IMPORT_C TUint16 | Latency | ( | ) |
Return the negotiated latency in miliseconds (rounded up if non-integer on the link).
IMPORT_C CBluetoothSynchronousLink * | NewL | ( | MBluetoothSynchronousLinkNotifier & | aNotifier, |
RSocketServ & | aServer | |||
) | [static] |
Allocate and open a socket sub-session for Bluetooth SCO
Parameter | Description |
---|---|
aNotifier | Notifier object which will receive callbacks after asynchronous requests |
aServer | Handle to a currently connected session on the socket server |
Returns: Newly allocated CBluetoothSynchronousLink object
IMPORT_C CBluetoothSynchronousLink * | NewLC | ( | MBluetoothSynchronousLinkNotifier & | aNotifier, |
RSocketServ & | aServer | |||
) | [static] |
Allocate and open a socket sub-session for Bluetooth SCO
Parameter | Description |
---|---|
aNotifier | Notifier object which will receive callbacks after asynchronous requests |
aServer | Handle to a currently connected session on the socket server |
Returns: Newly allocated CBluetoothSynchronousLink object
Receive data over synchronous link. It is worth noting that Bluetooth hardware may have dedicated pins to supply synchronous data, and the RSocket interface cannot provide the synchronous requirements of the SCO link. As a result of this, the CBluetoothSynchronousLink class may only provide the control plane of a SCO connection. In this situation, Receive returns KErrNotSupported via the MBluetoothSynchronousLinkNotifier::HandleReceiveCompleteL callback.
Returns: Error code
IMPORT_C void | RemoteName | ( | TSockAddr & | aAddr | ) |
Parameter | Description |
---|---|
aAddr | The socket address. |
IMPORT_C TUint8 | RetransmissionEffort | ( | ) |
Return an estimate of the retransmission policy on the link. Estimate is calculated by taking the size of the retransmission window, estimating the packet type based on packet length and calculating the number of packet retransmissions which are possible. This number is then returned by this function.
Send data over synchronous link. It is worth noting that Bluetooth hardware may have dedicated pins to supply synchronous data, and the RSocket interface cannot provide the synchronous requirements of the SCO link. As a result of this, the CBluetoothSynchronousLink class may only provide the control plane of a SCO connection. In this situation, Receive returns KErrNotSupported via the MBluetoothSynchronousLinkNotifier::HandleSendCompleteL callback.
Returns: Error code
IMPORT_C void | SetCoding | ( | TUint16 | aVoiceSetting | ) |
Specify Voice Setting. See section 6.12 in Bluetooth Core Specification v1.2, Vol. 2, Part E.
IMPORT_C void | SetMaxBandwidth | ( | TBTSyncBandwidth | aMaximum | ) |
Specify maximum bandwidths in octets/second.
IMPORT_C void | SetMaxLatency | ( | TUint16 | aLatency | ) |
Specify maximum acceptable latency in milliseconds.
IMPORT_C void | SetNotifier | ( | MBluetoothSynchronousLinkNotifier & | aNotifier | ) |
Set the object to be notified of synchronous link events. This does not take ownership. This notifier will replace the current one.
IMPORT_C void | SetRetransmissionEffort | ( | TBTeSCORetransmissionTypes | aRetransmissionEffort | ) |
Specify link retransmission policy.
IMPORT_C TInt | SetupConnection | ( | const TBTDevAddr & | aDevAddr | ) |
Create a synchronous link (e.g. voice) on an EXISTING physical link.
Parameter | Description |
---|---|
aDevAddr | Bluetooth address of remote device (specifying existing physical link) |
Returns: Error code
IMPORT_C TInt | SetupConnection | ( | const TBTDevAddr & | aDevAddr, |
const TUint16 | aPacketTypes | |||
) |
Create a synchronous link (e.g. voice) on an EXISTING physical link.
See also: TBTPacketType
Parameter | Description |
---|---|
aDevAddr | Bluetooth address of remote device (specifying existing physical link) |
aPacketTypes | Bitmask of the SCO packet types required on this connection Use only the three SCO specific packet type enums E.g. EPacketsHV1|EPacketsHV2|EPacketsHV3 (EAnySCOPacket) specifies all the three packet types are allowed. OR if ESCO is supported three ESCO specific packet type enums |
Returns: Error code
IMPORT_C TInt | SetupConnection | ( | const TBTDevAddr & | aDevAddr, |
const TBTSyncPackets & | aPacketTypes | |||
) |