CBluetoothSynchronousLink Class Reference

class CBluetoothSynchronousLink : public CBase

Provides Bluetooth SCO functionality.

This allows Bluetooth SCO (synchronous) link Connect, Disconnect, Send and Receive.

Inherits from

  • CBluetoothSynchronousLink
Public Member Functions
~CBluetoothSynchronousLink()
IMPORT_C TIntAcceptConnection()
IMPORT_C TIntAcceptConnection(const TBTSyncPackets &)
IMPORT_C TBTSyncBandwidthBandwidth()
RBTBaseband &Baseband()
IMPORT_C voidCancelAccept()
IMPORT_C voidCancelReceive()
IMPORT_C voidCancelSend()
IMPORT_C voidCancelSetup()
IMPORT_C TUint16Coding()
IMPORT_C TIntDisconnect()
RSocket &ESCOSocket()
voidHandleAcceptConnectionCompleteL(TInt, TSCOType)
voidHandleDisconnectionCompleteL(TInt)
voidHandleReceiveCompleteL(TInt)
voidHandleSendCompleteL(TInt)
voidHandleSetupConnectionCompleteL(TInt, TSCOType)
IMPORT_C TUint16Latency()
RSocket &ListeningESCOSocket()
RSocket &ListeningSCOSocket()
IMPORT_C CBluetoothSynchronousLink *NewL(MBluetoothSynchronousLinkNotifier &, RSocketServ &)
IMPORT_C CBluetoothSynchronousLink *NewLC(MBluetoothSynchronousLinkNotifier &, RSocketServ &)
MBluetoothSynchronousLinkNotifier &Notifier()
IMPORT_C TIntReceive(TDes8 &)
IMPORT_C voidRemoteName(TSockAddr &)
IMPORT_C TUint8RetransmissionEffort()
RSocket &SCOSocket()
IMPORT_C TIntSend(const TDesC8 &)
IMPORT_C voidSetCoding(TUint16)
IMPORT_C voidSetMaxBandwidth(TBTSyncBandwidth)
IMPORT_C voidSetMaxLatency(TUint16)
IMPORT_C voidSetNotifier(MBluetoothSynchronousLinkNotifier &)
IMPORT_C voidSetRetransmissionEffort(TBTeSCORetransmissionTypes)
IMPORT_C TIntSetupConnection(const TBTDevAddr &)
IMPORT_C TIntSetupConnection(const TBTDevAddr &, const TUint16)
IMPORT_C TIntSetupConnection(const TBTDevAddr &, const TBTSyncPackets &)
RSocketServ &SocketServer()
Private Member Functions
CBluetoothSynchronousLink(MBluetoothSynchronousLinkNotifier &, RSocketServ &)
voidConstructL()
voidLinkDown()
TInt LinkUp(TBTDevAddr)
voidUpdateLinkParams(TSCOType)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CBTSynchronousLinkAccepter *iBTSynchronousLinkAccepterESCO
CBTSynchronousLinkAccepter *iBTSynchronousLinkAccepterSCO
CBTSynchronousLinkAttacher *iBTSynchronousLinkAttacherESCO
CBTSynchronousLinkAttacher *iBTSynchronousLinkAttacherSCO
CBTSynchronousLinkBaseband *iBTSynchronousLinkBaseband
CBTSynchronousLinkDetacher *iBTSynchronousLinkDetacherESCO
CBTSynchronousLinkDetacher *iBTSynchronousLinkDetacherSCO
CBTSynchronousLinkReceiver *iBTSynchronousLinkReceiverESCO
CBTSynchronousLinkReceiver *iBTSynchronousLinkReceiverSCO
CBTSynchronousLinkSender *iBTSynchronousLinkSenderESCO
CBTSynchronousLinkSender *iBTSynchronousLinkSenderSCO
RBTBaseband iBaseband
TBuf8< 1 >iDummySCOShutdownDescriptor
RSocket iESCOSocket
RSocket iListeningESCOSocket
RSocket iListeningSCOSocket
TBTeSCOLinkParams iNegotiatedLink
MBluetoothSynchronousLinkNotifier *iNotifier
TBool iOpenedSCO
TBool iOpeningESCO
TBool iOpeningSCO
TBTeSCOLinkParams iRequestedLink
RSocket iSCOSocket
TUint8 iSCOTypes
TBTSockAddr iSockAddr
RSocketServ &iSockServer

Constructor & Destructor Documentation

CBluetoothSynchronousLink(MBluetoothSynchronousLinkNotifier &, RSocketServ &)

CBluetoothSynchronousLink(MBluetoothSynchronousLinkNotifier &aNotifier,
RSocketServ &aServer
)[private]

Parameters

MBluetoothSynchronousLinkNotifier & aNotifier
RSocketServ & aServer

~CBluetoothSynchronousLink()

IMPORT_C~CBluetoothSynchronousLink()

Destructor

Member Functions Documentation

AcceptConnection()

IMPORT_C TIntAcceptConnection()

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.

AcceptConnection(const TBTSyncPackets &)

IMPORT_C TIntAcceptConnection(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.

TBTPacketType

Parameters

const TBTSyncPackets & aPacketTypesBitmask of supported packets.

Bandwidth()

IMPORT_C TBTSyncBandwidthBandwidth()

Return the negotiated bandwidth.

Baseband()

RBTBaseband &Baseband()

CancelAccept()

IMPORT_C voidCancelAccept()

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 as this call consumes the callback, for this fact not to reach the caller. For this reason, it may be desirable to follow a call to CancelAccept with a call to Disconnect. CBluetoothSynchronousLink::Disconnect

CancelReceive()

IMPORT_C voidCancelReceive()

Cancel receiving data.

CancelSend()

IMPORT_C voidCancelSend()

Cancel sending data.

CancelSetup()

IMPORT_C voidCancelSetup()

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. CBluetoothSynchronousLink::Disconnect

Coding()

IMPORT_C TUint16Coding()

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.

ConstructL()

voidConstructL()[private]

Disconnect()

IMPORT_C TIntDisconnect()

Disconnect a synchronous link.

The physical link will remain unless no other services are running on it.

ESCOSocket()

RSocket &ESCOSocket()

HandleAcceptConnectionCompleteL(TInt, TSCOType)

voidHandleAcceptConnectionCompleteL(TIntaErr,
TSCOTypeaSCOType
)

Parameters

TInt aErr
TSCOType aSCOType

HandleDisconnectionCompleteL(TInt)

voidHandleDisconnectionCompleteL(TIntaErr)

Parameters

TInt aErr

HandleReceiveCompleteL(TInt)

voidHandleReceiveCompleteL(TIntaErr)

Parameters

TInt aErr

HandleSendCompleteL(TInt)

voidHandleSendCompleteL(TIntaErr)

Parameters

TInt aErr

HandleSetupConnectionCompleteL(TInt, TSCOType)

voidHandleSetupConnectionCompleteL(TIntaErr,
TSCOTypeaSCOType
)

Parameters

TInt aErr
TSCOType aSCOType

Latency()

IMPORT_C TUint16Latency()

Return the negotiated latency in miliseconds (rounded up if non-integer on the link).

LinkDown()

voidLinkDown()[private]

LinkUp(TBTDevAddr)

TInt LinkUp(TBTDevAddraAddr)[private]

Parameters

TBTDevAddr aAddr

ListeningESCOSocket()

RSocket &ListeningESCOSocket()

ListeningSCOSocket()

RSocket &ListeningSCOSocket()

NewL(MBluetoothSynchronousLinkNotifier &, RSocketServ &)

IMPORT_C CBluetoothSynchronousLink *NewL(MBluetoothSynchronousLinkNotifier &aNotifier,
RSocketServ &aServer
)[static]

Allocate and open a socket sub-session for Bluetooth SCO

capability
LocalServices

Parameters

MBluetoothSynchronousLinkNotifier & aNotifierNotifier object which will receive callbacks after asynchronous requests
RSocketServ & aServerHandle to a currently connected session on the socket server

NewLC(MBluetoothSynchronousLinkNotifier &, RSocketServ &)

IMPORT_C CBluetoothSynchronousLink *NewLC(MBluetoothSynchronousLinkNotifier &aNotifier,
RSocketServ &aServer
)[static]

Allocate and open a socket sub-session for Bluetooth SCO

capability
LocalServices

Parameters

MBluetoothSynchronousLinkNotifier & aNotifierNotifier object which will receive callbacks after asynchronous requests
RSocketServ & aServerHandle to a currently connected session on the socket server

Notifier()

MBluetoothSynchronousLinkNotifier &Notifier()

Receive(TDes8 &)

IMPORT_C TIntReceive(TDes8 &aData)

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.

Parameters

TDes8 & aData

RemoteName(TSockAddr &)

IMPORT_C voidRemoteName(TSockAddr &aAddr)
Gets the socket address of the remote Bluetooth device.
panic
ESock_client 17 Raised when the link is not connected so there is no valid remote name to return.

Parameters

TSockAddr & aAddrThe socket address.

RetransmissionEffort()

IMPORT_C TUint8RetransmissionEffort()

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.

SCOSocket()

RSocket &SCOSocket()

Send(const TDesC8 &)

IMPORT_C TIntSend(const TDesC8 &aData)

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.

Parameters

const TDesC8 & aData

SetCoding(TUint16)

IMPORT_C voidSetCoding(TUint16aVoiceSetting)

Specify Voice Setting. See section 6.12 in Bluetooth Core Specification v1.2, Vol. 2, Part E.

Parameters

TUint16 aVoiceSetting

SetMaxBandwidth(TBTSyncBandwidth)

IMPORT_C voidSetMaxBandwidth(TBTSyncBandwidthaMaximum)

Specify maximum bandwidths in octets/second.

Parameters

TBTSyncBandwidth aMaximum

SetMaxLatency(TUint16)

IMPORT_C voidSetMaxLatency(TUint16aLatency)

Specify maximum acceptable latency in milliseconds.

Parameters

TUint16 aLatency

SetNotifier(MBluetoothSynchronousLinkNotifier &)

IMPORT_C voidSetNotifier(MBluetoothSynchronousLinkNotifier &aNotifier)

Set the object to be notified of synchronous link events. This does not take ownership. This notifier will replace the current one.

Parameters

MBluetoothSynchronousLinkNotifier & aNotifier

SetRetransmissionEffort(TBTeSCORetransmissionTypes)

IMPORT_C voidSetRetransmissionEffort(TBTeSCORetransmissionTypesaRetransmissionEffort)

Specify link retransmission policy.

Parameters

TBTeSCORetransmissionTypes aRetransmissionEffort

SetupConnection(const TBTDevAddr &)

IMPORT_C TIntSetupConnection(const TBTDevAddr &aDevAddr)

Create a synchronous link (e.g. voice) on an EXISTING physical link.

Parameters

const TBTDevAddr & aDevAddrBluetooth address of remote device (specifying existing physical link)

SetupConnection(const TBTDevAddr &, const TUint16)

IMPORT_C TIntSetupConnection(const TBTDevAddr &aDevAddr,
const TUint16aPacketTypes
)

Create a synchronous link (e.g. voice) on an EXISTING physical link. TBTPacketType

Parameters

const TBTDevAddr & aDevAddrBluetooth address of remote device (specifying existing physical link)
const TUint16 aPacketTypesBitmask 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

SetupConnection(const TBTDevAddr &, const TBTSyncPackets &)

IMPORT_C TIntSetupConnection(const TBTDevAddr &aDevAddr,
const TBTSyncPackets &aPacketTypes
)

Parameters

const TBTDevAddr & aDevAddr
const TBTSyncPackets & aPacketTypes

SocketServer()

RSocketServ &SocketServer()

UpdateLinkParams(TSCOType)

voidUpdateLinkParams(TSCOTypeaSCOType)[private]

Parameters

TSCOType aSCOType

Member Data Documentation

CBTSynchronousLinkAccepter * iBTSynchronousLinkAccepterESCO

CBTSynchronousLinkAccepter *iBTSynchronousLinkAccepterESCO[private]

CBTSynchronousLinkAccepter * iBTSynchronousLinkAccepterSCO

CBTSynchronousLinkAccepter *iBTSynchronousLinkAccepterSCO[private]

CBTSynchronousLinkAttacher * iBTSynchronousLinkAttacherESCO

CBTSynchronousLinkAttacher *iBTSynchronousLinkAttacherESCO[private]

CBTSynchronousLinkAttacher * iBTSynchronousLinkAttacherSCO

CBTSynchronousLinkAttacher *iBTSynchronousLinkAttacherSCO[private]

CBTSynchronousLinkBaseband * iBTSynchronousLinkBaseband

CBTSynchronousLinkBaseband *iBTSynchronousLinkBaseband[private]

CBTSynchronousLinkDetacher * iBTSynchronousLinkDetacherESCO

CBTSynchronousLinkDetacher *iBTSynchronousLinkDetacherESCO[private]

CBTSynchronousLinkDetacher * iBTSynchronousLinkDetacherSCO

CBTSynchronousLinkDetacher *iBTSynchronousLinkDetacherSCO[private]

CBTSynchronousLinkReceiver * iBTSynchronousLinkReceiverESCO

CBTSynchronousLinkReceiver *iBTSynchronousLinkReceiverESCO[private]

CBTSynchronousLinkReceiver * iBTSynchronousLinkReceiverSCO

CBTSynchronousLinkReceiver *iBTSynchronousLinkReceiverSCO[private]

CBTSynchronousLinkSender * iBTSynchronousLinkSenderESCO

CBTSynchronousLinkSender *iBTSynchronousLinkSenderESCO[private]

CBTSynchronousLinkSender * iBTSynchronousLinkSenderSCO

CBTSynchronousLinkSender *iBTSynchronousLinkSenderSCO[private]

RBTBaseband iBaseband

RBTBaseband iBaseband[private]

TBuf8< 1 > iDummySCOShutdownDescriptor

TBuf8< 1 >iDummySCOShutdownDescriptor[private]

RSocket iESCOSocket

RSocket iESCOSocket[private]

RSocket iListeningESCOSocket

RSocket iListeningESCOSocket[private]

RSocket iListeningSCOSocket

RSocket iListeningSCOSocket[private]

TBTeSCOLinkParams iNegotiatedLink

TBTeSCOLinkParams iNegotiatedLink[private]

MBluetoothSynchronousLinkNotifier * iNotifier

MBluetoothSynchronousLinkNotifier *iNotifier[private]

TBool iOpenedSCO

TBool iOpenedSCO[private]

TBool iOpeningESCO

TBool iOpeningESCO[private]

TBool iOpeningSCO

TBool iOpeningSCO[private]

TBTeSCOLinkParams iRequestedLink

TBTeSCOLinkParams iRequestedLink[private]

RSocket iSCOSocket

RSocket iSCOSocket[private]

TUint8 iSCOTypes

TUint8 iSCOTypes[private]

TBTSockAddr iSockAddr

TBTSockAddr iSockAddr[private]

RSocketServ & iSockServer

RSocketServ &iSockServer[private]