TL2CapConfig Class Reference

class TL2CapConfig

API class for setting up an L2Cap channel 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 (MTU) value preferred during MTU negotiation Maximum Receive Unit (MRU) value preferred during MRU negotiation Minimum MTU value acceptable during MTU negotiation Minimum MRU value acceptable during MRU negotiation Channel Priority

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

Once a TL2CapConfig object has been set up it can be used to configure a socket using RSocket::SetOption or RSocket::Ioctl (or the CBluetoothSocket equivalents).

If the preferred Maximum Transmission Unit (MTU) value is specified but its minimum acceptable value is not specified in the same object, then the minimum acceptable value will be implicitly taken to be equal to the preferred MTU by the L2CAP APIs processing the object. This means that only an MTU greater than or equal to the preferred MTU will be accepted from the peer during negotiation.

If the Maximum Receive Unit (MRU) value is specified but its minimum acceptable value is not, then the minimum acceptable value is implicitly taken to be equal to the protocol minimum (48 bytes) by the L2CAP APIs processing the object.

Note that even though this API allows setting of Obsolescence timer, outgoing packet flushing may not be supported on all hardware.

RSocket

CBluetoothSocket

Public Member Functions
TL2CapConfig()
IMPORT_C TChannelPriorityChannelPriority(TBool &)
IMPORT_C TChannelReliabilityChannelReliability(TBool &, TUint16 &)
IMPORT_C TChannelReliabilityChannelReliability(TBool &)
IMPORT_C TIntConfigureChannelPriority(TChannelPriority)
IMPORT_C TIntConfigureReliableChannel(TUint16)
IMPORT_C TIntConfigureUnreliableChannel(TUint16)
IMPORT_C TIntConfigureUnreliableDesiredChannel(TUint16, TUint16)
IMPORT_C TBoolLegacyModesDisallowed()
IMPORT_C TUint16MaxReceiveUnitSize(TBool &)
IMPORT_C TUint16MaxTransmitUnitSize(TBool &)
IMPORT_C TUint16MinMRU(TBool &)
IMPORT_C TUint16MinMTU(TBool &)
IMPORT_C TUint16ObsolescenceTimer(TBool &)
IMPORT_C TUint16RetransmissionTimer(TBool &)
IMPORT_C TIntSetChannelPriority(TChannelPriority)
IMPORT_C voidSetLegacyModesDisallowed(TBool)
IMPORT_C TIntSetMaxReceiveUnitSize(TUint16)
IMPORT_C TIntSetMaxTransmitUnitSize(TUint16)
IMPORT_C TIntSetMinMRU(TUint16)
IMPORT_C TIntSetMinMTU(TUint16)
IMPORT_C TIntSetupReliableChannel(TUint16)
IMPORT_C TIntSetupUnreliableChannel(TUint16)
Public Member Enumerations
enumTChannelPriority { EHigh = 2, EMedium = 1, ELow = 0 }
enumTChannelReliability { EReliableChannel, EUnreliableChannel, EUnreliableDesiredChannel }
enumTL2CapConfigSpecifiedMask {
ENoConfigElementsSpecified = 0x0000, EMTUSizeSpecifiedMask = 0x0001, EMRUSizeSpecifiedMask = 0x0002, EReliabilitySpecifiedMask = 0x0004, EPrioritySpecifiedMask = 0x0008, EMinMTUSizeSpecifiedMask = 0x0010, EMinMRUSizeSpecifiedMask = 0x0020, ELegacyModesDisallowedSpecifiedMask = 0x0040
}
enumTL2CapConfigSpecifiedTimers { EDefaultRetransmission = 0xffff, EMinDataObsolescenceTimeout = 0x0a, EDefaultDataObsolescenceTimeout = 0xffff }
Private Attributes
TUint16 iAdditionalChannelReliabilityTimer
TChannelPriority iChannelPriority
TChannelReliability iChannelReliability
TUint16 iChannelReliabilityTimer
TUint16 iMRUSize
TUint16 iMTUSize
TUint16 iMinMRUSize
TUint16 iMinMTUSize
TUint16 iPadding
TUint16 iSpecifiedMask

Constructor & Destructor Documentation

TL2CapConfig()

IMPORT_CTL2CapConfig()

Member Functions Documentation

ChannelPriority(TBool &)

IMPORT_C TChannelPriorityChannelPriority(TBool &aIsSpecified)const

Parameters

TBool & aIsSpecified

ChannelReliability(TBool &, TUint16 &)

IMPORT_C TChannelReliabilityChannelReliability(TBool &aIsSpecified,
TUint16 &aAssociatedTimer
)const

Parameters

TBool & aIsSpecified
TUint16 & aAssociatedTimer

ChannelReliability(TBool &)

IMPORT_C TChannelReliabilityChannelReliability(TBool &aIsSpecified)const

Parameters

TBool & aIsSpecified

ConfigureChannelPriority(TChannelPriority)

IMPORT_C TIntConfigureChannelPriority(TChannelPriorityaPriority)

Parameters

TChannelPriority aPriority

ConfigureReliableChannel(TUint16)

IMPORT_C TIntConfigureReliableChannel(TUint16aRetransmissionTimer)

Parameters

TUint16 aRetransmissionTimer

ConfigureUnreliableChannel(TUint16)

IMPORT_C TIntConfigureUnreliableChannel(TUint16aObsolescenceTimer)

Parameters

TUint16 aObsolescenceTimer

ConfigureUnreliableDesiredChannel(TUint16, TUint16)

IMPORT_C TIntConfigureUnreliableDesiredChannel(TUint16aObsolescenceTimer,
TUint16aRetransmissionTimer
)

Parameters

TUint16 aObsolescenceTimer
TUint16 aRetransmissionTimer

LegacyModesDisallowed()

IMPORT_C TBoolLegacyModesDisallowed()const

MaxReceiveUnitSize(TBool &)

IMPORT_C TUint16MaxReceiveUnitSize(TBool &aIsSpecified)const

Parameters

TBool & aIsSpecified

MaxTransmitUnitSize(TBool &)

IMPORT_C TUint16MaxTransmitUnitSize(TBool &aIsSpecified)const

Parameters

TBool & aIsSpecified

MinMRU(TBool &)

IMPORT_C TUint16MinMRU(TBool &aIsSpecified)const

Parameters

TBool & aIsSpecified

MinMTU(TBool &)

IMPORT_C TUint16MinMTU(TBool &aIsSpecified)const

Parameters

TBool & aIsSpecified

ObsolescenceTimer(TBool &)

IMPORT_C TUint16ObsolescenceTimer(TBool &aIsSpecified)const

Parameters

TBool & aIsSpecified

RetransmissionTimer(TBool &)

IMPORT_C TUint16RetransmissionTimer(TBool &aIsSpecified)const

Parameters

TBool & aIsSpecified

SetChannelPriority(TChannelPriority)

IMPORT_C TIntSetChannelPriority(TChannelPriorityaPriority = ELow)

Parameters

TChannelPriority aPriority = ELow

SetLegacyModesDisallowed(TBool)

IMPORT_C voidSetLegacyModesDisallowed(TBoolaDisallowed)

Parameters

TBool aDisallowed

SetMaxReceiveUnitSize(TUint16)

IMPORT_C TIntSetMaxReceiveUnitSize(TUint16aSize = 0xffff)

Parameters

TUint16 aSize = 0xffff

SetMaxTransmitUnitSize(TUint16)

IMPORT_C TIntSetMaxTransmitUnitSize(TUint16aSize = 0xffff)

Parameters

TUint16 aSize = 0xffff

SetMinMRU(TUint16)

IMPORT_C TIntSetMinMRU(TUint16aSize)

Parameters

TUint16 aSize

SetMinMTU(TUint16)

IMPORT_C TIntSetMinMTU(TUint16aSize)

Parameters

TUint16 aSize

SetupReliableChannel(TUint16)

IMPORT_C TIntSetupReliableChannel(TUint16aRetransmissionTimer = EDefaultRetransmission)

Parameters

TUint16 aRetransmissionTimer = EDefaultRetransmission

SetupUnreliableChannel(TUint16)

IMPORT_C TIntSetupUnreliableChannel(TUint16aObsolescenceTimer = EDefaultDataObsolescenceTimeout)

Parameters

TUint16 aObsolescenceTimer = EDefaultDataObsolescenceTimeout

Member Enumerations Documentation

Enum TChannelPriority

Priority required for data on L2Cap channel

Enumerators

EHigh = 2
EMedium = 1
ELow = 0

Enum TChannelReliability

Reliability of data transfer preferred for L2Cap channel.

Enumerators

EReliableChannel
EUnreliableChannel
EUnreliableDesiredChannel

Enum TL2CapConfigSpecifiedMask

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

Enumerators

ENoConfigElementsSpecified = 0x0000
EMTUSizeSpecifiedMask = 0x0001
EMRUSizeSpecifiedMask = 0x0002
EReliabilitySpecifiedMask = 0x0004
EPrioritySpecifiedMask = 0x0008
EMinMTUSizeSpecifiedMask = 0x0010
EMinMRUSizeSpecifiedMask = 0x0020
ELegacyModesDisallowedSpecifiedMask = 0x0040

Enum TL2CapConfigSpecifiedTimers

Timer values in milliseconds for reliable and unreliable channels

Enumerators

EDefaultRetransmission = 0xffff

This is a time in milliseconds. However 0xffff has been given a special meaning in this interface. It means "Allow maximum possible number of 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. It only applies to reliable modes and is 255 for Retransmission Mode and Infinity for Enhanced Retransmission Mode.

EMinDataObsolescenceTimeout = 0x0a

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. Note that flushing of outgoing packets may not be implemented on all Symbian OS platforms.

EDefaultDataObsolescenceTimeout = 0xffff

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

Member Data Documentation

TUint16 iAdditionalChannelReliabilityTimer

TUint16 iAdditionalChannelReliabilityTimer[private]

TChannelPriority iChannelPriority

TChannelPriority iChannelPriority[private]

TChannelReliability iChannelReliability

TChannelReliability iChannelReliability[private]

TUint16 iChannelReliabilityTimer

TUint16 iChannelReliabilityTimer[private]

TUint16 iMRUSize

TUint16 iMRUSize[private]

TUint16 iMTUSize

TUint16 iMTUSize[private]

TUint16 iMinMRUSize

TUint16 iMinMRUSize[private]

TUint16 iMinMTUSize

TUint16 iMinMTUSize[private]

TUint16 iPadding

TUint16 iPadding[private]

TUint16 iSpecifiedMask

TUint16 iSpecifiedMask[private]