CBluetoothSocket Class Reference

class CBluetoothSocket : public CBase

This allows Bluetooth ACL socket-based services to be run.

It allows all user-plane data flow to occur, plus control-plane Bluetooth baseband modification capabilities.

For a more detailed description of RBTBaseband functionality see the class and function documentation for RBTPhysicalLinkAdapter.

This class doesn't provide the functionality to directly activate Active mode (this is implementated in class RBTPhysicalLinkAdapter.) RBTPhysicalLinkAdapter::ActivateActiveRequester() Explicit Active mode requests are made automatically when using the Automatic Sniff Requester utility provided by this class. CBluetoothSocket::SetAutomaticSniffModeRBTPhysicalLinkAdapter

Inherits from

Public Member Functions
~CBluetoothSocket()
IMPORT_C TIntAccept(CBluetoothSocket &)
IMPORT_C TIntAccept(CBluetoothSocket &, TDes8 &)
IMPORT_C TIntActivateBasebandEventNotifier(TUint32)
IMPORT_C TIntActivateParkRequester()
IMPORT_C TIntActivateSniffRequester()
IMPORT_C TIntAllowLowPowerModes(TUint32)
IMPORT_C TIntAllowRoleSwitch()
IMPORT_C voidAsyncDelete()
IMPORT_C TBoolAutomaticSniffMode()
RBTBaseband &BTBaseband()
CBTBasebandManager &BTBasebandManager()
IMPORT_C TIntBind(TSockAddr &)
IMPORT_C voidCancelAccept()
IMPORT_C voidCancelAll()
IMPORT_C voidCancelBasebandEventNotifier()
IMPORT_C voidCancelConnect()
IMPORT_C voidCancelIoctl()
IMPORT_C TIntCancelLowPowerModeRequester()
IMPORT_C voidCancelRead()
IMPORT_C voidCancelRecv()
IMPORT_C voidCancelSend()
IMPORT_C voidCancelWrite()
IMPORT_C TIntConnect(TBTSockAddr &)
IMPORT_C TIntConnect(TBTSockAddr &, const TDesC8 &, TDes8 &)
IMPORT_C TIntConnect(TBTSockAddr &, TUint16)
IMPORT_C TIntGetDisconnectData(TDes8 &)
IMPORT_C TIntGetOpt(TUint, TUint, TDes8 &)
IMPORT_C TIntGetOpt(TUint, TUint, TInt &)
voidHandleAcceptCompleteL(TInt)
voidHandleActivateBasebandEventNotifierCompleteL(TInt, TBTBasebandEventNotification)
voidHandleConnectCompleteL(TInt)
voidHandleIoctlCompleteL(TInt)
voidHandleReceiveCompleteL(TInt)
voidHandleSendCompleteL(TInt)
voidHandleShutdownCompleteL(TInt)
IMPORT_C TIntInfo(TProtocolDesc &)
IMPORT_C TIntIoctl(TUint, TUint, TDes8 *)
IMPORT_C TIntIoctl(TUint, TDes8 *, TUint)
IMPORT_C TIntListen(TUint)
IMPORT_C TIntListen(TUint, const TDesC8 &)
IMPORT_C TIntListen(TUint, TUint16)
IMPORT_C voidLocalName(TSockAddr &)
IMPORT_C TUintLocalPort()
IMPORT_C TIntName(TName &)
IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &, RSocketServ &, TUint, TUint)
IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &, RSocketServ &, TUint, TUint, RConnection &)
IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &, RSocketServ &, const TDesC &)
IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &, RSocketServ &)
IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &, RSocketServ &, RSocket &)
IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &, RSocketServ &, TUint, TUint)
IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &, RSocketServ &, TUint, TUint, RConnection &)
IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &, RSocketServ &, const TDesC &)
IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &, RSocketServ &)
IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &, RSocketServ &, RSocket &)
MBluetoothSocketNotifier &Notifier()
IMPORT_C TIntPhysicalLinkState(TUint32 &)
IMPORT_C TIntPreventLowPowerModes(TUint32)
IMPORT_C TIntPreventRoleSwitch()
IMPORT_C TIntRead(TDes8 &)
IMPORT_C TIntRecv(TDes8 &, TUint)
IMPORT_C TIntRecv(TDes8 &, TUint, TSockXfrLength &)
IMPORT_C TIntRecvFrom(TDes8 &, TSockAddr &, TUint)
IMPORT_C TIntRecvFrom(TDes8 &, TSockAddr &, TUint, TSockXfrLength &)
IMPORT_C TIntRecvOneOrMore(TDes8 &, TUint, TSockXfrLength &)
IMPORT_C voidRemoteName(TSockAddr &)
IMPORT_C TIntRequestChangeSupportedPacketTypes(TUint16)
IMPORT_C TIntRequestMasterRole()
IMPORT_C TIntRequestSlaveRole()
IMPORT_C TIntSend(const TDesC8 &, TUint)
IMPORT_C TIntSend(const TDesC8 &, TUint, TSockXfrLength &)
IMPORT_C TIntSendTo(const TDesC8 &, TSockAddr &, TUint)
IMPORT_C TIntSendTo(const TDesC8 &, TSockAddr &, TUint, TSockXfrLength &)
IMPORT_C TIntSetAutomaticSniffMode(TBool)
IMPORT_C TIntSetAutomaticSniffMode(TBool, TInt)
IMPORT_C TIntSetLocalPort(TInt)
IMPORT_C voidSetNotifier(MBluetoothSocketNotifier &)
IMPORT_C TIntSetOpt(TUint, TUint, TInt)
IMPORT_C TIntSetOpt(TUint, TUint, const TDesC8 &)
IMPORT_C TIntSetOption(TUint, TUint, const TDesC8 &)
IMPORT_C TIntShutdown(RSocket::TShutdown)
IMPORT_C TIntShutdown(RSocket::TShutdown, const TDesC8 &, TDes8 &)
RSocket &Socket()
RSocketServ &SocketServer()
IMPORT_C TIntTransfer(RSocketServ &, const TDesC &)
IMPORT_C TIntWrite(const TDesC8 &)
Private Member Functions
CBluetoothSocket(MBluetoothSocketNotifier &, RSocketServ &)
TInt AsyncDeleteCallBack(TAny *)
voidConfigureSocket()
voidConstructL(TUint, TUint)
voidConstructL(TUint, TUint, RConnection &)
voidConstructL(const TDesC &)
voidConstructL()
voidConstructL(RSocket &)
voidInitialiseL()
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
CAsyncCallBack *iAsyncDestroyer
CAutoSniffDelayTimer *iAutoSniffDelayTimer
CBTAccepter *iBTAccepter
RBTBaseband iBTBaseband
CBTBasebandChangeEventDelegate *iBTBasebandChangeEventDelegate
CBTBasebandChangeEventNotifier *iBTBasebandChangeEventNotifier
CBTBasebandManager *iBTBasebandManager
CBTConnecter *iBTConnecter
CBTIoctler *iBTIoctler
CBTReceiver *iBTReceiver
CBTSender *iBTSender
CBTShutdowner *iBTShutdowner
MBluetoothSocketNotifier *iNotifier
TUint32 iNotifierEventMask
TBool iReceiving
TBool iSending
TBTSockAddr iSockAddr
RSocketServ &iSockServer
RSocket iSocket

Constructor & Destructor Documentation

CBluetoothSocket(MBluetoothSocketNotifier &, RSocketServ &)

CBluetoothSocket(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer
)[private]

Parameters

MBluetoothSocketNotifier & aNotifier
RSocketServ & aServer

~CBluetoothSocket()

IMPORT_C~CBluetoothSocket()

Destructor

Cancels any outstanding Bluetooth socket functions and closes the socket. Note sockets should be closed or shutdown before destructor is called.

Member Functions Documentation

Accept(CBluetoothSocket &)

IMPORT_C TIntAccept(CBluetoothSocket &aBlankSocket)

Accepts a connection from a remote Bluetooth socket.

The call extracts the first pending connection on a queue of sockets, the queue size being previously specified by Listen(). On successful completion the blank socket is given the handle of the new socket and it may then be used to transfer data. After completion the accept socket may be used to make further connections with new blank sockets (see Open() on how to open a blank socket).

RSocket::Accept(CBluetoothSocket& aBlankSocket)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleAcceptCompleteL(TInt aErr)

Parameters

CBluetoothSocket & aBlankSocketA socket opened as a blank socket.

Accept(CBluetoothSocket &, TDes8 &)

IMPORT_C TIntAccept(CBluetoothSocket &aBlankSocket,
TDes8 &aConnectData
)

Reserved for future.

Parameters

CBluetoothSocket & aBlankSocketa socket opened as a blank socket.
TDes8 & aConnectDataData that may be received in connection.

ActivateBasebandEventNotifier(TUint32)

IMPORT_C TIntActivateBasebandEventNotifier(TUint32aEventTypes)

Set up notification of baseband events

Elect to be notified whenever one of a user specified selection of baseband events occurs.

The notification takes place in the pure virtual function MBluetoothSocketNotifier::HandleActivateBasebandEventNotifierCompleteL(TInt aErr, TBTBasebandEventNotification& aEventNotification)

The FIRST notification will take place ALMOST INSTANTANEOUSLY and will be A FULL DESCRIPTION (OR SNAPSHOT) OF THE CURRENT STATE OF THE PHYSICAL LINK irrespective of the specified selection of events wanted. This first notification or snapshot has NOTHING to do with a baseband event occurring. Once this snapshot has taken place, all occurrences of the specified events from the instant of the snapshot onwards will be notified until CBluetoothSocket::CancelBasebandEventNotifier() is called.

PhysicalLinkState(TUint32& aState) if only a single full description of the physical link state is required.TBTPhysicalLinkStateNotifier TBTPhysicalLinkStateNotifierCombinations

Parameters

TUint32 aEventTypesbitmask for those events for which notification is being requested (Combine elements of TBTPhysicalLinkStateNotifier and TBTPhysicalLinkStateNotifierCombinations)

ActivateParkRequester()

IMPORT_C TIntActivateParkRequester()
Activate park requestor. RBTPhysicalLinkAdapter::ActivateParkRequester()
panic
EInvalidOpWhenAutoSniffOn (10) This API is not allowed when AutoSniff is On

ActivateSniffRequester()

IMPORT_C TIntActivateSniffRequester()
RBTPhysicalLinkAdapter::ActivateSniffRequester()
panic
EInvalidOpWhenAutoSniffOn (10) This API is not allowed when AutoSniff is On

AllowLowPowerModes(TUint32)

IMPORT_C TIntAllowLowPowerModes(TUint32aLowPowerModes)

Allow low power modes.

The power modes are indicated by aLowPowerModes.

RBTPhysicalLinkAdapter::AllowLowPowerModes(TUint32 aLowPowerModes)
panic
EInvalidOpWhenAutoSniffOn (10) This API is not allowed when AutoSniff is On

Parameters

TUint32 aLowPowerModesThe low power mode.

AllowRoleSwitch()

IMPORT_C TIntAllowRoleSwitch()

Allow the socket to switch roles. RBTPhysicalLinkAdapter::AllowRoleSwitch()

AsyncDelete()

IMPORT_C voidAsyncDelete()

Asynchronous deletion of the CBluetoothSocket object.

Function will cause asynchronous deletion of CBluetoothSocket object. It should be called if associated MBluetoothSocketNotifier needs to delete CBluetoothSocket from any of its callback functions.

AsyncDeleteCallBack(TAny *)

TInt AsyncDeleteCallBack(TAny *aThisPtr)[private, static]

Parameters

TAny * aThisPtr

AutomaticSniffMode()

IMPORT_C TBoolAutomaticSniffMode()const

Reports the automatic sniff/unsniff requesting status of the socket.

BTBaseband()

RBTBaseband &BTBaseband()

BTBasebandManager()

CBTBasebandManager &BTBasebandManager()

Bind(TSockAddr &)

IMPORT_C TIntBind(TSockAddr &aSockAddr)

Sets a Bluetooth socket address.

Sets the local address of a socket. When a socket is opened it has no name associated with it, and binding is required so data can be routed to the socket. Bind() should be called before Listen() or Connect().

RSocket::Bind(TSockAddr& aAddr)

Parameters

TSockAddr & aSockAddrThe address of the socket.

CancelAccept()

IMPORT_C voidCancelAccept()

Cancels the Accept() operation. RSocket::CancelAccept()

CancelAll()

IMPORT_C voidCancelAll()

Cancels all outstanding operations.

Calling it will cause all outstanding operations to cancel. Outstanding operations for a socket include: read, write, Ioctl, connect, accept, shutdown and the Baseband event notifier. All of these operations will be completed by this call.

CancelBasebandEventNotifier()

IMPORT_C voidCancelBasebandEventNotifier()

Cancels an active baseband notifier.

No further baseband events will be notified.

If this function is called when there is no active baseband notifier, it will do nothing.

CancelConnect()

IMPORT_C voidCancelConnect()

Cancel an attempted connection.

RSocket::CancelConnect()

CancelIoctl()

IMPORT_C voidCancelIoctl()

Cancels the Ioctl() asynchronous control operation. RSocket::CancelIoctl()

CancelLowPowerModeRequester()

IMPORT_C TIntCancelLowPowerModeRequester()
Cancels the low power mode request. RBTPhysicalLinkAdapter::CancelLowPowerModeRequester()
panic
EInvalidOpWhenAutoSniffOn (10) This API is not allowed when AutoSniff is On

CancelRead()

IMPORT_C voidCancelRead()

Cancels an outstanding Read() operation.

Calling this function will cause any outstanding Read() operation to cancel. RSocket::CancelRead()

CancelRecv()

IMPORT_C voidCancelRecv()

Cancels an outstanding Recv() operation.

Calling this function will cause any outstanding receive operation to cancel.

RSocket::CancelRecv()

CancelSend()

IMPORT_C voidCancelSend()

Cancels an outstanding Bluetooth Send() operation.

Calling the function will cause an outstanding Bluetooth Send() operation to complete prematurely.

RSocket::CancelSend()

CancelWrite()

IMPORT_C voidCancelWrite()

Cancels an outstanding Write() operation.

Calling this operation will cause any outstanding Write() operation to cancel. RSocket::CancelWrite()

ConfigureSocket()

voidConfigureSocket()[private]

Connect(TBTSockAddr &)

IMPORT_C TIntConnect(TBTSockAddr &aSockAddr)

Opens a connection to a specific Bluetooth device by its address.

The address represents the address of the remote Bluetooth device. A socket may only have one connect operation outstanding at any one time. Once the connect is completed, the socket is ready to send or receive data. If a socket is unbound - i.e. Bind() has not been called yet - then it will automatically have a local address allocated.

RSocket::Connect(TBTSockAddr& aAddr)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleConnectCompleteL(TInt aErr)

Parameters

TBTSockAddr & aSockAddrThe address of the bluetooth device to which the connection is being made.

Connect(TBTSockAddr &, const TDesC8 &, TDes8 &)

IMPORT_C TIntConnect(TBTSockAddr &aSockAddr,
const TDesC8 &aConnectDataOut,
TDes8 &aConnectDataIn
)

Connects to a remote Bluetooth device by address with a defined data-out and data-in descriptor.

The address provided specifies the address of the remote Bluetooth host. Data can be sent in connect request packets, which may be provided in the data-out descriptor, or connect responses, which may be collected in the data-in descriptor.

A socket may only have one connect operation outstanding at any one time. Once the connect is completed, the socket is ready to send or receive data. If a socket is unbound - i.e. Bind() has not been called yet - then it will automatically have a local address allocated.

RSocket::Connect(TBTSockAddr& aAddr,const TDesC8& aConnectDataOut,TDes8& aConnectDataIn)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleConnectCompleteL(TInt aErr).

Parameters

TBTSockAddr & aSockAddrThe address of the remote Bluetooth device.
const TDesC8 & aConnectDataOutA descriptor containing data to be sent.
TDes8 & aConnectDataInA descriptor to receive data.

Connect(TBTSockAddr &, TUint16)

IMPORT_C TIntConnect(TBTSockAddr &aAddr,
TUint16aServiceBits
)

Sets the Service bits in the Class Of Device. If this is successful, the socket then opens a connection to a specific Bluetooth device by its address.

The address represents the address of the remote Bluetooth device. A socket may only have one connect operation outstanding at any one time. Once the connect is completed, the socket is ready to send or receive data. If a socket is unbound - i.e. Bind() has not been called yet - then it will automatically have a local address allocated.

RSocket::Connect(TBTSockAddr& aAddr)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleConnectCompleteL(TInt aErr)

Parameters

TBTSockAddr & aAddrThe address of the bluetooth device to which the connection is being made.
TUint16 aServiceBits

ConstructL(TUint, TUint)

voidConstructL(TUintaSockType,
TUintaProtocol
)[private]

Parameters

TUint aSockType
TUint aProtocol

ConstructL(TUint, TUint, RConnection &)

voidConstructL(TUintaSockType,
TUintaProtocol,
RConnection &aConnection
)[private]

Parameters

TUint aSockType
TUint aProtocol
RConnection & aConnection

ConstructL(const TDesC &)

voidConstructL(const TDesC &aName)[private]

Parameters

const TDesC & aName

ConstructL()

voidConstructL()[private]

ConstructL(RSocket &)

voidConstructL(RSocket &aSocket)[private]

Parameters

RSocket & aSocket

GetDisconnectData(TDes8 &)

IMPORT_C TIntGetDisconnectData(TDes8 &aDesc)

Parameters

TDes8 & aDescA descriptor for the disconnect data.

GetOpt(TUint, TUint, TDes8 &)

IMPORT_C TIntGetOpt(TUintaOptionName,
TUintaOptionLevel,
TDes8 &aOption
)

Gets a socket option.

The socket server has options which are generic to all sockets and protocols may add specific options.

Options available for all protocols can be got with anOptionLevel set to KSOLSocket. See individual protocol notes for other socket options.

RSocket::GetOpt(TUint aOptionName,TUint aOptionLevel,TDes8& aOption)

Parameters

TUint aOptionNameAn option identifier.
TUint aOptionLevelAn option level. Option levels 'group' related options.
TDes8 & aOptionThe option value as a descriptor.

GetOpt(TUint, TUint, TInt &)

IMPORT_C TIntGetOpt(TUintaOptionName,
TUintaOptionLevel,
TInt &aOption
)

Gets a socket option.

The socket server has options which are generic to all sockets and protocols may add specific options.

Options available for all protocols can be got with anOptionLevel set to KSOLSocket. See individual protocol notes for other socket options.

RSocket::GetOpt(TUint aOptionName,TUint aOptionLevel,TDes8& aOption)

Parameters

TUint aOptionNameAn option identifier.
TUint aOptionLevelAn option level. Option levels 'group' related options.
TInt & aOptionThe option value as an integer.

HandleAcceptCompleteL(TInt)

voidHandleAcceptCompleteL(TIntaErr)

Parameters

TInt aErr

HandleActivateBasebandEventNotifierCompleteL(TInt, TBTBasebandEventNotification)

voidHandleActivateBasebandEventNotifierCompleteL(TIntaErr,
TBTBasebandEventNotificationaEventNotification
)

Parameters

TInt aErr
TBTBasebandEventNotification aEventNotification

HandleConnectCompleteL(TInt)

voidHandleConnectCompleteL(TIntaErr)

Parameters

TInt aErr

HandleIoctlCompleteL(TInt)

voidHandleIoctlCompleteL(TIntaErr)

Parameters

TInt aErr

HandleReceiveCompleteL(TInt)

voidHandleReceiveCompleteL(TIntaErr)

Parameters

TInt aErr

HandleSendCompleteL(TInt)

voidHandleSendCompleteL(TIntaErr)

Parameters

TInt aErr

HandleShutdownCompleteL(TInt)

voidHandleShutdownCompleteL(TIntaErr)

Parameters

TInt aErr

Info(TProtocolDesc &)

IMPORT_C TIntInfo(TProtocolDesc &aProtocol)

Gets information about the protocol the socket is opened on. RSocket::Info(TProtocolDesc& aProtocol)

Parameters

TProtocolDesc & aProtocolThe protocol on which the socket is opened. Note that if the socket is a null socket, and aProtocol is a null TProtocolDesc when it is passed in, if will be null on return as well.

InitialiseL()

voidInitialiseL()[private]

Ioctl(TUint, TUint, TDes8 *)

IMPORT_C TIntIoctl(TUintaLevel,
TUintaCommand,
TDes8 *aDesc
)

Applies an asynchronous control operation on a socket.

Data may be passed and received if a descriptor address is provided as an argument. Only one Ioctl() operation may be outstanding for each socket.

RSocket::Ioctl(TUint aCommand,TDes8* aDesc,TUint aLevel)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleIoctlCompleteL(TInt aErr)

Parameters

TUint aLevelControl operation level.
TUint aCommandioctl command.
TDes8 * aDescPointer to a descriptor in which data may be sent and received on completion.

Ioctl(TUint, TDes8 *, TUint)

IMPORT_C TIntIoctl(TUintaCommand,
TDes8 *aDesc = NULL,
TUintaLevel =  KLevelUnspecified
)

Applies an asynchronous control operation on a socket.

Data may be passed and received if a descriptor address is provided as an argument. Only one Ioctl() operation may be outstanding for each socket.

RSocket::Ioctl(TUint aCommand,TDes8* aDesc,TUint aLevel)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleIoctlCompleteL(TInt aErr)

Parameters

TUint aCommandioctl command.
TDes8 * aDesc = NULLPointer to a descriptor in which data may be sent and received on completion.
TUint aLevel =  KLevelUnspecified Control operation level.

Listen(TUint)

IMPORT_C TIntListen(TUintqSize)

Sets up a socket to listen for incoming connections.

Before calling this procedure a socket should be opened using Open() and be bound to a local address using Bind().

Listen() creates a queue to hold incoming connections which can be married with blank sockets using Accept().

Once a listen queue has been created it will continue to allow peers to connect until it is full, at which point it will reject any incoming connections as specified by protocol behaviour. When a socket is accepted by the client a space is made available in the queue.

RSocket::Listen(TUint qSize)

Parameters

TUint qSizeThe number of connections allowed in the queue.

Listen(TUint, const TDesC8 &)

IMPORT_C TIntListen(TUintqSize,
const TDesC8 &aConnectData
)

Parameters

TUint qSizeThe size of the 'listen' queue.
const TDesC8 & aConnectDataThe descriptor for data sent in connection respoonses.

Listen(TUint, TUint16)

IMPORT_C TIntListen(TUintqSize,
TUint16aServiceBits
)

Sets the Service bits in the Class Of Device. If this is successful, the socket will then be set to Listen for incoming connections.

Before calling this procedure a socket should be opened using Open() and be bound to a local address using Bind().

Listen() creates a queue to hold incoming connections which can be married with blank sockets using Accept().

Once a listen queue has been created it will continue to allow peers to connect until it is full, at which point it will reject any incoming connections as specified by protocol behaviour. When a socket is accepted by the client a space is made available in the queue.

RSocket::Listen(TUint qSize)

Parameters

TUint qSizeThe number of connections allowed in the queue.
TUint16 aServiceBits

LocalName(TSockAddr &)

IMPORT_C voidLocalName(TSockAddr &aSockAddr)

Gets the local address of a socket.

The local address is set either by calling Bind() or it is automatically set when Connect() is called. If a socket is created through Accept() then a socket will inherit the port of its parent unless otherwise specified by a protocol's behaviour. RSocket::LocalName(TSockAddr& aAddr)

Parameters

TSockAddr & aSockAddrThe socket address.

LocalPort()

IMPORT_C TUintLocalPort()

Gets the local port of a socket.

Similar to LocalName().

RSocket::LocalPort()

Name(TName &)

IMPORT_C TIntName(TName &aName)

Used to get a unique name of a socket.

The name is needed when Transfer() is called.

RSocket::Name(TName& aName)

Parameters

TName & aNameThe system name of a socket.

NewL(MBluetoothSocketNotifier &, RSocketServ &, TUint, TUint)

IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer,
TUintaSockType,
TUintaProtocol
)[static]

Standard Bluetooth socket NewL constructor.

Opens a Bluetooth socket. The constructor identifies the server, socket type, and bluetooth protocol to be used for the socket, as well as an asynchronous notifier.
Pre-condition
A session on the socket server has been started.
leave
No memory, or error on opening socket.
capability
LocalServices

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock).
TUint aSockTypeOne of a set of values defined in es_sock.h, for example KSockStream.
TUint aProtocolAn entry point into the Bluetooth stack, for example KL2CAP.

NewL(MBluetoothSocketNotifier &, RSocketServ &, TUint, TUint, RConnection &)

IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer,
TUintaSockType,
TUintaProtocol,
RConnection &aConnection
)[static]
Opens a Bluetooth socket on a specified connection.
Pre-condition
A session on the socket server has been started.
leave
No memory, or error on opening socket
capability
LocalServices

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)
TUint aSockTypeOne of a set of values defined in es_sock.h, for example KSockStream
TUint aProtocolAn entry point into the Bluetooth stack, for example KL2CAP
RConnection & aConnectionA socket server management interface for a connection

NewL(MBluetoothSocketNotifier &, RSocketServ &, const TDesC &)

IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer,
const TDesC &aName
)[static]

Bluetooth socket named protocol NewL() constructor.

Opens a Bluetooth socket over a specified named protocol, such as "L2CAP".
Pre-condition
A session on the socket server has been started.
leave
No memory, or error on opening socket
capability
LocalServices

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)
const TDesC & aNameA descriptor containing the name of the protocol wanted for making a Bluetooth connection, for example _L("L2CAP")

NewL(MBluetoothSocketNotifier &, RSocketServ &)

IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer
)[static]

Bluetooth blank socket NewL() constructor.

Opens a blank socket to be used when accepting an incoming connection. This socket should be used as the parameter when a listening socket calls CBluetoothSocket::Accept(CBluetoothSocket& aBlankSocket). When that connection completes this blank socket becomes the Bluetooth socket for that connection.

Pre-condition
A session on the socket server has been started.
leave
No memory, or error on opening socket

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)

NewL(MBluetoothSocketNotifier &, RSocketServ &, RSocket &)

IMPORT_C CBluetoothSocket *NewL(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer,
RSocket &aSocket
)[static]

Bluetooth socket using an existing RSocket instance constructor.

Takes ownership of an existing socket to be used as the underlying connection for this Socket wrapper. This should be used where an existing API returned a RSocket representing a Bluetooth connection.

Pre-condition
A session on the socket server has been started, and aSocket is open and is set as "Transferable" through the KSOEnableTransfer SetOpt.
leave
No memory

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)
RSocket & aSocketA handle to an existing socket.

NewLC(MBluetoothSocketNotifier &, RSocketServ &, TUint, TUint)

IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer,
TUintaSockType,
TUintaProtocol
)[static]

Standard Bluetooth socket NewLC constructor.

Opens a Bluetooth socket as with the NewL() above, but leaves the returned CBluetoothSocket object on the cleanup stack.

capability
LocalServices

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)
TUint aSockTypeOne of a set of values defined in es_sock.h, for example KSockStream
TUint aProtocolAn entry point into the Bluetooth stack, for example KL2CAP

NewLC(MBluetoothSocketNotifier &, RSocketServ &, TUint, TUint, RConnection &)

IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer,
TUintaSockType,
TUintaProtocol,
RConnection &aConnection
)[static]

This constructor opens a Bluetooth socket on a specified connection.

Leaves the socket on the cleanup stack.

capability
LocalServices

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)
TUint aSockTypeOne of a set of values defined in es_sock.h, for example KSockStream
TUint aProtocolAn entry point into the Bluetooth stack, for example KL2CAP
RConnection & aConnectionA socket server management interface for a connection

NewLC(MBluetoothSocketNotifier &, RSocketServ &, const TDesC &)

IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer,
const TDesC &aName
)[static]

Bluetooth socket named protocol NewLC() constructor.

Opens a Bluetooth socket over a specified named protocol, such as "L2CAP". Leaves returned CBluetoothSocket object on the cleanup stack.

capability
LocalServices

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)
const TDesC & aNameA descriptor containing the name of the protocol wanted for making a Bluetooth connection, for example _L("L2CAP")

NewLC(MBluetoothSocketNotifier &, RSocketServ &)

IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer
)[static]

Bluetooth blank socket NewLC() constructor

Opens a blank socket to be used when accepting an incoming connection. This socket should be used as the parameter when a listening socket calls CBluetoothSocket::Accept(CBluetoothSocket& aBlankSocket). When that connection completes this blank socket becomes the Bluetooth socket for that connection.

Leaves returned CBluetoothSocket object on the cleanup stack.

Pre-condition
A session on the socket server has been started.
leave
No memory, or error on opening socket

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)

NewLC(MBluetoothSocketNotifier &, RSocketServ &, RSocket &)

IMPORT_C CBluetoothSocket *NewLC(MBluetoothSocketNotifier &aNotifier,
RSocketServ &aServer,
RSocket &aSocket
)[static]

Bluetooth socket using an existing RSocket instance constructor.

Takes ownership of an existing socket to be used as the underlying connection for this Socket wrapper. This should be used where an existing API returned a RSocket representing a Bluetooth connection.

Leaves returned CBluetoothSocket object on the cleanup stack.

Pre-condition
A session on the socket server has been started, and aSocket is open and is set as "Transferable" through the KSOEnableTransfer SetOpt.
leave
No memory

Parameters

MBluetoothSocketNotifier & aNotifierThe object which will receive asynchronous events.
RSocketServ & aServerA handle to an existing session on the socket server (ESock)
RSocket & aSocketA handle to an existing socket.

Notifier()

MBluetoothSocketNotifier &Notifier()

PhysicalLinkState(TUint32 &)

IMPORT_C TIntPhysicalLinkState(TUint32 &aState)

Parameters

TUint32 & aStateThe state of the physical link.

PreventLowPowerModes(TUint32)

IMPORT_C TIntPreventLowPowerModes(TUint32aLowPowerModes)
Prevents low power modes from being activated. RBTPhysicalLinkAdapter::PreventLowPowerModes(TUint32 aLowPowerModes)
panic
EInvalidOpWhenAutoSniffOn (10) This API is not allowed when AutoSniff is On

Parameters

TUint32 aLowPowerModesThe low power mode being prevented.

PreventRoleSwitch()

IMPORT_C TIntPreventRoleSwitch()

Role switching is not allowed. RBTPhysicalLinkAdapter::PreventRoleSwitch()

Read(TDes8 &)

IMPORT_C TIntRead(TDes8 &aDesc)

Receives data from a remote Bluetooth host.

Read() is only used with a connected Bluetooth host.

When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleReceiveCompleteL(TInt aErr) RSocket::Read(TDes8& aDesc)

Parameters

TDes8 & aDescA descriptor for the data being read.

Recv(TDes8 &, TUint)

IMPORT_C TIntRecv(TDes8 &aDesc,
TUintflags
)

Receives data from a remote Bluetooth device.

When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleReceiveCompleteL(TInt aErr) RSocket::Recv(TDes8& aDesc,TUint flags)

Parameters

TDes8 & aDescA descriptor for the information being sent to the remote Bluetooth device.
TUint flagsBluetooth information flags.

Recv(TDes8 &, TUint, TSockXfrLength &)

IMPORT_C TIntRecv(TDes8 &aDesc,
TUintflags,
TSockXfrLength &aLen
)

Receives data from a remote Bluetooth device.

When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleReceiveCompleteL(TInt aErr) RSocket::Recv(TDes8& aDesc,TUint flags, TSockXfrLength& aLen)

Parameters

TDes8 & aDescA descriptor for the information being sent to the remote Bluetooth device.
TUint flagsBluetooth information flags.
TSockXfrLength & aLenA length indicating how much data was read. This is the same as length of the returned aDesc.

RecvFrom(TDes8 &, TSockAddr &, TUint)

IMPORT_C TIntRecvFrom(TDes8 &aDesc,
TSockAddr &aSockAddr,
TUintflags
)

Receives aDesc data from the named remote aAddr Bluetooth device using the flags indicated.

RSocket::RecvFrom(TDes8& aDesc,TSockAddr& aAddr,TUint flags)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleReceiveCompleteL(TInt aErr)

Parameters

TDes8 & aDescA descriptor for the data being received.
TSockAddr & aSockAddrThe address of the Bluetooth device.
TUint flagsThe Bluetooth flags.

RecvFrom(TDes8 &, TSockAddr &, TUint, TSockXfrLength &)

IMPORT_C TIntRecvFrom(TDes8 &aDesc,
TSockAddr &aSockAddr,
TUintflags,
TSockXfrLength &aLen
)

Receives aDesc data from the named remote aAddr Bluetooth device using the flags indicated.

RSocket::RecvFrom(TDes8& aDesc,TSockAddr& aAddr,TUint flags,TSockXfrLength& aLen)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleReceiveCompleteL(TInt aErr)

Parameters

TDes8 & aDescA descriptor for the data being received.
TSockAddr & aSockAddrThe address of the Bluetooth device.
TUint flagsThe Bluetooth flags.
TSockXfrLength & aLenAn integer representing the length of the message.

RecvOneOrMore(TDes8 &, TUint, TSockXfrLength &)

IMPORT_C TIntRecvOneOrMore(TDes8 &aDesc,
TUintflags,
TSockXfrLength &aLen
)

Receives data from a remote Bluetooth device, completing when data is available.

When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleReceiveCompleteL(TInt aErr). RSocket::RecvOneOrMore(TDes8& aDesc,TUint flags,TSockXfrLength& aLen)

Parameters

TDes8 & aDescA descriptor for the information being sent to the remote Bluetooth device.
TUint flagsBluetooth information flags.
TSockXfrLength & aLenA length indicating how much data was read. This is the same as length of the returned aDesc.

RemoteName(TSockAddr &)

IMPORT_C voidRemoteName(TSockAddr &aSockAddr)

Gets the remote address of a socket.

The remote name (address) of a socket is associated with the remote host the socket is connected to. The remote name is only valid for a connected socket. A socket is either connected through calling Connect() or Accept().

RSocket::RemoteName(TSockAddr& aAddr)

Parameters

TSockAddr & aSockAddrThe remote socket address.

RequestChangeSupportedPacketTypes(TUint16)

IMPORT_C TIntRequestChangeSupportedPacketTypes(TUint16aPacketTypes)

Parameters

TUint16 aPacketTypes

RequestMasterRole()

IMPORT_C TIntRequestMasterRole()

Request the socket take on the master role. RBTPhysicalLinkAdapter::RequestMasterRole()

RequestSlaveRole()

IMPORT_C TIntRequestSlaveRole()

Request the socket take on a slave role. RBTPhysicalLinkAdapter::RequestSlaveRole()

Send(const TDesC8 &, TUint)

IMPORT_C TIntSend(const TDesC8 &aDesc,
TUintsomeFlags
)

Sends data to a remote bluetooth device.

The Send() operation checks that another Send() operation isn't already in progress before sending.

When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleSendCompleteL(TInt aErr).

If Automatic Sniff Mode is active, using this function will not automatically put the link into active mode. If it is required that the link be taken out of sniff mode automatically when data is to be sent then the CBluetoothSocket::Write(const TDesC8& aDesc) function should be used instead.

RSocket::Send(const TDesC8& aDesc,TUint someFlags,TRequestStatus& aStatus)

Parameters

const TDesC8 & aDescA descriptor for the data being sent to the remote device.
TUint someFlagsBluetooth specific flags.

Send(const TDesC8 &, TUint, TSockXfrLength &)

IMPORT_C TIntSend(const TDesC8 &aDesc,
TUintsomeFlags,
TSockXfrLength &aLen
)

Sends data to a remote bluetooth device.

The Send() operation checks that another Send() operation isn't already in progress before sending.

When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleSendCompleteL(TInt aErr)

If Automatic Sniff Mode is active, using this function will not automatically put the link into active mode. If it is required that the link be taken out of sniff mode automatically when data is to be sent then the CBluetoothSocket::Write(const TDesC8& aDesc) function should be used instead.

RSocket::Send(const TDesC8& aDesc,TUint someFlags,TSockXfrLength& aLen)

Parameters

const TDesC8 & aDescA descriptor for the data being sent to the remote device.
TUint someFlagsBluetooth specific flags.
TSockXfrLength & aLenAmount of data being sent.

SendTo(const TDesC8 &, TSockAddr &, TUint)

IMPORT_C TIntSendTo(const TDesC8 &aDesc,
TSockAddr &aSockAddr,
TUintflags
)

Sends the aDesc data to the aAddr specified and applies the flags indicated to the operation.

RSocket::SendTo(const TDesC8& aDesc,TSockAddr& aAddr,TUint flags)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleSendCompleteL(TInt aErr)

If Automatic Sniff Mode is active, using this function will not automatically put the link into active mode. If it is required that the link be taken out of sniff mode automatically when data is to be sent then the CBluetoothSocket::Write(const TDesC8& aDesc) function should be used instead.

Parameters

const TDesC8 & aDescA descriptor for the data being sent.
TSockAddr & aSockAddrThe address of the Bluetooth device.
TUint flagsThe Bluetooth flags.

SendTo(const TDesC8 &, TSockAddr &, TUint, TSockXfrLength &)

IMPORT_C TIntSendTo(const TDesC8 &aDesc,
TSockAddr &aSockAddr,
TUintflags,
TSockXfrLength &aLen
)

Sends the aDesc data to the aAddr specified and applies the flags indicated to the operation.

RSocket::SendTo(const TDesC8& aDesc,TSockAddr& aAddr,TUint flags,TSockXfrLength& aLen)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleSendCompleteL(TInt aErr)

If Automatic Sniff Mode is active, using this function will not automatically put the link into active mode. If it is required that the link be taken out of sniff mode automatically when data is to be sent then the CBluetoothSocket::Write(const TDesC8& aDesc) function should be used instead.

Parameters

const TDesC8 & aDescA descriptor for the data being sent.
TSockAddr & aSockAddrThe address of the Bluetooth device.
TUint flagsThe Bluetooth flags.
TSockXfrLength & aLenAn integer representing the length of the message.

SetAutomaticSniffMode(TBool)

IMPORT_C TIntSetAutomaticSniffMode(TBoolaAutoSniffMode)

Sets up automatic sniff/unsniff requesting for the socket.

If Automatic Sniff requesting is being selected, a timer with default delay in seconds before the idle socket will request the link to go into sniff mode. The CBluetoothSocket::Write() method will clear an outstanding sniff requester and start the CAutoSniffDelayTimer active object which will issue another request for sniff mode once it times out.

If Automatic Sniff requesting is being deselected, a previous sniff requester will be cancelled.

If Automatic Sniff requesting is selected when it is already active, no change will be performed and KErrInUse will be returned

Parameters

TBool aAutoSniffModeETrue if Automatic Sniff/Unsniff requests are required.

SetAutomaticSniffMode(TBool, TInt)

IMPORT_C TIntSetAutomaticSniffMode(TBoolaAutoSniffMode,
TIntaIdleSecondsBeforeSniffRequest
)

Sets up automatic sniff/unsniff requesting for the socket.

If Automatic Sniff requesting is being selected, supply the delay in seconds required before the idle socket will request the link to go into sniff mode. The CBluetoothSocket::Write() method will clear an outstanding sniff requester and start the CAutoSniffDelayTimer active object which will issue another request for sniff mode once it times out.

If Automatic Sniff requesting is being deselected, a previous sniff requester will be cancelled.

If Automatic Sniff requesting is selected when it is already active, no change will be performed and KErrInUse will be returned

Parameters

TBool aAutoSniffModeETrue if Automatic Sniff/Unsniff requests are required.
TInt aIdleSecondsBeforeSniffRequestA delay after the socket becomes idle before it will request sniff mode.

SetLocalPort(TInt)

IMPORT_C TIntSetLocalPort(TIntaPort)

Sets the local port of a Bluetooth socket.

Setting the local port is equivalent to calling Bind() with only the port set in the address.

RSocket::SetLocalPort(TInt aPort)

Parameters

TInt aPortThe socket port.

SetNotifier(MBluetoothSocketNotifier &)

IMPORT_C voidSetNotifier(MBluetoothSocketNotifier &aNewNotifier)

Changes the owner (receiver of notifications) of the socket.

The previous notifier will not be deleted after the change has been made.

Parameters

MBluetoothSocketNotifier & aNewNotifierThe object which will receive asynchronous events.

SetOpt(TUint, TUint, TInt)

IMPORT_C TIntSetOpt(TUintaOptionName,
TUintaOptionLevel,
TIntaOption
)

Sets a socket option.

The socket server has options which are generic to all sockets and protocols may add specific options.

Options available for all protocols can be set with anOptionLevel set to KSOLSocket. See individual protocol notes for other socket options.

RSocket::SetOpt(TUint aOptionName, TUint aOptionLevel,const TDesC8& aOption)

Parameters

TUint aOptionNameAn option identifier.
TUint aOptionLevelAn option level. Option levels 'group' related options.
TInt aOptionThe option value as an integer.

SetOpt(TUint, TUint, const TDesC8 &)

IMPORT_C TIntSetOpt(TUintaOptionName,
TUintaOptionLevel,
const TDesC8 &aOption =  TPtrC8(NULL, 0)
)

Sets a socket option.

The socket server has options which are generic to all sockets and protocols may add specific options.

Options available for all protocols can be set with anOptionLevel set to KSOLSocket. See individual protocol notes for other socket options.

RSocket::SetOpt(TUint aOptionName, TUint aOptionLevel,const TDesC8& aOption)

Parameters

TUint aOptionNameAn option identifier.
TUint aOptionLevelAn option level. Option levels 'group' related options.
const TDesC8 & aOption =  TPtrC8(NULL, 0)The option value as a descriptor.

SetOption(TUint, TUint, const TDesC8 &)

IMPORT_C TIntSetOption(TUintaOptionName,
TUintaOptionLevel,
const TDesC8 &aOption
)

Sets a socket option.

The socket server has options which are generic to all sockets and protocols may add specific options.

Options available for all protocols can be set with anOptionLevel set to KSOLSocket. See individual protocol notes for other socket options.

RSocket::SetOpt(TUint aOptionName, TUint aOptionLevel,const TDesC8& aOption)

Parameters

TUint aOptionNameAn option identifier.
TUint aOptionLevelAn option level. Option levels 'group' related options.
const TDesC8 & aOptionThe option value as a descriptor.

Shutdown(RSocket::TShutdown)

IMPORT_C TIntShutdown(RSocket::TShutdownaHow)

Shuts down a connected socket. (The socket cannot be null. CBluetoothSocket::Info.)The shutdown method allows input and output to be individually stopped for a protocol endpoint.

RSocket::Shutdown(RSocket::TShutdown aHow)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleShutdownCompleteL(TInt aErr)

Parameters

RSocket::TShutdown aHowShutdown option. All variants complete when a socket is disconnected.

Shutdown(RSocket::TShutdown, const TDesC8 &, TDes8 &)

IMPORT_C TIntShutdown(RSocket::TShutdownaHow,
const TDesC8 &aDisconnectDataOut,
TDes8 &aDisconnectDataIn
)

Reserved for future. The socket must not be null. (CBluetoothSocket::Info.) RSocket::Shutdown(RSocket::TShutdown aHow,const TDesC8& aDisconnectDataOut,TDes8& aDisconnectDataIn)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleShutdownCompleteL(TInt aErr)

Parameters

RSocket::TShutdown aHowShutdown option. All variants complete when a socket is disconnected.
const TDesC8 & aDisconnectDataOutA descriptor to send data.
TDes8 & aDisconnectDataInA descriptor to recive data.

Socket()

RSocket &Socket()

SocketServer()

RSocketServ &SocketServer()

Transfer(RSocketServ &, const TDesC &)

IMPORT_C TIntTransfer(RSocketServ &aServer,
const TDesC &aName
)

Transfers a socket from one socket server session to another.

It creates the socket in the target session, and removes the socket from the source session. The call is made on an uninitialised RSocket object. The socket system name 'Name()' is used to identify the socket to transfer.

If the call fails, the socket that is being transferred remains with the original session. Success or failure can be checked on the originating socket by calling Info(), which returns KErrNone if the transfer failed, and KErrBadHandle if it succeeded.

RSocket::Transfer(RSocketServ& aServer, const TDesC& aName)

Parameters

RSocketServ & aServerThe session to which the socket is being transfered
const TDesC & aNameThe system name of the socket being transfered.

Write(const TDesC8 &)

IMPORT_C TIntWrite(const TDesC8 &aDesc)

Writes to a remote Bluetooth device

RSocket::Write(const TDesC8& aDesc)When this request completes, notification is sent to the MBluetoothSocketNotifier object supplied when this CBluetoothSocket was constructed. This is done in the function MBluetoothSocketNotifier::HandleSendCompleteL(TInt aErr)

If Automatic Sniff Mode is active on this socket instance, then upon calling this function the link will be put into active mode. If no CBluetoothSocket::Write() calls are made for a period of the timeout specified during activation of the automatic sniffing then the link will be put back into sniff mode. CBluetoothSocket::SetAutomaticSniffMode(TBool aAutoSniffMode, TInt aIdleSecondsBeforeSniffRequest) CBluetoothSocket::SetAutomaticSniffMode(TBool aAutoSniffMode)

Parameters

const TDesC8 & aDescA descriptor for the data being sent to the remote Bluetooth device.

Member Data Documentation

CAsyncCallBack * iAsyncDestroyer

CAsyncCallBack *iAsyncDestroyer[private]

CAutoSniffDelayTimer * iAutoSniffDelayTimer

CAutoSniffDelayTimer *iAutoSniffDelayTimer[private]

CBTAccepter * iBTAccepter

CBTAccepter *iBTAccepter[private]

RBTBaseband iBTBaseband

RBTBaseband iBTBaseband[private]

CBTBasebandChangeEventDelegate * iBTBasebandChangeEventDelegate

CBTBasebandChangeEventDelegate *iBTBasebandChangeEventDelegate[private]

CBTBasebandChangeEventNotifier * iBTBasebandChangeEventNotifier

CBTBasebandChangeEventNotifier *iBTBasebandChangeEventNotifier[private]

CBTBasebandManager * iBTBasebandManager

CBTBasebandManager *iBTBasebandManager[private]

CBTConnecter * iBTConnecter

CBTConnecter *iBTConnecter[private]

CBTIoctler * iBTIoctler

CBTIoctler *iBTIoctler[private]

CBTReceiver * iBTReceiver

CBTReceiver *iBTReceiver[private]

CBTSender * iBTSender

CBTSender *iBTSender[private]

CBTShutdowner * iBTShutdowner

CBTShutdowner *iBTShutdowner[private]

MBluetoothSocketNotifier * iNotifier

MBluetoothSocketNotifier *iNotifier[private]

TUint32 iNotifierEventMask

TUint32 iNotifierEventMask[private]

TBool iReceiving

TBool iReceiving[private]

TBool iSending

TBool iSending[private]

TBTSockAddr iSockAddr

TBTSockAddr iSockAddr[private]

RSocketServ & iSockServer

RSocketServ &iSockServer[private]

RSocket iSocket

RSocket iSocket[private]