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
Private Member Functions | |
---|---|
CBluetoothSocket(MBluetoothSocketNotifier &, RSocketServ &) | |
TInt | AsyncDeleteCallBack(TAny *) |
void | ConfigureSocket() |
void | ConstructL(TUint, TUint) |
void | ConstructL(TUint, TUint, RConnection &) |
void | ConstructL(const TDesC &) |
void | ConstructL() |
void | ConstructL(RSocket &) |
void | InitialiseL() |
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 |
CBluetoothSocket | ( | MBluetoothSocketNotifier & | aNotifier, |
RSocketServ & | aServer | ||
) | [private] |
MBluetoothSocketNotifier & aNotifier | |
RSocketServ & aServer |
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.
IMPORT_C TInt | Accept | ( | 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)
CBluetoothSocket & aBlankSocket | A socket opened as a blank socket. |
IMPORT_C TInt | Accept | ( | CBluetoothSocket & | aBlankSocket, |
TDes8 & | aConnectData | |||
) |
Reserved for future.
CBluetoothSocket & aBlankSocket | a socket opened as a blank socket. |
TDes8 & aConnectData | Data that may be received in connection. |
IMPORT_C TInt | ActivateBasebandEventNotifier | ( | TUint32 | aEventTypes | ) |
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
TUint32 aEventTypes | bitmask for those events for which notification is being requested (Combine elements of TBTPhysicalLinkStateNotifier and TBTPhysicalLinkStateNotifierCombinations) |
IMPORT_C TInt | ActivateParkRequester | ( | ) |
IMPORT_C TInt | ActivateSniffRequester | ( | ) |
IMPORT_C TInt | AllowLowPowerModes | ( | TUint32 | aLowPowerModes | ) |
Allow low power modes.
The power modes are indicated by aLowPowerModes.
TUint32 aLowPowerModes | The low power mode. |
IMPORT_C TInt | AllowRoleSwitch | ( | ) |
Allow the socket to switch roles. RBTPhysicalLinkAdapter::AllowRoleSwitch()
IMPORT_C void | AsyncDelete | ( | ) |
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.
TInt | AsyncDeleteCallBack | ( | TAny * | aThisPtr | ) | [private, static] |
TAny * aThisPtr |
IMPORT_C TBool | AutomaticSniffMode | ( | ) | const |
Reports the automatic sniff/unsniff requesting status of the socket.
IMPORT_C TInt | Bind | ( | TSockAddr & | aSockAddr | ) |
TSockAddr & aSockAddr | The address of the socket. |
IMPORT_C void | CancelAll | ( | ) |
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.
IMPORT_C void | CancelBasebandEventNotifier | ( | ) |
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.
IMPORT_C void | CancelIoctl | ( | ) |
Cancels the Ioctl() asynchronous control operation. RSocket::CancelIoctl()
IMPORT_C TInt | CancelLowPowerModeRequester | ( | ) |
IMPORT_C void | CancelRead | ( | ) |
Cancels an outstanding Read() operation.
Calling this function will cause any outstanding Read() operation to cancel. RSocket::CancelRead()
IMPORT_C void | CancelRecv | ( | ) |
Cancels an outstanding Recv() operation.
Calling this function will cause any outstanding receive operation to cancel.
IMPORT_C void | CancelSend | ( | ) |
IMPORT_C void | CancelWrite | ( | ) |
Cancels an outstanding Write() operation.
Calling this operation will cause any outstanding Write() operation to cancel. RSocket::CancelWrite()
IMPORT_C TInt | Connect | ( | 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)
TBTSockAddr & aSockAddr | The address of the bluetooth device to which the connection is being made. |
IMPORT_C TInt | Connect | ( | 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).
TBTSockAddr & aSockAddr | The address of the remote Bluetooth device. |
const TDesC8 & aConnectDataOut | A descriptor containing data to be sent. |
TDes8 & aConnectDataIn | A descriptor to receive data. |
IMPORT_C TInt | Connect | ( | TBTSockAddr & | aAddr, |
TUint16 | aServiceBits | |||
) |
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)
TBTSockAddr & aAddr | The address of the bluetooth device to which the connection is being made. |
TUint16 aServiceBits |
void | ConstructL | ( | TUint | aSockType, |
TUint | aProtocol, | |||
RConnection & | aConnection | |||
) | [private] |
TUint aSockType | |
TUint aProtocol | |
RConnection & aConnection |
IMPORT_C TInt | GetDisconnectData | ( | TDes8 & | aDesc | ) |
TDes8 & aDesc | A descriptor for the disconnect data. |
IMPORT_C TInt | GetOpt | ( | TUint | aOptionName, |
TUint | aOptionLevel, | |||
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)
IMPORT_C TInt | GetOpt | ( | TUint | aOptionName, |
TUint | aOptionLevel, | |||
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)
void | HandleActivateBasebandEventNotifierCompleteL | ( | TInt | aErr, |
TBTBasebandEventNotification | aEventNotification | |||
) |
TInt aErr | |
TBTBasebandEventNotification aEventNotification |
IMPORT_C TInt | Info | ( | TProtocolDesc & | aProtocol | ) |
Gets information about the protocol the socket is opened on. RSocket::Info(TProtocolDesc& aProtocol)
TProtocolDesc & aProtocol | The 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. |
IMPORT_C TInt | Ioctl | ( | TUint | aLevel, |
TUint | aCommand, | |||
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)
IMPORT_C TInt | Ioctl | ( | TUint | aCommand, |
TDes8 * | aDesc = NULL, | |||
TUint | aLevel = 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)
TUint aCommand | ioctl command. |
TDes8 * aDesc = NULL | Pointer to a descriptor in which data may be sent and received on completion. |
TUint aLevel = KLevelUnspecified | Control operation level. |
IMPORT_C TInt | Listen | ( | TUint | qSize | ) |
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.
TUint qSize | The number of connections allowed in the queue. |
IMPORT_C TInt | Listen | ( | TUint | qSize, |
const TDesC8 & | aConnectData | |||
) |
Reserved for future.
IMPORT_C TInt | Listen | ( | TUint | qSize, |
TUint16 | aServiceBits | |||
) |
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.
IMPORT_C void | LocalName | ( | 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)
TSockAddr & aSockAddr | The socket address. |
IMPORT_C TInt | Name | ( | TName & | aName | ) |
Used to get a unique name of a socket.
The name is needed when Transfer() is called.
TName & aName | The system name of a socket. |
IMPORT_C CBluetoothSocket * | NewL | ( | MBluetoothSocketNotifier & | aNotifier, |
RSocketServ & | aServer, | |||
TUint | aSockType, | |||
TUint | aProtocol | |||
) | [static] |
Standard Bluetooth socket NewL constructor.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock). |
TUint aSockType | One of a set of values defined in es_sock.h, for example KSockStream. |
TUint aProtocol | An entry point into the Bluetooth stack, for example KL2CAP. |
IMPORT_C CBluetoothSocket * | NewL | ( | MBluetoothSocketNotifier & | aNotifier, |
RSocketServ & | aServer, | |||
TUint | aSockType, | |||
TUint | aProtocol, | |||
RConnection & | aConnection | |||
) | [static] |
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
TUint aSockType | One of a set of values defined in es_sock.h, for example KSockStream |
TUint aProtocol | An entry point into the Bluetooth stack, for example KL2CAP |
RConnection & aConnection | A socket server management interface for a connection |
IMPORT_C CBluetoothSocket * | NewL | ( | MBluetoothSocketNotifier & | aNotifier, |
RSocketServ & | aServer, | |||
const TDesC & | aName | |||
) | [static] |
Bluetooth socket named protocol NewL() constructor.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
const TDesC & aName | A descriptor containing the name of the protocol wanted for making a Bluetooth connection, for example _L("L2CAP") |
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.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
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.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
RSocket & aSocket | A handle to an existing socket. |
IMPORT_C CBluetoothSocket * | NewLC | ( | MBluetoothSocketNotifier & | aNotifier, |
RSocketServ & | aServer, | |||
TUint | aSockType, | |||
TUint | aProtocol | |||
) | [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.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
TUint aSockType | One of a set of values defined in es_sock.h, for example KSockStream |
TUint aProtocol | An entry point into the Bluetooth stack, for example KL2CAP |
IMPORT_C CBluetoothSocket * | NewLC | ( | MBluetoothSocketNotifier & | aNotifier, |
RSocketServ & | aServer, | |||
TUint | aSockType, | |||
TUint | aProtocol, | |||
RConnection & | aConnection | |||
) | [static] |
This constructor opens a Bluetooth socket on a specified connection.
Leaves the socket on the cleanup stack.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
TUint aSockType | One of a set of values defined in es_sock.h, for example KSockStream |
TUint aProtocol | An entry point into the Bluetooth stack, for example KL2CAP |
RConnection & aConnection | A socket server management interface for a connection |
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.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
const TDesC & aName | A descriptor containing the name of the protocol wanted for making a Bluetooth connection, for example _L("L2CAP") |
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.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
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.
MBluetoothSocketNotifier & aNotifier | The object which will receive asynchronous events. |
RSocketServ & aServer | A handle to an existing session on the socket server (ESock) |
RSocket & aSocket | A handle to an existing socket. |
IMPORT_C TInt | PhysicalLinkState | ( | TUint32 & | aState | ) |
Get the state of the physical link. RBTPhysicalLinkAdapter::PhysicalLinkState(TUint32& aState)
TUint32 & aState | The state of the physical link. |
IMPORT_C TInt | PreventLowPowerModes | ( | TUint32 | aLowPowerModes | ) |
TUint32 aLowPowerModes | The low power mode being prevented. |
IMPORT_C TInt | PreventRoleSwitch | ( | ) |
Role switching is not allowed. RBTPhysicalLinkAdapter::PreventRoleSwitch()
IMPORT_C TInt | Read | ( | 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)
TDes8 & aDesc | A descriptor for the data being read. |
IMPORT_C TInt | Recv | ( | TDes8 & | aDesc, |
TUint | flags | |||
) |
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)
IMPORT_C TInt | Recv | ( | TDes8 & | aDesc, |
TUint | flags, | |||
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)
TDes8 & aDesc | A descriptor for the information being sent to the remote Bluetooth device. |
TUint flags | Bluetooth information flags. |
TSockXfrLength & aLen | A length indicating how much data was read. This is the same as length of the returned aDesc. |
IMPORT_C TInt | RecvFrom | ( | TDes8 & | aDesc, |
TSockAddr & | aSockAddr, | |||
TUint | flags | |||
) |
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)
IMPORT_C TInt | RecvFrom | ( | TDes8 & | aDesc, |
TSockAddr & | aSockAddr, | |||
TUint | flags, | |||
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)
TDes8 & aDesc | A descriptor for the data being received. |
TSockAddr & aSockAddr | The address of the Bluetooth device. |
TUint flags | The Bluetooth flags. |
TSockXfrLength & aLen | An integer representing the length of the message. |
IMPORT_C TInt | RecvOneOrMore | ( | TDes8 & | aDesc, |
TUint | flags, | |||
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)
TDes8 & aDesc | A descriptor for the information being sent to the remote Bluetooth device. |
TUint flags | Bluetooth information flags. |
TSockXfrLength & aLen | A length indicating how much data was read. This is the same as length of the returned aDesc. |
IMPORT_C void | RemoteName | ( | TSockAddr & | aSockAddr | ) |
TSockAddr & aSockAddr | The remote socket address. |
IMPORT_C TInt | RequestChangeSupportedPacketTypes | ( | TUint16 | aPacketTypes | ) |
Request to change the supported packet types. RBTPhysicalLinkAdapter::RequestChangeSupportedPacketTypes(TUint16 aPacketTypes)
TUint16 aPacketTypes |
IMPORT_C TInt | RequestMasterRole | ( | ) |
Request the socket take on the master role. RBTPhysicalLinkAdapter::RequestMasterRole()
IMPORT_C TInt | RequestSlaveRole | ( | ) |
Request the socket take on a slave role. RBTPhysicalLinkAdapter::RequestSlaveRole()
IMPORT_C TInt | Send | ( | const TDesC8 & | aDesc, |
TUint | someFlags | |||
) |
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)
IMPORT_C TInt | Send | ( | const TDesC8 & | aDesc, |
TUint | someFlags, | |||
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)
const TDesC8 & aDesc | A descriptor for the data being sent to the remote device. |
TUint someFlags | Bluetooth specific flags. |
TSockXfrLength & aLen | Amount of data being sent. |
IMPORT_C TInt | SendTo | ( | const TDesC8 & | aDesc, |
TSockAddr & | aSockAddr, | |||
TUint | flags | |||
) |
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.
IMPORT_C TInt | SendTo | ( | const TDesC8 & | aDesc, |
TSockAddr & | aSockAddr, | |||
TUint | flags, | |||
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.
const TDesC8 & aDesc | A descriptor for the data being sent. |
TSockAddr & aSockAddr | The address of the Bluetooth device. |
TUint flags | The Bluetooth flags. |
TSockXfrLength & aLen | An integer representing the length of the message. |
IMPORT_C TInt | SetAutomaticSniffMode | ( | TBool | aAutoSniffMode | ) |
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
TBool aAutoSniffMode | ETrue if Automatic Sniff/Unsniff requests are required. |
IMPORT_C TInt | SetAutomaticSniffMode | ( | TBool | aAutoSniffMode, |
TInt | aIdleSecondsBeforeSniffRequest | |||
) |
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
IMPORT_C TInt | SetLocalPort | ( | TInt | aPort | ) |
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.
TInt aPort | The socket port. |
IMPORT_C void | SetNotifier | ( | MBluetoothSocketNotifier & | aNewNotifier | ) |
Changes the owner (receiver of notifications) of the socket.
The previous notifier will not be deleted after the change has been made.
MBluetoothSocketNotifier & aNewNotifier | The object which will receive asynchronous events. |
IMPORT_C TInt | SetOpt | ( | TUint | aOptionName, |
TUint | aOptionLevel, | |||
TInt | 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)
IMPORT_C TInt | SetOpt | ( | TUint | aOptionName, |
TUint | aOptionLevel, | |||
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)
IMPORT_C TInt | SetOption | ( | TUint | aOptionName, |
TUint | aOptionLevel, | |||
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)
IMPORT_C TInt | Shutdown | ( | RSocket::TShutdown | aHow | ) |
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)
RSocket::TShutdown aHow | Shutdown option. All variants complete when a socket is disconnected. |
IMPORT_C TInt | Shutdown | ( | RSocket::TShutdown | aHow, |
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)
RSocket::TShutdown aHow | Shutdown option. All variants complete when a socket is disconnected. |
const TDesC8 & aDisconnectDataOut | A descriptor to send data. |
TDes8 & aDisconnectDataIn | A descriptor to recive data. |
IMPORT_C TInt | Transfer | ( | 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.
RSocketServ & aServer | The session to which the socket is being transfered |
const TDesC & aName | The system name of the socket being transfered. |
IMPORT_C TInt | Write | ( | 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)
const TDesC8 & aDesc | A descriptor for the data being sent to the remote Bluetooth device. |
CBTBasebandChangeEventDelegate * | iBTBasebandChangeEventDelegate | [private] |
CBTBasebandChangeEventNotifier * | iBTBasebandChangeEventNotifier | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.