1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // BT protocol wide types
21 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
22 #include <bttypespartner.h>
26 #include <bluetooth/eirdatacodec.h>
32 Minimum eSCO connection latency in milliseconds. Attempts to specify less than this will be silently
33 increased to this level.
35 static const TInt KMinESCOLatency = 4;
41 Typedef to represent a HCI connection handle.
43 typedef TUint16 THCIConnHandle;
49 Bluetooth SIG specified values for specification of (piconet) role.
53 EMaster = 0x00, /*!< Master role */
54 ESlave = 0x01, /*!< Slave role */
55 ERoleUnknown, /*!< Unknown role */
62 Bluetooth SIG specified values for indicating link modes.
66 EActiveMode = 0x00, /*!< Active mode */
67 EHoldMode = 0x01, /*!< Hold mode */
68 ESniffMode = 0x02, /*!< Sniff mode */
69 EParkMode = 0x04, /*!< Park mode */
70 EScatterMode = 0x08, /*!< Scatter mode */
77 Typedef to represent a union of TBTLinkMode values.
79 typedef TUint32 TBTLinkModeSet;
85 Bitmask values to help request combinations of link modes.
88 enum TBTLinkModeCombinations
90 EAnyLowPowerMode = (EHoldMode | ESniffMode | EParkMode | EScatterMode) /*!< Any low power mode */
97 Bluetooth SIG specified values for indicating packet types.
99 DM1, DH1, DM3, DH3, DM5, DH5 are ACL packet types
100 HV1, HV2, HV3 are SCO (synchronous link) packet types
104 EPacketsDM1 = 0x0008, /*!< DM1 ACL packet type */
105 EPacketsDH1 = 0x0010, /*!< DH1 ACL packet type */
106 EPacketsDM3 = 0x0400, /*!< DM3 ACL packet type */
107 EPacketsDH3 = 0x0800, /*!< DH3 ACL packet type */
108 EPacketsDM5 = 0x4000, /*!< DM5 ACL packet type */
109 EPacketsDH5 = 0x8000, /*!< DH5 ACL packet type */
111 EPackets2_DH1 = 0x0002, /*!< 2-DH1 ACL packet type */
112 EPackets3_DH1 = 0x0004, /*!< 3-DH1 ACL packet type */
113 EPackets2_DH3 = 0x0100, /*!< 2-DH3 ACL packet type */
114 EPackets3_DH3 = 0x0200, /*!< 3-DH3 ACL packet type */
115 EPackets2_DH5 = 0x1000, /*!< 2-DH5 ACL packet type */
116 EPackets3_DH5 = 0x2000, /*!< 3-DH5 ACL packet type */
118 EPacketsHV1 = 0x0020, /*!< HV1 SCO packet type */
119 EPacketsHV2 = 0x0040, /*!< HV2 SCO packet type */
120 EPacketsHV3 = 0x0080, /*!< HV3 SCO packet type */
127 Typedef to represent a set of SCO packet types.
129 typedef TUint16 TBTSCOPackets;
135 Typedef to represent a set of ACL packet types.
137 typedef TUint16 TBTACLPackets;
143 Bitmask values to help request combinations of packets.
146 enum TBTPacketTypeCombinations
148 EAnyACLPacket = EPacketsDM1 | EPacketsDM3 | EPacketsDM5 | EPacketsDH1 | EPacketsDH3 | EPacketsDH5, /*!< Any ACL packet */
149 EAnyNonEdrACLPacket = EAnyACLPacket | EPackets2_DH1 | EPackets3_DH1 | EPackets2_DH3 | EPackets3_DH3 | EPackets2_DH5 | EPackets3_DH5, /*!< Any Non-EDR ACL packet */
150 EAnySCOPacket = EPacketsHV1 | EPacketsHV2 | EPacketsHV3, /*!< Any SCO packet */
151 EAnyPacket = EAnyACLPacket | EAnySCOPacket /*!< Any packet */
159 Typedef to represent a set of synchronous packet types (SCO and eSCO on v1.2).
160 @see TBTSyncPackets::TSyncPackets
162 typedef TUint32 TBTSyncPacketTypes;
168 This constant is no longer needed to translate the SCO mapping of HV packet types to Synchronous
169 because CBluetoothSynchronousLink::SetupConnection(const TBTDevAddr& aBDAddr, const TUint16 aPacketTypes)
170 adjusts aPacketTypes internally on behalf of clients.
172 static const TInt KSCOvsSyncHVOffset = 5;
179 Class to represent a set of synchronous packet types (SCO and eSCO on v1.2).
180 This differs from TBTSyncPacketTypes as it is the interface used by CBluetoothSynchronousLink
181 in order to detect the difference between a pre and post eSCO caller. This is necessary
182 as HV1 packets in the SCO numbering clash with EV5 packets in the sync numbering.
184 NONSHARABLE_CLASS(TBTSyncPackets)
191 Individual synchronous packet types.
192 @see TBTSyncPacketTypes
196 ESyncPacketsHV1 = 0x10001,
197 ESyncPacketsHV2 = 0x10002,
198 ESyncPacketsHV3 = 0x10004,
200 ESyncPacketsEV3 = 0x20008,
201 ESyncPacketsEV4 = 0x20010,
202 ESyncPacketsEV5 = 0x20020,
204 ESyncAnySCOPacket = ESyncPacketsHV1 | ESyncPacketsHV2 | ESyncPacketsHV3,
205 ESyncAnyESCOPacket = ESyncPacketsEV3 | ESyncPacketsEV4 | ESyncPacketsEV5
209 IMPORT_C explicit TBTSyncPackets(TBTSyncPacketTypes aPackets);
210 IMPORT_C TBTSyncPacketTypes operator()() const;
213 TUint32 iPacketTypes;
215 // This data padding has been added to help prevent future binary compatibility breaks
216 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
226 eSCO links can have different retransmission options, optimised for link usage,
227 power or reliability.
229 @see CBluetoothSynchronousLink::SetRetransmissionEffort
231 enum TBTeSCORetransmissionTypes
233 EeSCORetransmitNone = 0,
234 EeSCORetransmitPower = 1,
235 EeSCORetransmitReliability = 2,
236 EeSCORetransmitDontCare = 0xff
243 eSCO unspecified bandwidth. This value can only be used by the accepting side
244 of an eSCO link, to allow any bandwidth to be specified by the initiator.
245 Otherwise both sides of the link must agree on the same bandwidth.
247 @see CBluetoothSynchronousLink::SetBandwidth
248 @see CBluetoothSynchronousLink::AcceptConnection
250 static const TUint32 KESCOBandwidthDontCare = KMaxTUint32;
256 Bluetooth SIG specified values indicating whether a device
257 is physically able to support a baseband (or link manager protocol) feature
259 enum TBTSupportedFeatures
261 ESupportedThreeSlotPackets = 1<<0, /*!< Three slot packets are supported */
262 ESupportedFiveSlotPackets = 1<<1, /*!< Five slot packets are supported */
263 ESupportedEncryption = 1<<2, /*!< Encryption is supported */
264 ESupportedSlotOffset = 1<<3, /*!< Slot offset is supported */
265 ESupportedTimingAccuracy = 1<<4, /*!< Timing accuracy is supported */
266 ESupportedSwitch = 1<<5, /*!< Role switch is supported */
267 ESupportedHoldMode = 1<<6, /*!< Hold mode is supported */
268 ESupportedSniffMode = 1<<7, /*!< Sniff mode is supported */
269 ESupportedParkMode = 1<<8, /*!< Park mode is supported */
270 ESupportedRSSI = 1<<9, /*!< Receive signal strength indication is supported */
271 ESupportedChannelQualityDrivenDataRate = 1<<10, /*!< Channel quality driven data rate is supported */
272 ESupportedSCOLink = 1<<11, /*!< SCO links are supported */
273 ESupportedHV2Packets = 1<<12, /*!< HV2 packets are supported */
274 ESupportedHV3Packets = 1<<13, /*!< HV3 packets are supported */
275 ESupportedu_lawLog = 1<<14, /*!< SCO u-law encoding is supported */
276 ESupportedA_lawLog = 1<<15, /*!< SCO A-law encoding is supported */
277 ESupportedCVSD = 1<<16, /*!< SCO Continuously variable slope delta modulation is supported */
278 ESupportedPagingScheme = 1<<17, /*!< Paging scheme is supported */
279 ESupportedPowerControl = 1<<18, /*!< Power control is supported */
280 ESupportedTransparentSCOData = 1<<19, /*!< Transparent SCO data is supported */
281 ESupportedFlowControlLagBit0 = 1<<20, /*!< Flow control lag bit 0 is supported */
282 ESupportedFlowControlLagBit1 = 1<<21, /*!< Flow control lag bit 1 is supported */
283 ESupportedFlowControlLagBit2 = 1<<22, /*!< Flow control lag bit 2 is supported */
290 Bitmask values for notifying/requesting notification of the state of a physical link.
292 These values have a two fold purpose:
293 1) They can be used along with TBTPhysicalLinkStateNotifierCombinations to specify
294 a set of baseband change events for which notification is desired.
295 2) They can be used to notify the state of a physical link or a subset of that state.
296 For example if only mode change events are being monitored, then at each mode change event
297 only the bit reperesenting the new mode will be returned, however if the whole link state
298 is required, then a combination of bit values indicating that state will be returned.
300 THESE BIT VALUES MUST ONLY BE USED WHEN REQUESTING NOTIFICATION, OR WHEN PARSING THE
301 RESULTS OF A NOTIFICATION. All other baseband state activities should use one of the
302 appropriate Bluetooth SIG specified enums
305 @see TBTLinkModeCombinations
307 @see TBTPacketTypeCombinations
309 enum TBTPhysicalLinkStateNotifier
311 ENotifyMaster = 0x00000001, /*!< Master */
312 ENotifySlave = 0x00000002, /*!< Slave */
314 ENotifyActiveMode = 0x00000004, /*!< Active mode */
315 ENotifySniffMode = 0x00000008, /*!< Sniff mode */
316 ENotifyParkMode = 0x00000010, /*!< Park mode */
317 ENotifyHoldMode = 0x00000020, /*!< Hold mode */
319 ENotifyMaxSlots1 = 0x00000040, /*!< Max slots 1 */
320 ENotifyMaxSlots3 = 0x00000080, /*!< Max slots 3 */
321 ENotifyMaxSlots5 = 0x00000100, /*!< Max slots 5 */
323 ENotifyPacketsDM1 = 0x00000200, /*!< Packets DM1 */
324 ENotifyPacketsDH1 = 0x00000400, /*!< Packets DH1 */
325 ENotifyPacketsDM3 = 0x00000800, /*!< Packets DM3 */
326 ENotifyPacketsDH3 = 0x00001000, /*!< Packets DH3 */
327 ENotifyPacketsDM5 = 0x00002000, /*!< Packets DM5 */
328 ENotifyPacketsDH5 = 0x00004000, /*!< Packets DH5 */
330 ENotifyPacketsHV1 = 0x00008000, /*!< HV1 */
331 ENotifyPacketsHV2 = 0x00010000, /*!< HV2 */
332 ENotifyPacketsHV3 = 0x00020000, /*!< HV3 */
334 ENotifyAuthenticationComplete = 0x00040000, /*!< Authentication Complete */
335 ENotifyEncryptionChangeOn = 0x00080000, /*!< Encryption Change On */
336 ENotifyEncryptionChangeOff = 0x00100000, /*!< Encryption Change Off */
338 ENotifyPhysicalLinkUp = 0x00200000, /*!< Physical Link Up */
339 ENotifyPhysicalLinkDown = 0x00400000, /*!< Physical Link Down */
340 ENotifyPhysicalLinkError = 0x00800000, /*!< Physical Link Error */
342 ENotifySynchronousLinkUp = 0x01000000, /*!< Synchronous Link Up */
343 ENotifySynchronousLinkDown = 0x02000000, /*!< Synchronous Link Down */
344 ENotifySynchronousLinkError = 0x04000000, /*!< Synchronous Link Error */
348 @deprecated This has been superseded by ENotifySynchronousLinkUp
349 @see ENotifySynchronousLinkUp
351 ENotifySCOLinkUp = ENotifySynchronousLinkUp,
353 @deprecated This has been superseded by ENotifySynchronousLinkDown
354 @see ENotifySynchronousLinkDown
356 ENotifySCOLinkDown = ENotifySynchronousLinkDown,
358 @deprecated This has been superseded by ENotifySynchronousLinkError
359 @see ENotifySynchronousLinkError
361 ENotifySCOLinkError = ENotifySynchronousLinkError
369 Bitmask values to help request notification of the state of a physical link.
370 @see TBTPhysicalLinkStateNotifier
372 enum TBTPhysicalLinkStateNotifierCombinations
374 ENotifyAnyRole = ENotifyMaster | ENotifySlave,
375 ENotifyAnyLowPowerMode = ENotifySniffMode | ENotifyParkMode | ENotifyHoldMode,
376 ENotifyAnyPowerMode = ENotifyActiveMode | ENotifyAnyLowPowerMode,
377 ENotifyAnyMaxSlots = ENotifyMaxSlots1 | ENotifyMaxSlots3 | ENotifyMaxSlots5,
378 ENotifyAnyACLPacketType = ENotifyPacketsDM1 | ENotifyPacketsDH1 | ENotifyPacketsDM3 | EPacketsDH3 | EPacketsDM5 | EPacketsDH5,
379 ENotifyAnySCOPacketType = ENotifyPacketsHV1 | ENotifyPacketsHV2 | ENotifyPacketsHV3,
380 ENotifyAnyPacketType = ENotifyAnyACLPacketType | ENotifyAnySCOPacketType,
381 ENotifyAnyPhysicalLinkState = 0xffffffff,
388 The maximum length of an SDP UUID.
390 static const TInt KSdpUUIDMaxLength = 16;
396 The size of a bluetooth device address in bytes.
398 const TInt KBTDevAddrSize=0x06;
404 The size of a bluetooth device address in bytes.
406 const TInt KBTMaxDevAddrSize = KBTDevAddrSize;
412 48-bit bluetooth device address.
413 Each bluetooth device has a unique address built into the hardware, which
414 is represented by this class. Used for identifying remote addresses.
415 The interface operates in a big-endian manner -- e.g. addr[0] refers
416 to the most significant byte of the address. This is the same ordering
417 as the addresses would naturally be written down on paper.
419 NONSHARABLE_CLASS(TBTDevAddr)
422 IMPORT_C TBTDevAddr();
423 IMPORT_C TBTDevAddr(const TInt64 &aInt);
424 IMPORT_C TBTDevAddr(const TDesC8 &aDes);
425 IMPORT_C TBool operator==(const TBTDevAddr& aAddr) const;
426 IMPORT_C TBool operator!=(const TBTDevAddr& aAddr) const;
427 IMPORT_C const TUint8 &operator[](TInt aIndex) const;
428 IMPORT_C TUint8 &operator[](TInt aIndex);
429 IMPORT_C void Reset();
430 IMPORT_C TPtr8 Des();
431 IMPORT_C const TPtrC8 Des() const;
432 IMPORT_C TInt SetReadable(const TDesC& aSource);
433 IMPORT_C void GetReadable(TDes& aDest) const;
434 IMPORT_C void GetReadable(TDes& aDest, const TDesC& aPrepend, const TDesC& aByteSeperator, const TDesC& aAppend) const;
435 IMPORT_C TBool operator<=(const TBTDevAddr& aAddr) const;
437 TFixedArray<TUint8, KBTDevAddrSize> iAddr;
439 // This data padding has been added to help prevent future binary compatibility breaks
440 // iPadding hasn't been zero'd because it is currently not used
444 /** Array of device addresses
445 @see Enumerate method
447 typedef RArray<TBTDevAddr> RBTDevAddrArray;
453 A Bluetooth Universally Unique Identifier.
455 This is a 128-bit quantity that can be created without a central registry
456 while still being globally unique.
457 UUIDs are always held in full 128 bit format, however they can be set from
458 BT SIG short form (16 or 32 bit) addresses, and returned as down to their
459 shortest form using ShortestForm().
461 NONSHARABLE_CLASS(TUUID)
465 IMPORT_C TUUID(TUint32 aLong);
466 IMPORT_C TUUID(TUint32 aHH, TUint32 aHL, TUint32 aLH, TUint32 aLL);
467 IMPORT_C TUUID(const TUid& aUid);
468 IMPORT_C void SetL(const TDesC8& aDes);
469 IMPORT_C const TPtrC8 LongForm() const;
470 IMPORT_C const TPtrC8 ShortestForm() const;
471 IMPORT_C const TPtrC8 Des() const;
474 Use SpecifiedLengthL(TInt aLength) instead
476 IMPORT_C const TPtrC8 FixedLengthL(TInt aLength) const;
477 IMPORT_C TInt MinimumSize() const;
478 IMPORT_C TBool operator==(const TUUID& aUUID) const;
479 IMPORT_C TBool operator!=(const TUUID& aUUID) const;
480 IMPORT_C const TUint8 &operator[](TInt aIndex) const;
481 IMPORT_C TUint8 &operator[](TInt aIndex);
482 IMPORT_C const TPtrC8 SpecifiedLengthL(TInt aLength) const;
483 IMPORT_C void SetFromLittleEndianL(const TDesC8& aDes);
485 TFixedArray<TUint8, KSdpUUIDMaxLength> iUUID;
487 // This data padding has been added to help prevent future binary compatibility breaks
488 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
498 A UUID container class
500 NONSHARABLE_CLASS(RUUIDContainer)
503 IMPORT_C void Close();
504 IMPORT_C void Reset();
505 IMPORT_C TInt Count() const;
506 IMPORT_C TUUID& operator[](TInt aIndex);
507 IMPORT_C const TUUID& operator[](TInt aIndex) const;
508 IMPORT_C const TUUID& At(TInt aIndex) const;
509 IMPORT_C TBool IsPresent(const TUUID& aUuid) const;
510 IMPORT_C TInt Add(const TUUID& aUuid);
513 RArray<TUUID> iUUIDs;
515 // This data padding has been added to help prevent future binary compatibility breaks
516 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
526 An EIR UUID container class. Contains UUIDs and indications of data completeness
528 NONSHARABLE_CLASS(RExtendedInquiryResponseUUIDContainer)
539 IMPORT_C void Close();
540 IMPORT_C RUUIDContainer& UUIDs();
541 IMPORT_C void SetCompleteness(TUUIDType aType, TBool aIsComplete);
542 IMPORT_C TBool GetCompleteness(TUUIDType aType) const;
545 RUUIDContainer iUUIDs;
548 // This data padding has been added to help prevent future binary compatibility breaks
549 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
558 The size of a link key, in bytes.
560 const TUint8 KHCILinkKeySize=16;
566 The size of a pin code, in bytes.
568 const TUint8 KHCIPINCodeSize=16;
576 NONSHARABLE_CLASS(TLinkKeyV10)
579 TUint8 iLinkKey[KHCILinkKeySize]; /*!< The link key */
586 Typedef'ed TPckgBuf of the class TLinkKeyV10.
588 typedef TPckgBuf<TLinkKeyV10> TBTLinkKey;
591 The type of a link key with a remote device
597 ELinkKeyCombination, /*!< this key has been generated with pairing with pre-v2.1 Bluetooth devices. */
598 ELinkKeyUnauthenticatedUpgradable, /*!< this key hasn't yet been tried with MITM protection */
599 ELinkKeyUnauthenticatedNonUpgradable, /*!< this key tried MITM protection; remote device incapable */
600 ELinkKeyAuthenticated, /*!< this key authenticated with MITM protection */
601 ELinkKeyDebug /*!< this key has been generated when in simple pairing debug mode */
608 Bluetooth PIN Code structure.
610 NONSHARABLE_CLASS(TPINCodeV10)
613 IMPORT_C TBool operator==(const TPINCodeV10& aTPINCodeV10) const;
616 TUint8 iLength; /*!< The length of the pin key */
617 TUint8 iPIN[KHCIPINCodeSize]; /*!< The pin code */
624 Typedef'ed TPckgBuf of the class TPINCodeV10.
626 typedef TPckgBuf<TPINCodeV10> TBTPinCode;
630 Extended Inquiry Response Class
631 This class takes a reference from inquiry result, which could hold both local name and Extended Inquiry Response.
632 It provides API to parse and return the local name and data for any Extended Inquiry Response tag.
633 To get Device Name, Manufacturer Specific Data or Flags, firstly getting length of the data,
634 and then allocating a suitable buffer, which is where the data will be placed.
636 NONSHARABLE_CLASS(TBluetoothNameRecordWrapper)
639 IMPORT_C explicit TBluetoothNameRecordWrapper(const TNameRecord& aNameRecord);
640 IMPORT_C TInt GetDeviceName(TDes16& aName, TBool& aIsComplete) const;
641 IMPORT_C TInt GetServiceClassUuids(RExtendedInquiryResponseUUIDContainer& aEIRContainer) const;
642 IMPORT_C TInt GetVendorSpecificData(TDes8& aDes) const;
643 IMPORT_C TInt GetTxPowerLevel(TInt8& aTxPowerLevel) const;
644 IMPORT_C TInt GetFlags(TDes8& aDes) const;
645 IMPORT_C TInt GetDeviceNameLength() const;
646 IMPORT_C TInt GetVendorSpecificDataLength() const;
647 IMPORT_C TInt GetFlagsLength() const;
650 TInt AddUuids16(RExtendedInquiryResponseUUIDContainer& aEIRContainer, TPtrC8& aUuids) const;
651 TInt AddUuids128(RExtendedInquiryResponseUUIDContainer& aEIRContainer, TPtrC8& aUuids) const;
653 TExtendedInquiryResponseDataCodec iEirCodec;
655 // This data padding has been added to help prevent future binary compatibility breaks
656 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
665 Contains information resulting from a baseband notification.
667 NONSHARABLE_CLASS(TBTBasebandEventNotification)
672 @param aEventType The type of event.
673 @param aErrorCode The error code.
675 TBTBasebandEventNotification(TUint32 aEventType, TInt aErrorCode = KErrNone) : iEventType(aEventType), iErrorCode(aErrorCode) {};
680 TBTBasebandEventNotification() : iEventType(0), iErrorCode(KErrNone) {};
684 @param aEvent The event to copy.
686 TBTBasebandEventNotification(const TBTBasebandEventNotification& aEvent) : iEventType(aEvent.iEventType), iErrorCode(aEvent.iErrorCode) {};
690 @return The event type.
692 TUint32 EventType() const { return iEventType; };
695 The Bluetooth SIG error code associated with the event.
696 @return The SIG error code.
698 TInt ErrorCode() const { return iErrorCode; };
701 The Symbian HCI error code associated with the event.
702 @return The Symbian error code.
704 IMPORT_C TInt SymbianErrorCode() const;
708 @param aEventType The event type.
710 void SetEventType(TUint32 aEventType) { iEventType = aEventType; };
714 @param aErrorCode The Bluetooth SIG error code.
716 void SetErrorCode(TInt aErrorCode) { iErrorCode = aErrorCode; };
727 Typedef'ed pckgbuf of the class TBTBasebandEventNotification.
729 typedef TPckgBuf<TBTBasebandEventNotification> TBTBasebandEvent;
735 General Unlimited Inquiry Access Code
737 const TUint KGIAC=0x9e8b33;
743 Limited Inquiry Access Code
745 const TUint KLIAC=0x9e8b00;
752 enum TL2CapChannelMode
754 EL2CAPBasicMode = 0x00,
755 EL2CAPRetransmissionMode = 0x01,
756 EL2CAPFlowControlMode = 0x02,
757 EL2CAPEnhancedRetransmissionMode = 0x03,
758 EL2CAPStreamingMode = 0x04,
765 API class for setting up an L2Cap channel configuration.
767 This class may be used to set all or a subset of the following configuration
769 Channel Reliability (and associated timer)
770 Maximum Transmission Unit (MTU) value preferred during MTU negotiation
771 Maximum Receive Unit (MRU) value preferred during MRU negotiation
772 Minimum MTU value acceptable during MTU negotiation
773 Minimum MRU value acceptable during MRU negotiation
776 If a configuration item is to be set, then its 'Set' or 'Configure'
777 method should be called.
779 Once a TL2CapConfig object has been set up it can be used to configure a socket
780 using RSocket::SetOption or RSocket::Ioctl (or the CBluetoothSocket equivalents).
782 If the preferred Maximum Transmission Unit (MTU) value is specified but its
783 minimum acceptable value is not specified in the same object, then the minimum
784 acceptable value will be implicitly taken to be equal to the preferred MTU by
785 the L2CAP APIs processing the object. This means that only an MTU greater than or
786 equal to the preferred MTU will be accepted from the peer during negotiation.
788 If the Maximum Receive Unit (MRU) value is specified but its minimum acceptable
789 value is not, then the minimum acceptable value is implicitly taken to be equal
790 to the protocol minimum (48 bytes) by the L2CAP APIs processing the object.
792 Note that even though this API allows setting of Obsolescence timer, outgoing
793 packet flushing may not be supported on all hardware.
796 @see CBluetoothSocket
798 NONSHARABLE_CLASS(TL2CapConfig)
802 Priority required for data on L2Cap channel
804 enum TChannelPriority
812 Reliability of data transfer preferred for L2Cap channel.
814 enum TChannelReliability
818 EUnreliableDesiredChannel
822 Timer values in milliseconds for reliable and unreliable channels
824 enum TL2CapConfigSpecifiedTimers
827 This is a time in milliseconds. However 0xffff has been given a special
828 meaning in this interface. It means "Allow maximum possible number of
829 transmissions of a single packet before giving up and disconnecting the
830 L2Cap channel." This is the maximum number of transmissions effectively
831 allowed by the spec. It only applies to reliable modes and is 255 for
832 Retransmission Mode and Infinity for Enhanced Retransmission Mode.
834 EDefaultRetransmission = 0xffff,
836 Minimum data obsolescence timeout required because data packets
837 will not ever be sent if we flush them too quickly.
838 Speed of sending data depends on how many channels are open and channel priority.
839 Note that flushing of outgoing packets may not be implemented on all Symbian OS
842 EMinDataObsolescenceTimeout = 0x0a,
844 This is translated to mean never flush (as per spec).
846 EDefaultDataObsolescenceTimeout = 0xffff,
850 Used to indicate which config options have been specified by the user
852 enum TL2CapConfigSpecifiedMask
854 ENoConfigElementsSpecified = 0x0000,
855 EMTUSizeSpecifiedMask = 0x0001,
856 EMRUSizeSpecifiedMask = 0x0002,
857 EReliabilitySpecifiedMask = 0x0004,
858 EPrioritySpecifiedMask = 0x0008,
859 EMinMTUSizeSpecifiedMask = 0x0010,
860 EMinMRUSizeSpecifiedMask = 0x0020,
861 ELegacyModesDisallowedSpecifiedMask = 0x0040
864 IMPORT_C TL2CapConfig();
866 IMPORT_C TInt SetMaxTransmitUnitSize(TUint16 aSize = 0xffff);
867 IMPORT_C TUint16 MaxTransmitUnitSize(TBool& aIsSpecified) const;
868 IMPORT_C TInt SetMaxReceiveUnitSize(TUint16 aSize = 0xffff);
869 IMPORT_C TUint16 MaxReceiveUnitSize(TBool& aIsSpecified) const;
871 IMPORT_C TInt SetMinMTU(TUint16 aSize);
872 IMPORT_C TUint16 MinMTU(TBool& aIsSpecified) const;
874 IMPORT_C TInt SetMinMRU(TUint16 aSize);
875 IMPORT_C TUint16 MinMRU(TBool& aIsSpecified) const;
877 IMPORT_C TInt ConfigureReliableChannel(TUint16 aRetransmissionTimer);
878 IMPORT_C TInt ConfigureUnreliableChannel(TUint16 aObsolescenceTimer);
879 IMPORT_C TInt ConfigureUnreliableDesiredChannel(TUint16 aObsolescenceTimer, TUint16 aRetransmissionTimer);
880 IMPORT_C void SetLegacyModesDisallowed(TBool aDisallowed);
881 IMPORT_C TBool LegacyModesDisallowed() const;
883 IMPORT_C TChannelReliability ChannelReliability(TBool& aIsSpecified, TUint16& aAssociatedTimer) const;
885 IMPORT_C TChannelReliability ChannelReliability(TBool& aIsSpecified) const;
886 IMPORT_C TUint16 RetransmissionTimer(TBool& aIsSpecified) const;
887 IMPORT_C TUint16 ObsolescenceTimer(TBool& aIsSpecified) const;
889 IMPORT_C TInt ConfigureChannelPriority(TChannelPriority aPriority);
890 IMPORT_C TChannelPriority ChannelPriority(TBool& aIsSpecified) const;
894 Use ConfigureReliableChannel(TUint16 aRetransmissionTimer) instead
896 IMPORT_C TInt SetupReliableChannel(TUint16 aRetransmissionTimer = EDefaultRetransmission);
899 Use ConfigureUnreliableChannel(TUint16 aObsolescenceTimer) instead
901 IMPORT_C TInt SetupUnreliableChannel(TUint16 aObsolescenceTimer = EDefaultDataObsolescenceTimeout);
904 Use ConfigureChannelPriority(TChannelPriority aPriority) instead
906 IMPORT_C TInt SetChannelPriority(TChannelPriority aPriority = ELow);
911 TChannelReliability iChannelReliability;
912 TUint16 iChannelReliabilityTimer; // see note below
913 TChannelPriority iChannelPriority;
914 TUint16 iSpecifiedMask;
915 TUint16 iMinMTUSize; // Minimum acceptable MTU.
916 TUint16 iMinMRUSize; // Minimum acceptable MRU.
917 TUint16 iAdditionalChannelReliabilityTimer; // see note below
918 // This data padding has been added to help prevent future binary compatibility breaks.
921 // Note on the timer fields:
922 // iAdditionalChannelReliabilityTimer has been added when a need to pass two timers within
923 // one object arose. To maintain BC with existing clients of this class, when a single timer
924 // is passed, it's always stored in iChannelReliabilityTimer. Changing this to just having
925 // iRetransmissionTimer & iObsolescenceTimer would break BC.
926 // When both timers are stored, Flush timeout goes in iChannelReliabilityTimer and
927 // Retransmission timeout goes in iAdditionalChannelReliabilityTimer.
934 Typedef to represent a L2CAP Config object.
936 typedef TPckgBuf<TL2CapConfig> TL2CapConfigPkg;
939 enum TEirWrapperPanics
941 EEirBadUuid16List = 0,
942 EEirBadUuid128List = 1,
944 _LIT(KEirWrapperPanicName, "ExtendedInquiryResponseWrapper");