#include <bttypes.h>
Link against:
bluetooth.lib
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(TUint,TRequestStatus &,TDes8 *,TUint)
(or the CBluetoothSocket
) equivalents.
Members
Defined in TL2CapConfig
:
See also:
Construction and destruction
IMPORT_C TL2CapConfig();
Description
Constructor Start with no requests to update the required configuration.
SetMaxTransmitUnitSize(TUint16)
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(TBool &)const
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
SetMaxReceiveUnitSize(TUint16)
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(TBool &)const
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
ConfigureReliableChannel(TUint16)
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(TUint16)
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(TBool &,TUint16 &)const
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
ConfigureChannelPriority(TChannelPriority)
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
Return value
TInt
|
error code, currently KErrNone
|
|
ChannelPriority(TBool &)const
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
SetupReliableChannel(TUint16)
Interface status: |
deprecated |
Use ConfigureReliableChannel(TUint16 aRetransmissionTimer) instead |
IMPORT_C TInt SetupReliableChannel(TUint16 aRetransmissionTimer=EDefaultRetransmission);
Description
Parameters
Return value
SetupUnreliableChannel(TUint16)
Interface status: |
deprecated |
Use ConfigureUnreliableChannel(TUint16 aObsolescenceTimer) instead |
IMPORT_C TInt SetupUnreliableChannel(TUint16 aObsolescenceTimer=EDefaultDataObsolescenceTimeout);
Description
Parameters
Return value
SetChannelPriority(TChannelPriority)
Interface status: |
deprecated |
Use ConfigureChannelPriority(TChannelPriority aPriority) instead |
IMPORT_C TInt SetChannelPriority(TChannelPriority aPriority=ELow);
Description
Parameters
Return value
TChannelPriority
Description
Priority required for data on L2Cap channel
TChannelReliability
Description
Reliability of data tranfer required for L2Cap channel
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