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.
Public Member Enumerations | |
---|---|
enum | TChannelPriority { EHigh = 2, EMedium = 1, ELow = 0 } |
enum | TChannelReliability { EReliableChannel, EUnreliableChannel, EUnreliableDesiredChannel } |
enum | TL2CapConfigSpecifiedMask { ENoConfigElementsSpecified = 0x0000, EMTUSizeSpecifiedMask = 0x0001, EMRUSizeSpecifiedMask = 0x0002, EReliabilitySpecifiedMask = 0x0004, EPrioritySpecifiedMask = 0x0008, EMinMTUSizeSpecifiedMask = 0x0010, EMinMRUSizeSpecifiedMask = 0x0020, ELegacyModesDisallowedSpecifiedMask = 0x0040 } |
enum | TL2CapConfigSpecifiedTimers { EDefaultRetransmission = 0xffff, EMinDataObsolescenceTimeout = 0x0a, EDefaultDataObsolescenceTimeout = 0xffff } |
IMPORT_C TChannelPriority | ChannelPriority | ( | TBool & | aIsSpecified | ) | const |
TBool & aIsSpecified |
IMPORT_C TChannelReliability | ChannelReliability | ( | TBool & | aIsSpecified, |
TUint16 & | aAssociatedTimer | |||
) | const |
IMPORT_C TChannelReliability | ChannelReliability | ( | TBool & | aIsSpecified | ) | const |
TBool & aIsSpecified |
IMPORT_C TInt | ConfigureChannelPriority | ( | TChannelPriority | aPriority | ) |
TChannelPriority aPriority |
IMPORT_C TInt | ConfigureReliableChannel | ( | TUint16 | aRetransmissionTimer | ) |
TUint16 aRetransmissionTimer |
IMPORT_C TInt | ConfigureUnreliableChannel | ( | TUint16 | aObsolescenceTimer | ) |
TUint16 aObsolescenceTimer |
IMPORT_C TInt | ConfigureUnreliableDesiredChannel | ( | TUint16 | aObsolescenceTimer, |
TUint16 | aRetransmissionTimer | |||
) |
IMPORT_C TUint16 | MaxReceiveUnitSize | ( | TBool & | aIsSpecified | ) | const |
TBool & aIsSpecified |
IMPORT_C TUint16 | MaxTransmitUnitSize | ( | TBool & | aIsSpecified | ) | const |
TBool & aIsSpecified |
IMPORT_C TUint16 | ObsolescenceTimer | ( | TBool & | aIsSpecified | ) | const |
TBool & aIsSpecified |
IMPORT_C TUint16 | RetransmissionTimer | ( | TBool & | aIsSpecified | ) | const |
TBool & aIsSpecified |
IMPORT_C TInt | SetChannelPriority | ( | TChannelPriority | aPriority = ELow | ) |
TChannelPriority aPriority = ELow |
IMPORT_C void | SetLegacyModesDisallowed | ( | TBool | aDisallowed | ) |
TBool aDisallowed |
IMPORT_C TInt | SetMaxReceiveUnitSize | ( | TUint16 | aSize = 0xffff | ) |
TUint16 aSize = 0xffff |
IMPORT_C TInt | SetMaxTransmitUnitSize | ( | TUint16 | aSize = 0xffff | ) |
TUint16 aSize = 0xffff |
IMPORT_C TInt | SetupReliableChannel | ( | TUint16 | aRetransmissionTimer = EDefaultRetransmission | ) |
TUint16 aRetransmissionTimer = EDefaultRetransmission |
IMPORT_C TInt | SetupUnreliableChannel | ( | TUint16 | aObsolescenceTimer = EDefaultDataObsolescenceTimeout | ) |
TUint16 aObsolescenceTimer = EDefaultDataObsolescenceTimeout |
Priority required for data on L2Cap channel
EHigh = 2 | |
EMedium = 1 | |
ELow = 0 |
Reliability of data transfer preferred for L2Cap channel.
EReliableChannel | |
EUnreliableChannel | |
EUnreliableDesiredChannel |
Used to indicate which config options have been specified by the user
ENoConfigElementsSpecified = 0x0000 | |
EMTUSizeSpecifiedMask = 0x0001 | |
EMRUSizeSpecifiedMask = 0x0002 | |
EReliabilitySpecifiedMask = 0x0004 | |
EPrioritySpecifiedMask = 0x0008 | |
EMinMTUSizeSpecifiedMask = 0x0010 | |
EMinMRUSizeSpecifiedMask = 0x0020 | |
ELegacyModesDisallowedSpecifiedMask = 0x0040 |
Timer values in milliseconds for reliable and unreliable channels
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). |