Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: bttypes.h
Link against: bluetooth.lib

Class TL2CapConfig

class TL2CapConfig;

Description

API class for setting up an L2Cap configuration

This class may be used to set all or a subset of the following configuration items: Channel Reliability (and associated timer) Maximum Transmission Unit Maximum Receive Unit Channel Priority

If a configuration item is to be set, then its 'Set' or 'Setup' method should be called.

Once a TL2CapConfig object has been set up it should be sent using RSocket::SetOption or RSocket::Ioctl (or the CBluetoothSocket) equivalents.

Members

Defined in TL2CapConfig:
ChannelPriority(), ChannelReliability(), ConfigureChannelPriority(), ConfigureReliableChannel(), ConfigureUnreliableChannel(), EDefaultDataObsolescenceTimeout, EDefaultRetransmission, EHigh, ELow, EMRUSizeSpecifiedMask, EMTUSizeSpecifiedMask, EMedium, EMinDataObsolescenceTimeout, ENoConfigElementsSpecified, EPrioritySpecifiedMask, EReliabilitySpecifiedMask, EReliableChannel, EUnreliableChannel, MaxReceiveUnitSize(), MaxTransmitUnitSize(), SetChannelPriority(), SetMaxReceiveUnitSize(), SetMaxTransmitUnitSize(), SetupReliableChannel(), SetupUnreliableChannel(), TChannelPriority, TChannelReliability, TL2CapConfig(), TL2CapConfigSpecifiedMask, TL2CapConfigSpecifiedTimers

See also:


Construction and destruction


TL2CapConfig()

IMPORT_C TL2CapConfig();

Description

Constructor Start with no requests to update the required configuration.

[Top]


Member functions


SetMaxTransmitUnitSize()

IMPORT_C TInt SetMaxTransmitUnitSize(TUint16 aSize=0xffff);

Description

Request a new (outgoing) max transmit unit size.

The configuration process will attempt to configure with this MTU size, but will allow a greater MTU if the other side request it

Parameters

TUint16 aSize

the MTU size for use in configuration

Return value

TInt

error code, KErrArgument if MTU set too small, otherwise KErrNone


MaxTransmitUnitSize()

IMPORT_C TUint16 MaxTransmitUnitSize(TBool &aIsSpecified) const;

Description

Returns requested MTU.

Also allows the user to know whether that value has been set, or whether it is a random value that will be ignored. This is done via the parameter 'aIsSpecified'.

Parameters

TBool &aIsSpecified

Used to tell the caller whether the MTU value has been set.

Return value

TUint16

requested MTU


SetMaxReceiveUnitSize()

IMPORT_C TInt SetMaxReceiveUnitSize(TUint16 aSize=0xffff);

Description

Request a new (incoming) max receive unit size.

The configuration process will attempt to configure with this MRU size, but will allow a smaller MRU if the other side request it

Parameters

TUint16 aSize

the MRU size for use in configuration

Return value

TInt

error code, KErrArgument if MRU set too small, otherwise KErrNone


MaxReceiveUnitSize()

IMPORT_C TUint16 MaxReceiveUnitSize(TBool &aIsSpecified) const;

Description

Returns requested MRU.

Also allows the user to know whether that value has been set, or whether it is a random value that will be ignored. This is done via the parameter 'aIsSpecified'.

Parameters

TBool &aIsSpecified

Used to tell the caller whether the MRU value has been set.

Return value

TUint16

requested MRU


ConfigureReliableChannel()

IMPORT_C TInt ConfigureReliableChannel(TUint16 aRetransmissionTimer);

Description

Request a reliable channel.

A reliable channel relies on the retransmission by L2Cap of unacknowledged L2Cap packets. Retransmissions are continued for a specified length of time. If this time is exceeded the L2Cap channel is disconnected.

Parameters

TUint16 aRetransmissionTimer

The length of time allowed for l2Cap retransmissions

Return value

TInt

error code, currently KErrNone


ConfigureUnreliableChannel()

IMPORT_C TInt ConfigureUnreliableChannel(TUint16 aObsolescenceTimer);

Description

Request an unreliable channel.

An unreliable channel can allow L2Cap packets to be dropped by the baseband after a specified time. L2Cap does not retransmit if a packet is not acknowledged. However the L2Cap channel is not disconnected if a L2Cap packet is not acknowledged.

Parameters

TUint16 aObsolescenceTimer

The time after which a packet may be dropped or "flushed" by the baseband.

Return value

TInt

error code, KErrArgument if the obsolescence time is made shorter than is physically possible, otherwise KErrNone


ChannelReliability()

IMPORT_C TChannelReliability ChannelReliability(TBool &aIsSpecified, TUint16 &aAssociatedTimer) const;

Description

Returns the channel reliability and the associated timer.

Also allows the user to know whether reliability has been set up, or whether it is a random value that will be ignored. This is done via the parameter 'aIsSpecified'. The associated timer is the obsolescence timer if the channel is unreliable and the retransmission timer if it is reliable. This is returned via the parameter 'aAssociatedTimer'.

Parameters

TBool &aIsSpecified

Used to tell the caller whether reliability has been set up.

TUint16 &aAssociatedTimer

This is a 'return' value. The associated timer is the obsolescence timer if the channel is unreliable and the retransmission timer if it is reliable.

Return value

TChannelReliability

the reliability


ConfigureChannelPriority()

IMPORT_C TInt ConfigureChannelPriority(TChannelPriority aPriority);

Description

Request a new channel priority.

L2Cap channels have three priorities, low, medium, and high. Data on channels with higher priority may be sent before data on channels with lower priority.

Parameters

TChannelPriority aPriority

the priority to be used for this L2Cap channel

Return value

TInt

error code, currently KErrNone


ChannelPriority()

IMPORT_C TChannelPriority ChannelPriority(TBool &aIsSpecified) const;

Description

Returns requested channel priority.

Also allows the user to know whether that priority has been set, or whether it is a random value that will be ignored. This is done via the parameter 'aIsSpecified'.

Parameters

TBool &aIsSpecified

Used to tell the caller whether the priority has been set.

Return value

TChannelPriority

requested channel priority.


SetupReliableChannel()

IMPORT_C TInt SetupReliableChannel(TUint16 aRetransmissionTimer=EDefaultRetransmission);

Description

Parameters

TUint16 aRetransmissionTimer

Return value

TInt


SetupUnreliableChannel()

IMPORT_C TInt SetupUnreliableChannel(TUint16 aObsolescenceTimer=EDefaultDataObsolescenceTimeout);

Description

Parameters

TUint16 aObsolescenceTimer

Return value

TInt


SetChannelPriority()

IMPORT_C TInt SetChannelPriority(TChannelPriority aPriority=ELow);

Description

Parameters

TChannelPriority aPriority

Return value

TInt

[Top]


Member enumerations


Enum TChannelPriority

TChannelPriority

Description

Priority required for data on L2Cap channel

EHigh

EMedium

ELow


Enum TChannelReliability

TChannelReliability

Description

Reliability of data tranfer required for L2Cap channel

EReliableChannel

EUnreliableChannel


Enum TL2CapConfigSpecifiedTimers

TL2CapConfigSpecifiedTimers

Description

Timer values in milliseconds for reliable and unreliable channels

EDefaultRetransmission

This is a time in milliseconds. However 0xffff has been given a special meaning in this interface. It means "Allow up 256 transmissions of a single packet before giving up and disconnecting the L2Cap channel.". This is the maximum number of transmissions effectively allowed by the spec.

EMinDataObsolescenceTimeout

Minimum data obsolescence timeout required because data packets will not ever be sent if we flush them too quickly. Speed of sending data depends on how many channels are open and channel priority.

EDefaultDataObsolescenceTimeout

This is translated to mean never flush (as per spec).


Enum TL2CapConfigSpecifiedMask

TL2CapConfigSpecifiedMask

Description

Used to indicate which config options have been specified by the user

ENoConfigElementsSpecified

EMTUSizeSpecifiedMask

EMRUSizeSpecifiedMask

EReliabilitySpecifiedMask

EPrioritySpecifiedMask