#include <bt_sock.h>
class RBTPhysicalLinkAdapter |
Public Member Functions | |
---|---|
RBTPhysicalLinkAdapter() | |
IMPORT_C TInt | ActivateActiveRequester() |
IMPORT_C TInt | ActivateParkRequester() |
IMPORT_C TInt | ActivateSniffRequester() |
IMPORT_C TInt | AllowLowPowerModes(TUint32) |
IMPORT_C TInt | AllowRoleSwitch() |
IMPORT_C TInt | Authenticate() |
IMPORT_C TInt | CancelLowPowerModeRequester() |
IMPORT_C void | CancelNextBasebandChangeEventNotifier() |
IMPORT_C void | Close() |
IMPORT_C TBool | IsOpen() |
IMPORT_C void | NotifyNextBasebandChangeEvent(TBTBasebandEvent &, TRequestStatus &, TUint32) |
IMPORT_C TInt | Open(RSocketServ &, RSocket &) |
IMPORT_C TInt | Open(RSocketServ &, const TBTDevAddr &) |
IMPORT_C TInt | PhysicalLinkState(TUint32 &) |
IMPORT_C TInt | PreventLowPowerModes(TUint32) |
IMPORT_C TInt | PreventRoleSwitch() |
IMPORT_C TInt | RequestChangeSupportedPacketTypes(TUint16) |
IMPORT_C TInt | RequestMasterRole() |
IMPORT_C TInt | RequestSlaveRole() |
Class to enable modification of a physical link:
Modifications may be requested or prevented (blocked). Whilst a modification is being prevented, any request to perform that modification by this or any other RBTPhysicalLinkAdapter client will be ignored. If a low power mode is being used on the physical link, a call to prevent that low power mode will, if possible, cause the physical link to exit that low power mode. An arbitration between all RBTPhysicalLinkAdapter clients will then occur to decide whether the physical link should remain active or enter another low power mode. (If all low power modes are prevented then that arbitration will result in the physical link remaining active.)
Methods to prevent modifications begin 'Prevent...'
Methods to cancel the prevention of modification begin 'Allow...'
Requests for low power mode modifications, and notification of modifications take the form of continuously repeated requests which can be switched on or switched off.
Only one low power mode requester may active on a single RBTPhysicalLinkAdapter client at a time. If several RBTPhysicalLinkAdapter clients have differing low power mode requests active at a given moment then the priority will be: Hold Sniff Park
Methods to perform these requests start 'Activate...'
Methods to cancel these requests start 'Cancel...'
IMPORT_C TInt | ActivateActiveRequester | ( | ) |
Start a facility that will continually attempt to put the physical link into Active Mode.
Returns: Error code
IMPORT_C TInt | ActivateParkRequester | ( | ) |
Start a facility that will continually attempt to put the physical link into Park Mode.
Returns: Error code
IMPORT_C TInt | ActivateSniffRequester | ( | ) |
Start a facility that will continually attempt to put the physical link into Sniff Mode.
Returns: Error code
Ensures this object does not block the use of a specified set of low power modes
Switches off 'PreventLowPowerModes' for the low power modes specified by the parameter 'aLowPowerModes'. If another RBTPhysicalLinkAdapter object requests, or has requested one of those low power modes, that request will now NOT be blocked by this RBTPhysicalLinkAdapter object. The default is to allow all low power modes. NB. Warning this may reactivate a low power mode requester. For example: ActivateSniffRequester(); //sniff requester active PreventLowPowersModes(ESniffMode); //sniff requester dormant .... AllowLowPowersModes(ESniffMode); //sniff requseter active
Parameter | Description |
---|---|
aLowPowerModes | A mask to specify which power modes are to be prevented. (Combine EHoldMode, ESniffMode, EParkMode or use EAnyLowPowerMode) |
Returns: Error code
IMPORT_C TInt | AllowRoleSwitch | ( | ) |
Ensures this object does not block a role switch.
Returns: Error code
IMPORT_C TInt | Authenticate | ( | ) |
Attempts to authenticate the existing physical link
If the the physical link has already been authenticated it will return an error, otherwise an Authentication Request will be made to the remote device.
This is a synchronous call and will return immediately the request has been issued. If required, NotifyNextBasebandChangeEvent() should be issued before this to wait for the completion of this authenticaton (for both authentication success and failure)
Returns: Error code. KErrAlreadyExists if the link is already authenticated
IMPORT_C TInt | CancelLowPowerModeRequester | ( | ) |
Cancel a facility that is continually requesting a low power mode
If ActivateSniffRequester, ActivateParkRequester or ActivateActiveRequester has been called by the user of this RBTPhysicalLinkAdapter object, repeated attempts will be made to put/return the physical link to that mode whenever a relevant event occurs or command is made. CancelLowPowerModeRequester stops these requests. However if another user of a RBTPhysicalLinkAdapter object has called ActivateSniffRequester, ActivateParkRequester or ActivateActiveRequester, those requests will still be active, and so the physical link will remain controlled by these requests.
To try to force the physical link into active mode, a call to either PreventLowPowerModes(EAnyLowPowerMode) or ActivateActiveRequester() should be made.
Returns: Error code
IMPORT_C void | CancelNextBasebandChangeEventNotifier | ( | ) |
Cancel a currently requested notification
IMPORT_C TBool | IsOpen | ( | ) | const |
Check whether the physical link adapter is open
This method is not required to be called before the other methods. KErrNotReady will be returned by other methods, if RBTPhysicalLinkAdapter is not open yet.
IMPORT_C void | NotifyNextBasebandChangeEvent | ( | TBTBasebandEvent & | aEventNotification, |
TRequestStatus & | aStatus, | |||
TUint32 | aEventMask = ENotifyAnyPhysicalLinkState | |||
) |
Request a notification
See also: TBTPhysicalLinkStateNotifier TBTPhysicalLinkStateNotifierCombinations
Parameter | Description |
---|---|
aEventNotification | Return parameter |
aStatus | Status parameter for asynchronous request |
aEventMask | Bitmask for those events for which notification is being requested Use TBTPhysicalLinkStateNotifier (and TBTPhysicalLinkStateNotifierCombinations) |
IMPORT_C TInt | Open | ( | RSocketServ & | aSocketServ, |
RSocket & | aSocket | |||
) |
Parameter | Description |
---|---|
aSocketServ | An existing ESock session |
aSocket | An open connected socket (ESock subsession) on that existing ESock session |
Returns: Error code
IMPORT_C TInt | Open | ( | RSocketServ & | aSocketServ, |
const TBTDevAddr & | aDevAddr | |||
) |
Parameter | Description |
---|---|
aSocketServ | An existing ESock session |
aDevAddr | The Bluetooth address of a remote device with which there is an existing connection |
Returns: Error code
See also: TBTPhysicalLinkStateNotifier
Parameter | Description |
---|---|
aState | Used to return the physical link state - as a combination of bit values defined in TBTPhysicalLinkStateNotifier. |
Returns: Error code
Blocks the use of a specified set of low power modes
Stops the physical link using any one of the set of low power modes specified by the bit mask 'aLowPowerModes'. To undo this blocking mechanism for a given set of low power modes, 'AllowLowPowerModes' needs to be called with appropriate values in its 'aLowPowerModes' parameter.
NB THIS METHOD CAN BE USED TO FORCE THE PHYSICAL LINK INTO ACTIVE MODE. To do this set the parameter to EAnyLowPowerMode. The requests for low power modes by any RBTPhysicalLinkAdapter objects will now be blocked by this object.
NB Some remote devices will automatically disconnect from a device whose Link Policy settings prevent low power modes.
Parameter | Description |
---|---|
aLowPowerModes | A mask to specify which power modes are to be prevented. (Combine EHoldMode, ESniffMode, EParkMode or use EAnyLowPowerMode) |
Returns: Error code
IMPORT_C TInt | PreventRoleSwitch | ( | ) |
Blocks a role switch
Returns: Error code
Update the set of baseband packet types that are allowed locally
See also: TBTPacketType TBTPacketTypeCombinations
Parameter | Description |
---|---|
aPacketTypes | Bitmask for packet types to be supported (Combine elements of TBTPacketType (or use TBTPacketTypeCombinations)) |
Returns: Error code
IMPORT_C TInt | RequestMasterRole | ( | ) |
Attempt to be the Bluetooth Master of a Piconet.
If the local device is currently the slave, a role switch maybe performed if no other user of a RBTPhysicalLinkAdapter object has called PreventRoleSwitch and the remote device allows the role switch.
Returns: Error code
IMPORT_C TInt | RequestSlaveRole | ( | ) |
Attempt to be a Bluetooth Slave of a Piconet.
Returns: Error code