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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // BT protocol wide types
22 #include <bluetooth/eirdatacodec.h>
28 Minimum eSCO connection latency in milliseconds. Attempts to specify less than this will be silently
29 increased to this level.
31 static const TInt KMinESCOLatency = 4;
37 Typedef to represent a HCI connection handle.
39 typedef TUint16 THCIConnHandle;
45 Bluetooth SIG specified values for specification of (piconet) role.
49 EMaster = 0x00, /*!< Master role */
50 ESlave = 0x01, /*!< Slave role */
51 ERoleUnknown, /*!< Unknown role */
58 Bluetooth SIG specified values for indicating link modes.
62 EActiveMode = 0x00, /*!< Active mode */
63 EHoldMode = 0x01, /*!< Hold mode */
64 ESniffMode = 0x02, /*!< Sniff mode */
65 EParkMode = 0x04, /*!< Park mode */
66 EScatterMode = 0x08, /*!< Scatter mode */
73 Typedef to represent a union of TBTLinkMode values.
75 typedef TUint32 TBTLinkModeSet;
81 Bitmask values to help request combinations of link modes.
84 enum TBTLinkModeCombinations
86 EAnyLowPowerMode = (EHoldMode | ESniffMode | EParkMode | EScatterMode) /*!< Any low power mode */
93 Bluetooth SIG specified values for indicating packet types.
95 DM1, DH1, DM3, DH3, DM5, DH5 are ACL packet types
96 HV1, HV2, HV3 are SCO (synchronous link) packet types
100 EPacketsDM1 = 0x0008, /*!< DM1 ACL packet type */
101 EPacketsDH1 = 0x0010, /*!< DH1 ACL packet type */
102 EPacketsDM3 = 0x0400, /*!< DM3 ACL packet type */
103 EPacketsDH3 = 0x0800, /*!< DH3 ACL packet type */
104 EPacketsDM5 = 0x4000, /*!< DM5 ACL packet type */
105 EPacketsDH5 = 0x8000, /*!< DH5 ACL packet type */
107 EPackets2_DH1 = 0x0002, /*!< 2-DH1 ACL packet type */
108 EPackets3_DH1 = 0x0004, /*!< 3-DH1 ACL packet type */
109 EPackets2_DH3 = 0x0100, /*!< 2-DH3 ACL packet type */
110 EPackets3_DH3 = 0x0200, /*!< 3-DH3 ACL packet type */
111 EPackets2_DH5 = 0x1000, /*!< 2-DH5 ACL packet type */
112 EPackets3_DH5 = 0x2000, /*!< 3-DH5 ACL packet type */
114 EPacketsHV1 = 0x0020, /*!< HV1 SCO packet type */
115 EPacketsHV2 = 0x0040, /*!< HV2 SCO packet type */
116 EPacketsHV3 = 0x0080, /*!< HV3 SCO packet type */
123 Typedef to represent a set of SCO packet types.
125 typedef TUint16 TBTSCOPackets;
131 Typedef to represent a set of ACL packet types.
133 typedef TUint16 TBTACLPackets;
139 Bitmask values to help request combinations of packets.
142 enum TBTPacketTypeCombinations
144 EAnyACLPacket = EPacketsDM1 | EPacketsDM3 | EPacketsDM5 | EPacketsDH1 | EPacketsDH3 | EPacketsDH5, /*!< Any ACL packet */
145 EAnyNonEdrACLPacket = EAnyACLPacket | EPackets2_DH1 | EPackets3_DH1 | EPackets2_DH3 | EPackets3_DH3 | EPackets2_DH5 | EPackets3_DH5, /*!< Any Non-EDR ACL packet */
146 EAnySCOPacket = EPacketsHV1 | EPacketsHV2 | EPacketsHV3, /*!< Any SCO packet */
147 EAnyPacket = EAnyACLPacket | EAnySCOPacket /*!< Any packet */
155 Typedef to represent a set of synchronous packet types (SCO and eSCO on v1.2).
156 @see TBTSyncPackets::TSyncPackets
158 typedef TUint32 TBTSyncPacketTypes;
164 This constant is no longer needed to translate the SCO mapping of HV packet types to Synchronous
165 because CBluetoothSynchronousLink::SetupConnection(const TBTDevAddr& aBDAddr, const TUint16 aPacketTypes)
166 adjusts aPacketTypes internally on behalf of clients.
168 static const TInt KSCOvsSyncHVOffset = 5;
174 Class to represent a set of synchronous packet types (SCO and eSCO on v1.2).
175 This differs from TBTSyncPacketTypes as it is the interface used by CBluetoothSynchronousLink
176 in order to detect the difference between a pre and post eSCO caller. This is necessary
177 as HV1 packets in the SCO numbering clash with EV5 packets in the sync numbering.
179 NONSHARABLE_CLASS(TBTSyncPackets)
186 Individual synchronous packet types.
187 @see TBTSyncPacketTypes
191 ESyncPacketsHV1 = 0x10001,
192 ESyncPacketsHV2 = 0x10002,
193 ESyncPacketsHV3 = 0x10004,
195 ESyncPacketsEV3 = 0x20008,
196 ESyncPacketsEV4 = 0x20010,
197 ESyncPacketsEV5 = 0x20020,
199 ESyncAnySCOPacket = ESyncPacketsHV1 | ESyncPacketsHV2 | ESyncPacketsHV3,
200 ESyncAnyESCOPacket = ESyncPacketsEV3 | ESyncPacketsEV4 | ESyncPacketsEV5
204 IMPORT_C explicit TBTSyncPackets(TBTSyncPacketTypes aPackets);
205 IMPORT_C TBTSyncPacketTypes operator()() const;
208 TUint32 iPacketTypes;
210 // This data padding has been added to help prevent future binary compatibility breaks
211 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
221 eSCO links can have different retransmission options, optimised for link usage,
222 power or reliability.
224 @see CBluetoothSynchronousLink::SetRetransmissionEffort
226 enum TBTeSCORetransmissionTypes
228 EeSCORetransmitNone = 0,
229 EeSCORetransmitPower = 1,
230 EeSCORetransmitReliability = 2,
231 EeSCORetransmitDontCare = 0xff
238 eSCO unspecified bandwidth. This value can only be used by the accepting side
239 of an eSCO link, to allow any bandwidth to be specified by the initiator.
240 Otherwise both sides of the link must agree on the same bandwidth.
242 @see CBluetoothSynchronousLink::SetBandwidth
243 @see CBluetoothSynchronousLink::AcceptConnection
245 static const TUint32 KESCOBandwidthDontCare = KMaxTUint32;
250 Bit positions of the individual local and remote features.
253 enum TBTSupportedFeaturesBits
255 ESupportedThreeSlotPacketsBit = 0, /*!< Three slot packets are supported */
256 ESupportedFiveSlotPacketsBit = 1, /*!< Five slot packets are supported */
257 ESupportedEncryptionBit = 2, /*!< Encryption is supported */
258 ESupportedSlotOffsetBit = 3, /*!< Slot offset is supported */
259 ESupportedTimingAccuracyBit = 4, /*!< Timing accuracy is supported */
260 ESupportedSwitchBit = 5, /*!< Role switch is supported */
261 ESupportedHoldModeBit = 6, /*!< Hold mode is supported */
262 ESupportedSniffModeBit = 7, /*!< Sniff mode is supported */
263 ESupportedParkModeBit = 8, /*!< Park mode is supported */
264 ESupportedRSSIBit = 9, /*!< Receive signal strength indication is supported */
265 ESupportedChannelQualityDrivenDataRateBit = 10, /*!< Channel quality driven data rate is supported */
266 ESupportedSCOLinkBit = 11, /*!< SCO links are supported */
267 ESupportedHV2PacketsBit = 12, /*!< HV2 packets are supported */
268 ESupportedHV3PacketsBit = 13, /*!< HV3 packets are supported */
269 ESupportedu_lawLogBit = 14, /*!< SCO u-law encoding is supported */
270 ESupportedA_lawLogBit = 15, /*!< SCO A-law encoding is supported */
271 ESupportedCVSDBit = 16, /*!< SCO Continuously variable slope delta modulation is supported */
272 ESupportedPagingSchemeBit = 17, /*!< Paging scheme is supported */
273 ESupportedPowerControlBit = 18, /*!< Power control is supported */
274 ESupportedTransparentSCODataBit = 19, /*!< Transparent SCO data is supported */
275 ESupportedFlowControlLagBit0Bit = 20, /*!< Flow control lag bit 0 is supported */
276 ESupportedFlowControlLagBit1Bit = 21, /*!< Flow control lag bit 1 is supported */
277 ESupportedFlowControlLagBit2Bit = 22, /*!< Flow control lag bit 2 is supported */
278 ESupportedBroadcastEncryptionBit = 23, /*!< Broadcast encryption is supported */
280 EEDR_ACL_2MbpsModeBit = 25, /*!< 2Mbps EDR ACL supported */
281 EEDR_ACL_3MbpsModeBit = 26, /*!< 3Mbps EDR ACL supported */
282 ESupportedEnhancedEnquiryScanBit = 27, /*!< Enhanced enquiry scan is supported */
283 ESupportedInterlacedEnquiryScanBit = 28, /*!< Interlaced enquiry scan is supported */
284 ESupportedInterlacedPageScanBit = 29, /*!< Interlaced page scan is supported */
285 ESupportedRSSIWithInquiryResultsBit = 30, /*!< Read signal strength indication with inquiry is supported */
286 ESupportedExtendedSCOLinkBit = 31, /*!< Extended SCO links are supported */
287 ESupportedEV4PacketsBit = 32, /*!< EV4 packets are supported */
288 ESupportedEV5PacketsBit = 33, /*!< EV5 packets are supported */
290 ESupportedAFHCapableSlaveBit = 35, /*!< Adaptive frequency hopping in slave role is supported */
291 ESupportedAFHClassificationSlaveBit = 36, /*!< Adaptive frequency hopping classification in slave role is supported */
293 ESupportedEDRThreeSlotPacketsBit = 39, /*!< Three slot EDR packets are supported */
294 ESupportedEDRFiveSlotPacketsBit = 40, /*!< Five slot EDR packets are supported */
295 ESupportedSniffSubratingBit = 41, /*!< Sniff subrating is supported */
296 ESupportedEncryptionPauseResumeBit = 42, /*!< Encryption Pause and Resume is supported */
297 ESupportedAFHCapableMasterBit = 43, /*!< Adaptive frequency hopping in master role is supported */
298 ESupportedAFHClassificationMasterBit = 44, /*!< Adaptive frequency hopping classification in master role is supported */
299 EEDR_eSCO_2MbpsModeBit = 45, /*!< 2Mbps EDR eSCO supported */
300 EEDR_eSCO_3MbpsModeBit = 46, /*!< 3Mbps EDR eSCO supported */
301 ESupportedEDReSCOThreeSlotPacketsBit = 47, /*!< Three slot EDR eSCO packets are supported */
302 ESupportedExtendedInquiryResponseBit = 48, /*!< Extended Inquiry Response */
304 ESupportedSecureSimplePairingBit = 51, /*!< Secure Simple Pairing */
305 ESupportedEncapsulatedPDUBit = 52, /*!< Encapsulated PDU */
306 ESupportedErroneousDataReportingBit = 53, /*!< Erroneous Data Reporting */
307 ESupportedNonflushablePacketBoundaryFlagBit = 54, /*!< Non-flushable Packet Boundary Flag */
309 ESupportedLinkSupervisionTimeoutChangedEventBit = 56, /*!< Link Supervision Timeout Changed Event */
310 ESupportedInquiryResponseTXPowerLevelBit = 57, /*!< Inquiry Response TX Power Level */
312 ESupportedExtendedFeaturesBit = 63, /*!< Additional features are supported */
318 Bit positions of the individual local supported HCI commands.
319 @see TBluetoothHciCommands
321 enum TBluetoothSupportedCommandsBits
323 ESupportedInquiryCommand = 0, /*!< Inquiry command is supported */
324 ESupportedInquiryCancelCommand = 1, /*!< Inquiry Cancel command is supported */
325 ESupportedPeriodicInquiryModeCommand = 2, /*!< Periodic Inquiry Mode command is supported */
326 ESupportedExitPeriodicInquiryModeCommand = 3, /*!< Exit Periodic Inquiry Mode command is supported */
327 ESupportedCreateConnectionCommand = 4, /*!< Create Connection command is supported */
328 ESupportedDisconnectCommand = 5, /*!< Disconnect command is supported */
329 ESupportedAddSCOConnectionCommand = 6, /*!< Add SCO Connection command is supported */
330 ESupportedCancelCreateConnectionCommand = 7, /*!< Cancel Create Connection command is supported */
331 ESupportedAcceptConnectionRequestCommand = 8, /*!< Accept Connection Request command is supported */
332 ESupportedRejectConnectionRequestCommand = 9, /*!< Reject Connection Request command is supported */
333 ESupportedLinkKeyRequestReplyCommand = 10, /*!< Link Key Request Reply command is supported */
334 ESupportedLinkKeyRequestNegativeReplyCommand = 11, /*!< Link Key Request Negative Reply command is supported */
335 ESupportedPINCodeRequestReplyCommand = 12, /*!< PIN Code Request Reply command is supported */
336 ESupportedPINCodeRequestNegativeReplyCommand = 13, /*!< PIN Code Request Negative Reply command is supported */
337 ESupportedChangeConnectionPacketTypeCommand = 14, /*!< Change Connection Packet Type command is supported */
338 ESupportedAuthenticationRequestCommand = 15, /*!< Authentication Request command is supported */
339 ESupportedSetConnectionEncryptionCommand = 16, /*!< Set Connection Encryption command is supported */
340 ESupportedChangeConnectionLinkKeyCommand = 17, /*!< Change Connection Link Key command is supported */
341 ESupportedMasterLinkKeyCommand = 18, /*!< Master Link Key command is supported */
342 ESupportedRemoteNameRequestCommand = 19, /*!< Remote Name Request command is supported */
343 ESupportedCancelRemoteNameRequestCommand = 20, /*!< Cancel Remote Name Request command is supported */
344 ESupportedReadRemoteSupportedFeaturesCommand = 21, /*!< Read Remote Supported Features command is supported */
345 ESupportedReadRemoteExtendedFeaturesCommand = 22, /*!< Read Remote Extended Features command is supported */
346 ESupportedReadRemoteVersionInformationCommand = 23, /*!< Read Remote Version Information command is supported */
347 ESupportedReadClockOffsetCommand = 24, /*!< Read Clock Offset command is supported */
348 ESupportedReadLMPHandleCommand = 25, /*!< Read LMP Handle command is supported */
349 ESupportedHoldModeCommand = 33, /*!< Hold Mode command is supported */
350 ESupportedSniffModeCommand = 34, /*!< Sniff Mode command is supported */
351 ESupportedExitSniffModeCommand = 35, /*!< Exit Sniff Mode command is supported */
352 ESupportedParkStateCommand = 36, /*!< Park State command is supported */
353 ESupportedExitParkStateCommand = 37, /*!< Exit Park State command is supported */
354 ESupportedQoSSetupCommand = 38, /*!< QoS Setup command is supported */
355 ESupportedRoleDiscoveryCommand = 39, /*!< Role Discovery command is supported */
356 ESupportedSwitchRoleCommand = 40, /*!< Switch Role command is supported */
357 ESupportedReadLinkPolicySettingsCommand = 41, /*!< Read Link Policy Settings command is supported */
358 ESupportedWriteLinkPolicySettingsCommand = 42, /*!< Write Link Policy Settings command is supported */
359 ESupportedReadDefaultLinkPolicySettingsCommand = 43, /*!< Read Default Link Policy Settings command is supported */
360 ESupportedWriteDefaultLinkPolicySettingsCommand = 44, /*!< Write Default Link Policy Settings command is supported */
361 ESupportedFlowSpecificationCommand = 45, /*!< Flow Specification command is supported */
362 ESupportedSetEventMarkCommand = 46, /*!< Set Event Mark command is supported */
363 ESupportedResetCommand = 47, /*!< Reset command is supported */
364 ESupportedSetEventFilterCommand = 48, /*!< Set Event Filter command is supported */
365 ESupportedFlushCommand = 49, /*!< Flush command is supported */
366 ESupportedReadPINTypeCommand = 50, /*!< Read PIN Type command is supported */
367 ESupportedWritePINTypeCommand = 51, /*!< Write PIN Type command is supported */
368 ESupportedCreateNewUnitKeyCommand = 52, /*!< Create New Unit Key command is supported */
369 ESupportedReadStoredLinkKeyCommand = 53, /*!< Read Stored Link Key command is supported */
370 ESupportedWriteStoredLinkKeyCommand = 54, /*!< Write Stored Link Key command is supported */
371 ESupportedDeleteStoredLinkKeyCommand = 55, /*!< Delete Stored Link Key command is supported */
372 ESupportedWriteLocalNameCommand = 56, /*!< Write Local Name command is supported */
373 ESupportedReadLocalNameCommand = 57, /*!< Read Local Name command is supported */
374 ESupportedReadConnectionAcceptTimeoutCommand = 58, /*!< Read Connection Accept Timeout command is supported */
375 ESupportedWriteConnectionAcceptTimeoutCommand = 59, /*!< Write Connection Accept Timeout command is supported */
376 ESupportedReadPageTimeoutCommand = 60, /*!< Read Page Timeout command is supported */
377 ESupportedWritePageTimeoutCommand = 61, /*!< Write Page Timeout command is supported */
378 ESupportedReadScanEnableCommand = 62, /*!< Read Scan Enable command is supported */
379 ESupportedWriteScanEnableCommand = 63, /*!< Write Scan Enable command is supported */
380 ESupportedReadPageScanActivityCommand = 64, /*!< Read Page Scan Activity command is supported */
381 ESupportedWritePageScanActivityCommand = 65, /*!< Write Page Scan Activity command is supported */
382 ESupportedReadInquiryScanActivityCommand = 66, /*!< Read Inquiry Scan Activity command is supported */
383 ESupportedWriteInquiryScanActivityCommand = 67, /*!< Write Inquiry Scan Activity command is supported */
384 ESupportedReadClassOfDeviceCommand = 72, /*!< Read Class Of Device command is supported */
385 ESupportedWriteClassOfDeviceCommand = 73, /*!< Write Class Of Device command is supported */
386 ESupportedReadVoiceSettingCommand = 74, /*!< Read Voice Setting command is supported */
387 ESupportedWriteVoiceSettingCommand = 75, /*!< Write Voice Setting command is supported */
388 ESupportedReadAutomaticFlushTimeoutCommand = 76, /*!< Read Automatic Flush Timeout command is supported */
389 ESupportedWriteAutomaticFlushTimeoutCommand = 77, /*!< Write Automatic Flush Timeout command is supported */
390 ESupportedReadNumBroadcastRetransmissionsCommand = 78, /*!< Read Num Broadcast Retransmissions command is supported */
391 ESupportedWriteNumBroadcastRetransmissionsCommand = 79, /*!< Write Num Broadcast Retransmissions command is supported */
392 ESupportedReadHoldModeActivityCommand = 80, /*!< Read Hold Mode Activity command is supported */
393 ESupportedWriteHoldModeActivityCommand = 81, /*!< Write Hold Mode Activity command is supported */
394 ESupportedReadTransmitPowerLevelCommand = 82, /*!< Read Transmit Power Level command is supported */
395 ESupportedReadSynchronousFlowControlEnableCommand = 83, /*!< Read Synchronous Flow Control Enable command is supported */
396 ESupportedWriteSynchronousFlowControlEnableCommand = 84, /*!< Write Synchronous Flow Control Enable command is supported */
397 ESupportedSetHostControllerToHostFlowControlCommand = 85, /*!< Set Host Controller To Host Flow Control command is supported */
398 ESupportedHostBufferSizeCommand = 86, /*!< Host Buffer Size command is supported */
399 ESupportedHostNumberOfCompletedPacketsCommand = 87, /*!< Host Number Of Completed Packets command is supported */
400 ESupportedReadLinkSupervisionTimeoutCommand = 88, /*!< Read Link Supervision Timeout command is supported */
401 ESupportedWriteLinkSupervisionTimeoutCommand = 89, /*!< Write Link Supervision Timeout command is supported */
402 ESupportedReadNumberofSupportedIACCommand = 90, /*!< Read Number of Supported IAC command is supported */
403 ESupportedReadCurrentIACLAPCommand = 91, /*!< Read Current IAC LAP command is supported */
404 ESupportedWriteCurrentIACLAPCommand = 92, /*!< Write Current IAC LAP command is supported */
405 ESupportedReadPageScanModeCommand = 95, /*!< Read Page Scan Mode command is supported */
406 ESupportedWritePageScanModeCommand = 96, /*!< Write Page Scan Mode command is supported */
407 ESupportedSetAFHChannelClassificationCommand = 97, /*!< Set AFH Channel Classification command is supported */
408 ESupportedReadInquiryScanTypeCommand = 100, /*!< Read Inquiry Scan Type command is supported */
409 ESupportedWriteInquiryScanTypeCommand = 101, /*!< Write Inquiry Scan Type command is supported */
410 ESupportedReadInquiryModeCommand = 102, /*!< Read Inquiry Mode command is supported */
411 ESupportedWriteInquiryModeCommand = 103, /*!< Write Inquiry Mode command is supported */
412 ESupportedReadPageScanTypeCommand = 104, /*!< Read Page Scan Type command is supported */
413 ESupportedWritePageScanTypeCommand = 105, /*!< Write Page Scan Type command is supported */
414 ESupportedReadAFHChannelAssessmentModeCommand = 106, /*!< Read AFH Channel Assessment Mode command is supported */
415 ESupportedWriteAFHChannelAssessmentModeCommand = 107, /*!< Write AFH Channel Assessment Mode command is supported */
416 ESupportedReadLocalVersionInformationCommand = 115, /*!< Read Local Version Information command is supported */
417 ESupportedReadLocalSupportedFeaturesCommand = 117, /*!< Read Local Supported Features command is supported */
418 ESupportedReadLocalExtendedFeaturesCommand = 118, /*!< Read Local Extended Features command is supported */
419 ESupportedReadBufferSizeCommand = 119, /*!< Read Buffer Size command is supported */
420 ESupportedReadCountryCodeCommand = 120, /*!< Read Country Code [Deprecated] command is supported */
421 ESupportedReadBDADDRCommand = 121, /*!< Read BD ADDR command is supported */
422 ESupportedReadFailedContactCountCommand = 122, /*!< Read Failed Contact Count command is supported */
423 ESupportedResetFailedContactCountCommand = 123, /*!< Reset Failed Contact Count command is supported */
424 ESupportedGetLinkQualityCommand = 124, /*!< Get Link Quality command is supported */
425 ESupportedReadRSSICommand = 125, /*!< Read RSSI command is supported */
426 ESupportedReadAFHChannelMapCommand = 126, /*!< Read AFH Channel Map command is supported */
427 ESupportedReadBDClockCommand = 127, /*!< Read BD Clock command is supported */
428 ESupportedReadLoopbackModeCommand = 128, /*!< Read Loopback Mode command is supported */
429 ESupportedWriteLoopbackModeCommand = 129, /*!< Write Loopback Mode command is supported */
430 ESupportedEnableDeviceUnderTestModeCommand = 130, /*!< Enable Device Under Test Mode command is supported */
431 ESupportedSetupSynchronousConnectionCommand = 131, /*!< Setup Synchronous Connection command is supported */
432 ESupportedAcceptSynchronousConnectionCommand = 132, /*!< Accept Synchronous Connection command is supported */
433 ESupportedRejectSynchronousConnectionCommand = 133, /*!< Reject Synchronous Connection command is supported */
434 ESupportedReadExtendedInquiryResponseCommand = 136, /*!< Read Extended Inquiry Response command is supported */
435 ESupportedWriteExtendedInquiryResponseCommand = 137, /*!< Write Extended Inquiry Response command is supported */
436 ESupportedRefreshEncryptionKeyCommand = 138, /*!< Refresh Encryption Key command is supported */
437 ESupportedSniffSubratingCommand = 140, /*!< Sniff Subrating command is supported */
438 ESupportedReadSimplePairingModeCommand = 141, /*!< Read Simple Pairing Mode command is supported */
439 ESupportedWriteSimplePairingModeCommand = 142, /*!< Write Simple Pairing Mode command is supported */
440 ESupportedReadLocalOOBDataCommand = 143, /*!< Read Local OOB Data command is supported */
441 ESupportedReadInquiryResponseTransmitPowerCommand = 144, /*!< Read Inquiry Response Transmit Power command is supported */
442 ESupportedWriteInquiryTransmitPowerLevelCommand = 145, /*!< Write Inquiry Transmit Power Level command is supported */
443 ESupportedReadDefaultErroneousDataReportingCommand = 146, /*!< Read Default Erroneous Data Reporting command is supported */
444 ESupportedWriteDefaultErroneousDataReportingCommand = 147, /*!< Write Default Erroneous Data Reporting command is supported */
445 ESupportedIOCapabilityRequestReplyCommand = 151, /*!< IO Capability Request Reply command is supported */
446 ESupportedUserConfirmationRequestReplyCommand = 152, /*!< User Confirmation Request Reply command is supported */
447 ESupportedUserConfirmationRequestNegativeReplyCommand = 153, /*!< User Confirmation Request Negative Reply command is supported */
448 ESupportedUserPasskeyRequestReplyCommand = 154, /*!< User Passkey Request Reply command is supported */
449 ESupportedUserPasskeyRequestNegativeReplyCommand = 155, /*!< User Passkey Request Negative Reply command is supported */
450 ESupportedRemoteOOBDataRequestReplyCommand = 156, /*!< Remote OOB Data Request Reply command is supported */
451 ESupportedWriteSimplePairingDebugModeCommand = 157, /*!< Write Simple Pairing Debug Mode command is supported */
452 ESupportedEnhancedFlushCommand = 158, /*!< Enhanced Flush command is supported */
453 ESupportedRemoteOOBDataRequestNegativeReplyCommand = 159, /*!< Remote OOB Data Request Negative Reply command is supported */
454 ESupportedSendKeypressNotificationCommand = 162, /*!< Send Keypress Notification command is supported */
455 ESupportedIOCapabilitiesResponseNegativeReplyCommand = 163, /*!< IO Capabilities Response Negative Reply command is supported */
462 Bluetooth SIG specified values indicating whether a device
463 is physically able to support a baseband (or link manager protocol) feature
465 enum TBTSupportedFeatures
467 ESupportedThreeSlotPackets = 1<<0, /*!< Three slot packets are supported */
468 ESupportedFiveSlotPackets = 1<<1, /*!< Five slot packets are supported */
469 ESupportedEncryption = 1<<2, /*!< Encryption is supported */
470 ESupportedSlotOffset = 1<<3, /*!< Slot offset is supported */
471 ESupportedTimingAccuracy = 1<<4, /*!< Timing accuracy is supported */
472 ESupportedSwitch = 1<<5, /*!< Role switch is supported */
473 ESupportedHoldMode = 1<<6, /*!< Hold mode is supported */
474 ESupportedSniffMode = 1<<7, /*!< Sniff mode is supported */
475 ESupportedParkMode = 1<<8, /*!< Park mode is supported */
476 ESupportedRSSI = 1<<9, /*!< Receive signal strength indication is supported */
477 ESupportedChannelQualityDrivenDataRate = 1<<10, /*!< Channel quality driven data rate is supported */
478 ESupportedSCOLink = 1<<11, /*!< SCO links are supported */
479 ESupportedHV2Packets = 1<<12, /*!< HV2 packets are supported */
480 ESupportedHV3Packets = 1<<13, /*!< HV3 packets are supported */
481 ESupportedu_lawLog = 1<<14, /*!< SCO u-law encoding is supported */
482 ESupportedA_lawLog = 1<<15, /*!< SCO A-law encoding is supported */
483 ESupportedCVSD = 1<<16, /*!< SCO Continuously variable slope delta modulation is supported */
484 ESupportedPagingScheme = 1<<17, /*!< Paging scheme is supported */
485 ESupportedPowerControl = 1<<18, /*!< Power control is supported */
486 ESupportedTransparentSCOData = 1<<19, /*!< Transparent SCO data is supported */
487 ESupportedFlowControlLagBit0 = 1<<20, /*!< Flow control lag bit 0 is supported */
488 ESupportedFlowControlLagBit1 = 1<<21, /*!< Flow control lag bit 1 is supported */
489 ESupportedFlowControlLagBit2 = 1<<22, /*!< Flow control lag bit 2 is supported */
496 Bitmask values for notifying/requesting notification of the state of a physical link.
498 These values have a two fold purpose:
499 1) They can be used along with TBTPhysicalLinkStateNotifierCombinations to specify
500 a set of baseband change events for which notification is desired.
501 2) They can be used to notify the state of a physical link or a subset of that state.
502 For example if only mode change events are being monitored, then at each mode change event
503 only the bit reperesenting the new mode will be returned, however if the whole link state
504 is required, then a combination of bit values indicating that state will be returned.
506 THESE BIT VALUES MUST ONLY BE USED WHEN REQUESTING NOTIFICATION, OR WHEN PARSING THE
507 RESULTS OF A NOTIFICATION. All other baseband state activities should use one of the
508 appropriate Bluetooth SIG specified enums
511 @see TBTLinkModeCombinations
513 @see TBTPacketTypeCombinations
515 enum TBTPhysicalLinkStateNotifier
517 ENotifyMaster = 0x00000001, /*!< Master */
518 ENotifySlave = 0x00000002, /*!< Slave */
520 ENotifyActiveMode = 0x00000004, /*!< Active mode */
521 ENotifySniffMode = 0x00000008, /*!< Sniff mode */
522 ENotifyParkMode = 0x00000010, /*!< Park mode */
523 ENotifyHoldMode = 0x00000020, /*!< Hold mode */
525 ENotifyMaxSlots1 = 0x00000040, /*!< Max slots 1 */
526 ENotifyMaxSlots3 = 0x00000080, /*!< Max slots 3 */
527 ENotifyMaxSlots5 = 0x00000100, /*!< Max slots 5 */
529 ENotifyPacketsDM1 = 0x00000200, /*!< Packets DM1 */
530 ENotifyPacketsDH1 = 0x00000400, /*!< Packets DH1 */
531 ENotifyPacketsDM3 = 0x00000800, /*!< Packets DM3 */
532 ENotifyPacketsDH3 = 0x00001000, /*!< Packets DH3 */
533 ENotifyPacketsDM5 = 0x00002000, /*!< Packets DM5 */
534 ENotifyPacketsDH5 = 0x00004000, /*!< Packets DH5 */
536 ENotifyPacketsHV1 = 0x00008000, /*!< HV1 */
537 ENotifyPacketsHV2 = 0x00010000, /*!< HV2 */
538 ENotifyPacketsHV3 = 0x00020000, /*!< HV3 */
540 ENotifyAuthenticationComplete = 0x00040000, /*!< Authentication Complete */
541 ENotifyEncryptionChangeOn = 0x00080000, /*!< Encryption Change On */
542 ENotifyEncryptionChangeOff = 0x00100000, /*!< Encryption Change Off */
544 ENotifyPhysicalLinkUp = 0x00200000, /*!< Physical Link Up */
545 ENotifyPhysicalLinkDown = 0x00400000, /*!< Physical Link Down */
546 ENotifyPhysicalLinkError = 0x00800000, /*!< Physical Link Error */
548 ENotifySynchronousLinkUp = 0x01000000, /*!< Synchronous Link Up */
549 ENotifySynchronousLinkDown = 0x02000000, /*!< Synchronous Link Down */
550 ENotifySynchronousLinkError = 0x04000000, /*!< Synchronous Link Error */
553 @deprecated This has been superseded by ENotifySynchronousLinkUp
554 @see ENotifySynchronousLinkUp
556 ENotifySCOLinkUp = ENotifySynchronousLinkUp,
558 @deprecated This has been superseded by ENotifySynchronousLinkDown
559 @see ENotifySynchronousLinkDown
561 ENotifySCOLinkDown = ENotifySynchronousLinkDown,
563 @deprecated This has been superseded by ENotifySynchronousLinkError
564 @see ENotifySynchronousLinkError
566 ENotifySCOLinkError = ENotifySynchronousLinkError
574 Bitmask values to help request notification of the state of a physical link.
575 @see TBTPhysicalLinkStateNotifier
577 enum TBTPhysicalLinkStateNotifierCombinations
579 ENotifyAnyRole = ENotifyMaster | ENotifySlave,
580 ENotifyAnyLowPowerMode = ENotifySniffMode | ENotifyParkMode | ENotifyHoldMode,
581 ENotifyAnyPowerMode = ENotifyActiveMode | ENotifyAnyLowPowerMode,
582 ENotifyAnyMaxSlots = ENotifyMaxSlots1 | ENotifyMaxSlots3 | ENotifyMaxSlots5,
583 ENotifyAnyACLPacketType = ENotifyPacketsDM1 | ENotifyPacketsDH1 | ENotifyPacketsDM3 | EPacketsDH3 | EPacketsDM5 | EPacketsDH5,
584 ENotifyAnySCOPacketType = ENotifyPacketsHV1 | ENotifyPacketsHV2 | ENotifyPacketsHV3,
585 ENotifyAnyPacketType = ENotifyAnyACLPacketType | ENotifyAnySCOPacketType,
586 ENotifyAnyPhysicalLinkState = 0xffffffff,
593 The maximum length of an SDP UUID.
595 static const TInt KSdpUUIDMaxLength = 16;
601 The size of a bluetooth device address in bytes.
603 const TInt KBTDevAddrSize=0x06;
609 The size of a bluetooth device address in bytes.
611 const TInt KBTMaxDevAddrSize = KBTDevAddrSize;
617 48-bit bluetooth device address.
618 Each bluetooth device has a unique address built into the hardware, which
619 is represented by this class. Used for identifying remote addresses.
620 The interface operates in a big-endian manner -- e.g. addr[0] refers
621 to the most significant byte of the address. This is the same ordering
622 as the addresses would naturally be written down on paper.
624 NONSHARABLE_CLASS(TBTDevAddr)
627 IMPORT_C TBTDevAddr();
628 IMPORT_C TBTDevAddr(const TInt64 &aInt);
629 IMPORT_C TBTDevAddr(const TDesC8 &aDes);
630 IMPORT_C TBool operator==(const TBTDevAddr& aAddr) const;
631 IMPORT_C TBool operator!=(const TBTDevAddr& aAddr) const;
632 IMPORT_C const TUint8 &operator[](TInt aIndex) const;
633 IMPORT_C TUint8 &operator[](TInt aIndex);
634 IMPORT_C void Reset();
635 IMPORT_C TPtr8 Des();
636 IMPORT_C const TPtrC8 Des() const;
637 IMPORT_C TInt SetReadable(const TDesC& aSource);
638 IMPORT_C void GetReadable(TDes& aDest) const;
639 IMPORT_C void GetReadable(TDes& aDest, const TDesC& aPrepend, const TDesC& aByteSeperator, const TDesC& aAppend) const;
640 IMPORT_C TBool operator<=(const TBTDevAddr& aAddr) const;
642 TFixedArray<TUint8, KBTDevAddrSize> iAddr;
644 // This data padding has been added to help prevent future binary compatibility breaks
645 // iPadding hasn't been zero'd because it is currently not used
653 A Bluetooth Universally Unique Identifier.
655 This is a 128-bit quantity that can be created without a central registry
656 while still being globally unique.
657 UUIDs are always held in full 128 bit format, however they can be set from
658 BT SIG short form (16 or 32 bit) addresses, and returned as down to their
659 shortest form using ShortestForm().
661 NONSHARABLE_CLASS(TUUID)
665 IMPORT_C TUUID(TUint32 aLong);
666 IMPORT_C TUUID(TUint32 aHH, TUint32 aHL, TUint32 aLH, TUint32 aLL);
667 IMPORT_C TUUID(const TUid& aUid);
668 IMPORT_C void SetL(const TDesC8& aDes);
669 IMPORT_C const TPtrC8 LongForm() const;
670 IMPORT_C const TPtrC8 ShortestForm() const;
671 IMPORT_C const TPtrC8 Des() const;
674 Use SpecifiedLengthL(TInt aLength) instead
676 IMPORT_C const TPtrC8 FixedLengthL(TInt aLength) const;
677 IMPORT_C TInt MinimumSize() const;
678 IMPORT_C TBool operator==(const TUUID& aUUID) const;
679 IMPORT_C TBool operator!=(const TUUID& aUUID) const;
680 IMPORT_C const TUint8 &operator[](TInt aIndex) const;
681 IMPORT_C TUint8 &operator[](TInt aIndex);
682 IMPORT_C const TPtrC8 SpecifiedLengthL(TInt aLength) const;
683 IMPORT_C void SetFromLittleEndianL(const TDesC8& aDes);
685 TFixedArray<TUint8, KSdpUUIDMaxLength> iUUID;
687 // This data padding has been added to help prevent future binary compatibility breaks
688 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
698 A UUID container class
700 NONSHARABLE_CLASS(RUUIDContainer)
703 IMPORT_C void Close();
704 IMPORT_C void Reset();
705 IMPORT_C TInt Count() const;
706 IMPORT_C TUUID& operator[](TInt aIndex);
707 IMPORT_C const TUUID& operator[](TInt aIndex) const;
708 IMPORT_C const TUUID& At(TInt aIndex) const;
709 IMPORT_C TBool IsPresent(const TUUID& aUuid) const;
710 IMPORT_C TInt Add(const TUUID& aUuid);
713 RArray<TUUID> iUUIDs;
715 // This data padding has been added to help prevent future binary compatibility breaks
716 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
726 An EIR UUID container class. Contains UUIDs and indications of data completeness
728 NONSHARABLE_CLASS(RExtendedInquiryResponseUUIDContainer)
739 IMPORT_C void Close();
740 IMPORT_C RUUIDContainer& UUIDs();
741 IMPORT_C void SetCompleteness(TUUIDType aType, TBool aIsComplete);
742 IMPORT_C TBool GetCompleteness(TUUIDType aType) const;
745 RUUIDContainer iUUIDs;
748 // This data padding has been added to help prevent future binary compatibility breaks
749 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
758 The size of a link key, in bytes.
760 const TUint8 KHCILinkKeySize=16;
766 The size of a pin code, in bytes.
768 const TUint8 KHCIPINCodeSize=16;
776 NONSHARABLE_CLASS(TLinkKeyV10)
779 TUint8 iLinkKey[KHCILinkKeySize]; /*!< The link key */
786 Typedef'ed TPckgBuf of the class TLinkKeyV10.
788 typedef TPckgBuf<TLinkKeyV10> TBTLinkKey;
791 The type of a link key with a remote device
797 ELinkKeyCombination, /*!< this key has been generated with pairing with pre-v2.1 Bluetooth devices. */
798 ELinkKeyUnauthenticatedUpgradable, /*!< this key hasn't yet been tried with MITM protection */
799 ELinkKeyUnauthenticatedNonUpgradable, /*!< this key tried MITM protection; remote device incapable */
800 ELinkKeyAuthenticated, /*!< this key authenticated with MITM protection */
801 ELinkKeyDebug /*!< this key has been generated when in simple pairing debug mode */
808 Bluetooth PIN Code structure.
810 NONSHARABLE_CLASS(TPINCodeV10)
813 IMPORT_C TBool operator==(const TPINCodeV10& aTPINCodeV10) const;
816 TUint8 iLength; /*!< The length of the pin key */
817 TUint8 iPIN[KHCIPINCodeSize]; /*!< The pin code */
824 Typedef'ed TPckgBuf of the class TPINCodeV10.
826 typedef TPckgBuf<TPINCodeV10> TBTPinCode;
829 The size of a simple pairing hash in bytes.
833 const TInt KBluetoothSimplePairingHashSize = 16;
835 A representation of the simple pairing hash.
839 typedef TBuf8<KBluetoothSimplePairingHashSize> TBluetoothSimplePairingHash;
842 The size of a simple pairing hash in randomizer.
846 const TInt KBluetoothSimplePairingRandomizerSize = 16;
848 A representation of the simple pairing randomizer.
852 typedef TBuf8<KBluetoothSimplePairingRandomizerSize> TBluetoothSimplePairingRandomizer;
855 Extended Inquiry Response Class
856 This class takes a reference from inquiry result, which could hold both local name and Extended Inquiry Response.
857 It provides API to parse and return the local name and data for any Extended Inquiry Response tag.
858 To get Device Name, Manufacturer Specific Data or Flags, firstly getting length of the data,
859 and then allocating a suitable buffer, which is where the data will be placed.
861 NONSHARABLE_CLASS(TBluetoothNameRecordWrapper)
864 IMPORT_C explicit TBluetoothNameRecordWrapper(const TNameRecord& aNameRecord);
865 IMPORT_C TInt GetDeviceName(TDes16& aName, TBool& aIsComplete) const;
866 IMPORT_C TInt GetServiceClassUuids(RExtendedInquiryResponseUUIDContainer& aEIRContainer) const;
867 IMPORT_C TInt GetVendorSpecificData(TDes8& aDes) const;
868 IMPORT_C TInt GetTxPowerLevel(TInt8& aTxPowerLevel) const;
869 IMPORT_C TInt GetFlags(TDes8& aDes) const;
870 IMPORT_C TInt GetDeviceNameLength() const;
871 IMPORT_C TInt GetVendorSpecificDataLength() const;
872 IMPORT_C TInt GetFlagsLength() const;
875 TInt AddUuids16(RExtendedInquiryResponseUUIDContainer& aEIRContainer, TPtrC8& aUuids) const;
876 TInt AddUuids128(RExtendedInquiryResponseUUIDContainer& aEIRContainer, TPtrC8& aUuids) const;
878 TExtendedInquiryResponseDataCodec iEirCodec;
880 // This data padding has been added to help prevent future binary compatibility breaks
881 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
890 Contains information resulting from a baseband notification.
892 NONSHARABLE_CLASS(TBTBasebandEventNotification)
897 @param aEventType The type of event.
898 @param aErrorCode The error code.
900 TBTBasebandEventNotification(TUint32 aEventType, TInt aErrorCode = KErrNone) : iEventType(aEventType), iErrorCode(aErrorCode) {};
905 TBTBasebandEventNotification() : iEventType(0), iErrorCode(KErrNone) {};
909 @param aEvent The event to copy.
911 TBTBasebandEventNotification(const TBTBasebandEventNotification& aEvent) : iEventType(aEvent.iEventType), iErrorCode(aEvent.iErrorCode) {};
915 @return The event type.
917 TUint32 EventType() const { return iEventType; };
920 The Bluetooth SIG error code associated with the event.
921 @return The SIG error code.
923 TInt ErrorCode() const { return iErrorCode; };
926 The Symbian HCI error code associated with the event.
927 @return The Symbian error code.
929 IMPORT_C TInt SymbianErrorCode() const;
933 @param aEventType The event type.
935 void SetEventType(TUint32 aEventType) { iEventType = aEventType; };
939 @param aErrorCode The Bluetooth SIG error code.
941 void SetErrorCode(TInt aErrorCode) { iErrorCode = aErrorCode; };
952 Typedef'ed pckgbuf of the class TBTBasebandEventNotification.
954 typedef TPckgBuf<TBTBasebandEventNotification> TBTBasebandEvent;
960 General Unlimited Inquiry Access Code
962 const TUint KGIAC=0x9e8b33;
968 Limited Inquiry Access Code
970 const TUint KLIAC=0x9e8b00;
977 API class for setting up an L2Cap configuration
979 This class may be used to set all or a subset of the following configuration items:
980 Channel Reliability (and associated timer)
981 Maximum Transmission Unit
985 If a configuration item is to be set, then its 'Set' or 'Setup'
986 method should be called.
988 Once a TL2CapConfig object has been set up it should be sent using
989 RSocket::SetOption or RSocket::Ioctl (or the CBluetoothSocket) equivalents.
992 @see CBluetoothSocket
994 NONSHARABLE_CLASS(TL2CapConfig)
998 Priority required for data on L2Cap channel
1000 enum TChannelPriority
1008 Reliability of data tranfer required for L2Cap channel
1010 enum TChannelReliability
1017 Timer values in milliseconds for reliable and unreliable channels
1019 enum TL2CapConfigSpecifiedTimers
1022 This is a time in milliseconds. However 0xffff has been given a special meaning
1023 in this interface. It means "Allow up 256 transmissions of a single packet before
1024 giving up and disconnecting the L2Cap channel.". This is the maximum number of
1025 transmissions effectively allowed by the spec.
1027 EDefaultRetransmission = 0xffff,
1029 Minimum data obsolescence timeout required because data packets
1030 will not ever be sent if we flush them too quickly.
1031 Speed of sending data depends on how many channels are open and channel priority.
1033 EMinDataObsolescenceTimeout = 0x0a,
1035 This is translated to mean never flush (as per spec).
1037 EDefaultDataObsolescenceTimeout = 0xffff,
1041 Used to indicate which config options have been specified by the user
1043 enum TL2CapConfigSpecifiedMask
1045 ENoConfigElementsSpecified = 0x0000,
1046 EMTUSizeSpecifiedMask = 0x0001,
1047 EMRUSizeSpecifiedMask = 0x0002,
1048 EReliabilitySpecifiedMask = 0x0004,
1049 EPrioritySpecifiedMask = 0x0008,
1052 IMPORT_C TL2CapConfig();
1054 IMPORT_C TInt SetMaxTransmitUnitSize(TUint16 aSize = 0xffff);
1055 IMPORT_C TUint16 MaxTransmitUnitSize(TBool& aIsSpecified) const;
1056 IMPORT_C TInt SetMaxReceiveUnitSize(TUint16 aSize = 0xffff);
1057 IMPORT_C TUint16 MaxReceiveUnitSize(TBool& aIsSpecified) const;
1059 IMPORT_C TInt ConfigureReliableChannel(TUint16 aRetransmissionTimer);
1060 IMPORT_C TInt ConfigureUnreliableChannel(TUint16 aObsolescenceTimer);
1061 IMPORT_C TChannelReliability ChannelReliability(TBool& aIsSpecified, TUint16& aAssociatedTimer) const;
1063 IMPORT_C TInt ConfigureChannelPriority(TChannelPriority aPriority);
1064 IMPORT_C TChannelPriority ChannelPriority(TBool& aIsSpecified) const;
1068 Use ConfigureReliableChannel(TUint16 aRetransmissionTimer) instead
1070 IMPORT_C TInt SetupReliableChannel(TUint16 aRetransmissionTimer = EDefaultRetransmission);
1073 Use ConfigureUnreliableChannel(TUint16 aObsolescenceTimer) instead
1075 IMPORT_C TInt SetupUnreliableChannel(TUint16 aObsolescenceTimer = EDefaultDataObsolescenceTimeout);
1078 Use ConfigureChannelPriority(TChannelPriority aPriority) instead
1080 IMPORT_C TInt SetChannelPriority(TChannelPriority aPriority = ELow);
1085 TChannelReliability iChannelReliability;
1086 TUint16 iChannelReliabilityTimer;
1087 TChannelPriority iChannelPriority;
1088 TUint16 iSpecifiedMask;
1090 // This data padding has been added to help prevent future binary compatibility breaks
1091 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
1100 Typedef to represent a L2CAP Config object.
1102 typedef TPckgBuf<TL2CapConfig> TL2CapConfigPkg;
1105 enum TEirWrapperPanics
1107 EEirBadUuid16List = 0,
1108 EEirBadUuid128List = 1,
1110 _LIT(KEirWrapperPanicName, "ExtendedInquiryResponseWrapper");