CBluetoothSynchronousLink Class Reference

#include <bt_sock.h>

Link against: bluetooth.lib

class CBluetoothSynchronousLink : public CBase

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()
    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()

    Detailed Description

    Provides Bluetooth SCO functionality.

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

    Constructor & Destructor Documentation

    ~CBluetoothSynchronousLink ( )

    IMPORT_C~CBluetoothSynchronousLink()

    Destructor

    Member Function 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.

    Returns: Error code

    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.

    See also: TBTPacketType

    ParameterDescription
    aPacketTypesBitmask of supported packets.

    Returns: Error code

    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 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.

    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.

    See also: 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.

    Disconnect ( )

    IMPORT_C TIntDisconnect()

    Disconnect a synchronous link.

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

    Returns: Error code

    ESCOSocket ( )

    RSocket &ESCOSocket()

    HandleAcceptConnectionCompleteL ( TInt, TSCOType )

    voidHandleAcceptConnectionCompleteL(TIntaErr,
    TSCOTypeaSCOType
    )

    HandleDisconnectionCompleteL ( TInt )

    voidHandleDisconnectionCompleteL(TIntaErr)

    HandleReceiveCompleteL ( TInt )

    voidHandleReceiveCompleteL(TIntaErr)

    HandleSendCompleteL ( TInt )

    voidHandleSendCompleteL(TIntaErr)

    HandleSetupConnectionCompleteL ( TInt, TSCOType )

    voidHandleSetupConnectionCompleteL(TIntaErr,
    TSCOTypeaSCOType
    )

    Latency ( )

    IMPORT_C TUint16Latency()

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

    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
    ParameterDescription
    aNotifierNotifier object which will receive callbacks after asynchronous requests
    aServerHandle to a currently connected session on the socket server

    Returns: Newly allocated CBluetoothSynchronousLink object

    NewLC ( MBluetoothSynchronousLinkNotifier &, RSocketServ & )

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

    Allocate and open a socket sub-session for Bluetooth SCO

    capability
    LocalServices
    ParameterDescription
    aNotifierNotifier object which will receive callbacks after asynchronous requests
    aServerHandle to a currently connected session on the socket server

    Returns: Newly allocated CBluetoothSynchronousLink object

    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.

    Returns: Error code

    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.
    ParameterDescription
    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.

    Returns: Error code

    SetCoding ( TUint16 )

    IMPORT_C voidSetCoding(TUint16aVoiceSetting)

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

    SetMaxBandwidth ( TBTSyncBandwidth )

    IMPORT_C voidSetMaxBandwidth(TBTSyncBandwidthaMaximum)

    Specify maximum bandwidths in octets/second.

    SetMaxLatency ( TUint16 )

    IMPORT_C voidSetMaxLatency(TUint16aLatency)

    Specify maximum acceptable latency in milliseconds.

    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.

    SetRetransmissionEffort ( TBTeSCORetransmissionTypes )

    IMPORT_C voidSetRetransmissionEffort(TBTeSCORetransmissionTypesaRetransmissionEffort)

    Specify link retransmission policy.

    SetupConnection ( const TBTDevAddr & )

    IMPORT_C TIntSetupConnection(const TBTDevAddr &aDevAddr)

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

    ParameterDescription
    aDevAddrBluetooth address of remote device (specifying existing physical link)

    Returns: Error code

    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.

    See also: TBTPacketType

    ParameterDescription
    aDevAddrBluetooth address of remote device (specifying existing physical link)
    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

    Returns: Error code

    SetupConnection ( const TBTDevAddr &, const TBTSyncPackets & )

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

    SocketServer ( )

    RSocketServ &SocketServer()