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 // This is the API that the bluetooth stack expects from the HCI layer.
15 // It comprises an event notification interface and a command sending interface.
16 // Implementations of the HCI must derive from CHCIBase.
32 #include <hcierrors.h>
36 #include <bluetooth/hci/hciopcodes.h>
37 #include <bluetooth/hci/aclpacketconsts.h>
38 #include <bluetooth/hci/hciconsts.h>
39 #include <bluetooth/hci/basebandpacketconsts.h>
41 class CHCICommandFrame;
42 class CHCIACLDataFrame;
43 class CHCISCODataFrame;
45 class MHCIEventObserver;
48 /** Factory for creating CHCIBase derived class.
50 To provide a new HCI implementation, re-implement this
51 class in a DLL, which has a factory fucntion at oridnal 1
52 which returns a TAny* to the instance of this factory.
53 NewHCIL() will then be called on the factory to actually
54 create the CHCIBase derived object.
59 NONSHARABLE_CLASS(CHCIFactory) : public CBase
63 virtual TVersion Version() const;
64 virtual CHCIBase* NewHCIL(MHCIEventObserver* aParent, CESockIniData* aIni=0);
65 virtual CHCICommandFrame* NewHCICommandFrameL(THCIOpcode aOpcode);
66 virtual CHCIACLDataFrame* NewHCIACLDataFrameL(TUint16 aSize);
67 virtual CHCISCODataFrame* NewHCISCODataFrameL(TUint8 aSize);
71 /** Abstract HCI Interface class.
73 The Symbian Bluetooth stack uses this abstract class as the
74 polymorphic base through which it obtains host controller
75 access. The actual implementation is dependent on the DLL
76 loaded at run-time, as specified in the bt.bt.esk file.
77 The concrete class derived from this should be returned
78 by the CHCIFactory class, located through ordinal 1 in the
84 CHCI for detailed description of the functions.
85 MHCIEventObserver for the callback interface for events received over HCI.
87 NONSHARABLE_CLASS(CHCIBase) : public CBase
91 /** Writes command frame.
93 @param aFrame command frame to write
94 @return KErrBcspWriteCommandDataFailed on failure, KErrNone otherwise
98 virtual TInt WriteCommand(const CHCICommandFrame& aFrame)=0;
100 // HCI General exports
103 @param aName option to set
104 @param aData option value
105 @return System wide error code
109 virtual TInt SetOption(TUint aName,const TDesC8& aData)=0;
113 @param aName option to set
114 @param aData desriptor to be filled with option data
115 @return System wide error code
119 virtual TInt GetOption(TUint aName,TDes8& aData)=0;
122 /** Formats ACL Data.
124 @param aFrame Reference to CHCIACLDataFrame which will be formatted with the data supplied in the other params
125 @param aConnH Connection handle for this frame
126 @param aFlags Flags to be set for this frame
127 @param aData Data for this frame
131 virtual void FormatACLData(CHCIACLDataFrame& aFrame, THCIConnHandle aConnH,TUint8 aFlags,const TDesC8& aData)=0;
133 /** Formats SCO Data.
135 @param aFrame Reference to CHCISCODataFrame which will be formatted with the data supplied in the other params
136 @param aConnH Connection handle for this frame
137 @param aData Data for this frame
141 virtual void FormatSCOData(CHCISCODataFrame& aFrame, THCIConnHandle aConnH, const TDesC8& aData)=0;
145 This forwards a write from link layer to host controller. The descriptor in the frame is owned by the link layer.
147 @param aFrame the formatted ACL payload from the linkmanager
148 @return System wide error code
152 virtual TInt WriteACLData(const CHCIACLDataFrame& aFrame)=0;
156 This forwards a write from link layer to host controller. The descriptor in the frame is owned by the link layer.
158 @param aFrame the formatted SCO payload from the linkmanager
159 @return System wide error code
163 virtual TInt WriteSCOData(const CHCISCODataFrame& aFrame)=0;
165 // HCI Frame information commands
166 /** Gets frame connection handle
168 @param aFrame the frame to return the connection handle of
169 @return the connection handle from aFrame
173 virtual THCIConnHandle FrameConnectionHandle(const CHCIACLDataFrame& aFrame) const =0;
175 /** Gets frame opcode.
177 @param aFrame the frame to return the opcode of
178 @return the opcode of aFrame
182 virtual THCIOpcode FrameOpcode(const CHCICommandFrame& aFrame) const =0;
185 /** Commands the host controller to start looking for remote devices within range.
187 The HCI client should not issue a second Inquiry() before the first has
188 completed, because the HC cannot cope with this and will return a
189 COMMAND_DISALLOWED error
191 @param aFrame The HCI frame to format
192 @param aCode InquiryAccessCode (3 bytes)
193 @param aLength InquiryLength N where N * 1.28s is the no. of seconds for inquiry
194 @param aNumResponses Number of responses from inquiry before it is halted - default 0 is unlimited number of responses.
198 virtual void Inquiry(CHCICommandFrame& aFrame, const TUint aCode=KGIAC, const TUint8 aLength=10, const TUint8 aNumResponses=0)=0;
200 /** Cancels an ongoing inquiry.
202 @param aFrame frame to apply any necessary formatting to for inquiry cancel.
206 virtual void InquiryCancel(CHCICommandFrame& aFrame)=0;
208 /** Commands the host controller to enter periodic enquiry mode
210 @param aFrame The HCI frame to format
211 @param aMax MaxPeriodLength. The HC chooses a value between aMax and aMin.
212 @param aMin MinPeriodLength
213 @param aCode InquiryAccessCode (3 bytes)
214 @param aLength InquiryLength (default N=2)
215 @param aNumResponses Number of Responses (default=0)
219 virtual void PeriodicInquiryMode(CHCICommandFrame& aFrame, TUint16 aMax,TUint16 aMin, const TUint aCode=0,const TUint8 aLength=2,const TUint8 aNumResponses=0)=0;
221 /** Exits the periodic inquiry.
223 @param aFrame The HCI frame to format
227 virtual void ExitPeriodicInquiryMode(CHCICommandFrame& aFrame)=0;
229 /** Initiates connection to remote device using the specified baseband packet type.
231 @param aFrame The HCI frame to format
232 @param aBdaddr remove device address
233 @param aPacketType Packet Type
234 @param aPageScanRepetitionMode pages scan repetition mode
235 @param aPageScanMode page scan mode
236 @param aClockOffset Offset between local and remote clock
237 @param aAllowRoleSwitch Whether the remote device is allowed to role switch the local device
241 virtual void CreateConnection(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,
242 TUint16 aPacketType=KDM1Packet, TUint8 aPageScanRepetitionMode=0,
243 TUint8 aPageScanMode=0, TUint16 aClockOffset=0, TUint8 aAllowRoleSwitch=1)=0;
245 /** Add an SCO connection between the Host Controller and the remote device.
247 @param aFrame The HCI frame to format
248 @param aConnHandle Connection handle
249 @param aPacketType Packet Type
253 virtual void AddSCOConnection(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle,TUint16 aPacketType)=0;
262 Adds a new or modifies an existing synchronous logical transport (SCO or eSCO)
263 @param aFrame The HCI frame to format
264 @param aConnHandle Connection handle (2 bytes)
265 @param aTransmitBandwidth (4 bytes)
266 @param aReceiveBandwidth (4 bytes)
267 @param aMaxLatency (2 bytes)
268 @param aVoiceSettings (2 bytes)
269 @param aRetransmissionEffort (1 bytes)
270 @param aPacketType (2 bytes)
272 virtual void SetupSynchronousConnectionCommand(CHCICommandFrame& aFrame, TUint16 aConnHandle,
273 TUint aTransmitBandwidth, TUint aReceiveBandwidth, TUint16 aMaxLatency,
274 TUint16 aVoiceSettings, TUint8 aRetransmissionEffort,
275 TUint16 aPacketType)=0;
278 Accepts an incoming connection request for an synchronous connection.
279 @param aFrame The HCI frame to format
280 @param aBdaddr BDADDR (6 bytes)
281 @param aTransmitBandwidth (4 bytes)
282 @param aReceiveBandwidth (4 bytes)
283 @param aMaxLatency (2 bytes)
284 @param aContentFormat (2 bytes)
285 @param aRetransmissionEffort (1 bytes)
286 @param aPacketType (2 bytes)
288 virtual void AcceptSynchronousConnectionRequestCommand(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,
289 TUint aTransmitBandwidth, TUint aReceiveBandwidth, TUint16 aMaxLatency,
290 TUint16 aContentFormat, TUint8 aRetransmissionEffort, TUint16 aPacketType)=0;
292 Rejects the synchronous connction from thre remote device (aBdaddr).
294 @param aFrame The HCI frame to format
295 @param aBdaddr BDADDR
296 @param THCIErrorCode Reject reason
298 virtual void RejectSynchronousConnectionRequestCommand(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,THCIErrorCode aReason)=0;
306 /** Accepts an incoming connection request.
308 @param aFrame The HCI frame to format
309 @param aBdaddr bluetooth address of remote device
310 @param aRole Role - 0x00=Master, 0x01=Slave.
314 virtual void AcceptConnectionRequest(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,TUint8 aRole)=0;
316 /** Rejects the connection from the remote device.
318 @param aFrame The HCI frame to format
319 @param aBdaddr Bluetooth address of remote device
320 @param THCIErrorCode Reject reason
324 virtual void RejectConnectionRequest(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,THCIErrorCode aReason)=0;
326 /** Replies to the remote host with the supplied link key.
328 @param aFrame The HCI frame to format
329 @param aBdaddr bluetooth address of remote device
330 @param aLinkKey Link key (16 bytes)
334 virtual void LinkKeyRequestReply(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,const TDesC8& aLinkKey)=0;
336 /** Notifies the remote host that the link key was not accepted.
338 @param aFrame The HCI frame to format
339 @param aBdaddr Bluetooth address of remote device
343 virtual void LinkKeyRequestNegativeReply(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr)=0;
345 /** Returns to the remote host the requested PIN.
347 @param aFrame The HCI frame to format
348 @param aBdaddr Bluetooth address of remote device
349 @param aPIN PIN Code (up to 16 bytes)
353 virtual void PINCodeRequestReply(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,const TDesC8& aPIN)=0;
355 /** Notifies the remote host that the PIN code was rejected.
357 @param aFrame The HCI frame to format
358 @param aBdaddr Bluetooth address of remote device
362 virtual void PINCodeRequestNegativeReply(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr)=0;
364 /** Disconnect the ACL or SCO connection corresponding to the supplied handle.
366 @param aFrame The HCI frame to format
367 @param aConnHandle Handle of connection to disconnect
368 @param aReason Reason for disconnection
372 virtual void Disconnect(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle,THCIErrorCode aReason)=0;
374 /** Changes baseband packet type (e.g DH1, DM3 etc.).
376 @param aFrame The HCI frame to format
377 @param aConnHandle Connection Handle
378 @param aType Packet Type. This should be one of the consts defined in hcibase.h e.g. KDM1Packet.
382 virtual void ChangeConnectionPacketType(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle,TUint16 aType)=0;
384 /** Perform authenticaction request.
386 @param aFrame The HCI frame to format
387 @param aConnHandle Connection Handle
391 virtual void AuthenticationRequest(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
393 /** Sets connection encryption
395 @param aFrame The HCI frame to format
396 @param aConnHandle Connection Handle
397 @param aEnable Enable flag ETrue=Enable link encryption, EFalse=Disable link encryption
401 virtual void SetEncryptionEnable(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle,TBool aEnable)=0;
403 /** Notifies host of need to change connection key for the supplied connection handle.
405 @param aFrame The HCI frame to format
406 @param aConnHandle Connection Handle
410 virtual void ChangeConnectionLinkKey(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
414 @param aFrame The HCI frame to format
415 @param aKeyFlag Link Key Flag. Possible values are ETrue to use temporary link key or EFalse to use regular link key
419 virtual void MasterLinkKey(CHCICommandFrame& aFrame, TBool aKeyFlag)=0;
421 /** Retrieves the remote hosts advertised hardware/firmware features.
423 @param aFrame The HCI frame to format
424 @param aConnHandle Connection Handle
428 virtual void ReadRemoteSupportedFeatures(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
430 /** Retrieve remote hosts HW/Firmware revision information.
432 @param aFrame The HCI frame to format
433 @param aConnHandle Connection Handle
437 virtual void ReadRemoteVersionInfo(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
439 /** Request on human redable name of remote host.
441 @param aFrame The HCI frame to format
442 @param aBdaddr The bluetooth address of device on which we seek to find a name
443 @param aPageScanRepetitionMode Page scan repetition mode
444 @param aPageScanMode Page scan mode
445 @param aClockOffset Offset of remote device clock from local device clock
449 virtual void RemoteNameRequest(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr, TUint8 aPageScanRepetitionMode=0,
450 TUint8 aPageScanMode=0, TBasebandTime aClockOffset=0)=0;
452 /** Retrieve offset of remote clock from local clock.
454 @param aFrame The HCI frame to format
455 @param aConnHandle Connection Handle
459 virtual void ReadClockOffset(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
461 // HCI Link Policy Commands
462 /** Write local link policy settings
464 @param aFrame The HCI frame to format
465 @param aConnHandle Connection Handle
466 @param aSettings @see Bluetooth HCI specification
470 virtual void WriteLinkPolicySettings(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle, TUint16 aSettings)=0;
472 /** Switch radio and host controller to Hold mode.
474 @param aFrame The HCI frame to format
475 @param aConnHandle Connection Handle
476 @param aHoldMaxInterval Max Hold Interval N, where Time of Hold=N*0.625ms (1 baseband slot)
477 @param aHoldMinInterval Min Hold interval N, as above (both up to 40.9 sec)
481 virtual void HoldMode(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle, TBasebandTime aHoldMaxInterval,
482 TBasebandTime aHoldMinInterval)=0;
484 /** Switch radio and host controller to Sniff mode.
486 @param aFrame The HCI frame to format
487 @param aConnHandle Connection Handle
488 @param aSniffMaxInterval Max Sniff length (Max number of acceptable slots in a sniff period) N, where the interval (time between sniffs)=N*0.625ms (1 baseband slot)
489 @param aSniffMinInterval Min Sniff interval , as above
490 @param aAttemptSlots Sniff Attempt - the period the slave will listen after each sniff interval
491 @param aTimeOutSlots Sniff Timeout - time listening for packets as long as some arrive
495 virtual void SniffMode(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle,TBasebandTime aSniffMaxInterval,TBasebandTime
496 aSniffMinInterval, TBasebandTime aAttempSlots, TBasebandTime aTimeOutSlots)=0;
498 /** Switch radio and host out of the Sniff mode.
500 @param aFrame The HCI frame to format
501 @param aConnHandle Connection Handle
505 virtual void ExitSniffMode(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
507 /** Switch radio and host controller to the Park mode.
509 @param aFrame The HCI frame to format
510 @param aConnHandle Connection Handle
511 @param aBeaconMax Beacon Max Interval Length N where interval between beacons=N*0.625ms
512 @param aBeaconMin Beacon Min Interval Length N where interval between beacons=N*0.625ms
516 virtual void ParkMode(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle, TBasebandTime aBeaconMaxInterval,
517 TBasebandTime aBeaconMinInterval)=0;
519 /** Switch radio and host controller off the Park mode.
521 @param aFrame The HCI frame to format
522 @param aConnHandle Connection Handle
526 virtual void ExitParkMode(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
528 /** Initiate role discovery for the supplied connection handle.
530 @param aFrame The HCI frame to format
531 @param aConnHandle Connection Handle
535 virtual void RoleDiscovery(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
537 /** Switch current role (master / slave) for the physical link associated with the bluetooth device address provided.
539 @param aFrame The HCI frame to format
540 @param aRole New role
541 @param aAddr Bluetooth device address of remote device
545 virtual void SwitchRole(CHCICommandFrame& aFrame, TBTBasebandRole aRole, const TBTDevAddr& aAddr)=0;
548 // HCI Host Controller and Baseband Commands
549 /** Sets the mask for the reception or the filtering-out of HCI events from the host controller.
551 @param aFrame The HCI frame to format
552 @param aMask Event Mask
556 virtual void SetEventMask(CHCICommandFrame& aFrame, const THCIEventMask& aMask)=0;
558 /** Resets the Host Controller hardware state.
560 @param aFrame The HCI frame to format
564 virtual void Reset(CHCICommandFrame& aFrame)=0;
566 /** Set the filter mask for remotely initiated events.
568 @param aFrame The HCI frame to format
569 @param aData Denotes the filter 'category' and its particular properties as such its 'category'/type may be EClearAllFilters, EInquiryResultFilter or EConnectionSetupFilter. Then its condition type (aData.iConditionType) can be as defined in the spec
573 virtual void SetEventFilter(CHCICommandFrame& aFrame, const THCIEventCondition& aData)=0;
575 /** Flush buffers corresponding to the supplied connection handle.
577 @param aFrame The HCI frame to format
578 @param aConnHandle Connection Handle
582 virtual void Flush(CHCICommandFrame& aFrame, THCIConnHandle aConnHandle)=0;
584 /** Creates a new unit key in the host controller.
586 @param aFrame The HCI frame to format
590 virtual void CreateNewUnitKey(CHCICommandFrame& aFrame)=0;
592 /** Reads out from the host controller the stored link key for given device address
594 @param aFrame The HCI frame to format
595 @param aBdaddr Bluetooth device address to read the link key for.
596 @param aFlag Read all keys flag
600 virtual void ReadStoredLinkKey(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,THCIReadAllKeysFlag aFlag)=0;
602 /** Writes a Link Key to the Host Controllers volatile storage memory. You can write as many keys as you want to storage - this function just does one at a time.
604 @param aFrame The HCI frame to format
605 @param aNumOfKeysToWrite Number of keys to write to storage
606 @param aBdaddr Bluetooth device address for the associated link key
607 @param aLinkKey The Link Key
611 virtual void WriteStoredLinkKey(CHCICommandFrame& aFrame, /*TUint8 aNumOfKeysToWrite,*/
612 const TBTDevAddr& aBdaddr,const TDesC8& aLinkKey)=0;
614 /** Delete the link key stored in the host controller's volatile storage.
616 @param aFrame The HCI frame to format
617 @param aBdaddr Bluetooth device address associated with the link key to delete.
618 @param aFlag Delete options flag
622 virtual void DeleteStoredLinkKey(CHCICommandFrame& aFrame, const TBTDevAddr& aBdaddr,THCIDeleteAllKeysFlag aFlag)=0;
624 /** Sets the local Bluetooth device name.
626 @param aFrame The HCI frame to format
627 @param aName Local device name (max 248 characters as defined in bluetooth specification).
631 virtual void ChangeLocalName(CHCICommandFrame& aFrame, const TDesC8& aName)=0;
633 /** Reads out the stored local Bluetooth device name.
635 @param aFrame The HCI frame to format
639 virtual void ReadLocalName(CHCICommandFrame& aFrame)=0;
641 /** Reads out of the Bluetooth device the connection accept timeout, for incoming connections.
643 @param aFrame The HCI frame to format
647 virtual void ReadConnectionAcceptTimeout(CHCICommandFrame& aFrame)=0;
649 /** Sets the connection accept timeout in the host controller.
651 @param aFrame The HCI frame to format
652 @param aTimeout The connection timeout
656 virtual void WriteConnectionAcceptTimeout(CHCICommandFrame& aFrame, TBasebandTime aTimeout)=0;
658 /** Commands the Bluetooth hardware to respond with its Page Timeout.
660 @param aFrame The HCI frame to format
664 virtual void ReadPageTimeout(CHCICommandFrame& aFrame)=0;
666 /** Sets the page timeout in the host controller.
668 @param aFrame The HCI frame to format
669 @param aTimeout Page Timeout. This must be between KMaxPageTimeout and KMinPageTimeout.
673 virtual void WritePageTimeout(CHCICommandFrame& aFrame, TBasebandTime aTimeout)=0;
675 /** Read out of the host controller the scan options.
677 @param aFrame The HCI frame to format
681 virtual void ReadScanEnable(CHCICommandFrame& aFrame)=0;
683 /** Sets the scan options on the host controller.
685 @param aFrame The HCI frame to format
686 @param aScanEnable Scan enable options
690 virtual void WriteScanEnable(CHCICommandFrame& aFrame, THCIScanEnable aEnable=EInquiryAndPageScan)=0;
692 /** Read out of the host controller the number of supported inquiry access codes.
694 @param aFrame The HCI frame to format
698 virtual void ReadNumberOfSupportedIAC(CHCICommandFrame& aFrame)=0;
700 /** Write to the host controller the lower address parts supplied.
702 @param aFrame The HCI frame to format
703 @param aNumCurrentIAC The number of inquiry access code lower address parts being sent to the hardware
704 @param aIAC_LAP The inquiry access code lower address parts - 3 bytes each: e.g: GIACLAP=0x9e8b33, LIACLAP=0x9e8b00
708 virtual void WriteCurrentIACLAP(CHCICommandFrame& aFrame, TUint8 aNumCurrentIAC, TUint aIAC_LAP[])=0;
710 /** Read out the inquiry access code lower address parts.
712 @param aFrame The HCI frame to format
716 virtual void ReadCurrentIACLAP(CHCICommandFrame& aFrame)=0;
718 /** Read out from the host controller whether authentication is enabled.
720 @param aFrame The HCI frame to format
724 virtual void ReadAuthenticationEnable(CHCICommandFrame& aFrame)=0;
726 /** Set/Unset authentication.
728 @param aFrame The HCI frame to format
729 @param aAuthEnable Authentication Enable. Possible values are EFalse for authentication disabled or ETrue for authentication enabled
733 virtual void WriteAuthenticationEnable(CHCICommandFrame& aFrame, TBool aAuthEnable)=0;
735 /** Read out the encryption mode.
737 @param aFrame The HCI frame to format
741 virtual void ReadEncryptionMode(CHCICommandFrame& aFrame)=0;
743 /** Set/unset the encryption.
745 @param aFrame The HCI frame to format
746 @param aFlag Whether to enable encryption. Possible values are EFalse to disable encryption or ETrue to enable encryption.
750 virtual void WriteEncryptionMode(CHCICommandFrame& aFrame, THCIEncryptModeFlag aFlag)=0;
752 /** Reads out the class of device of the local Bluetooth device.
754 @param aFrame The HCI frame to format
758 virtual void ReadClassOfDevice(CHCICommandFrame& aFrame)=0;
760 /** Sets the local Bluetooth class of device.
762 @param aFrame The HCI frame to format
763 @param aCoD Class Of Device
767 virtual void WriteClassOfDevice(CHCICommandFrame& aFrame, TUint aCoD)=0;
769 /** Read the Bluetooth hardware voice settings.
771 @param aFrame The HCI frame to format
775 virtual void ReadVoiceSetting(CHCICommandFrame& aFrame)=0;
777 /** Set the local Bluetooth device voice settings.
779 @param aFrame The HCI frame to format
780 @param aVoiceChannelSetting Voice channel settings as defined by the HCI specification.
784 virtual void WriteVoiceSetting(CHCICommandFrame& aFrame, TInt16 aVoiceChannelSetting)=0;
786 // HCI Informational Parameters Commands
787 /** Retrieve local hardware/firmware revision info.
789 @param aFrame The HCI frame to format
793 virtual void ReadLocalVersionInformation(CHCICommandFrame& aFrame)=0;
795 /** Retrieve local hardware/firmware capabilities.
797 @param aFrame The HCI frame to format
801 virtual void ReadLocalSupportedFeatures(CHCICommandFrame& aFrame)=0;
803 /** Retrieve from the host controller its buffering capabilities.
805 @param aFrame The HCI frame to format
809 virtual void ReadBufferSize(CHCICommandFrame& aFrame)=0;
811 /** Retrieve the hardware's intended country code (for security/encryption issues).
813 @param aFrame The HCI frame to format
817 virtual void ReadCountryCode(CHCICommandFrame& aFrame)=0;
819 /** Retrieve local Bluetooth device address.
821 @param aFrame The HCI frame to format
825 virtual void ReadBDADDR(CHCICommandFrame& aFrame)=0;
827 // Host Controller to Host Data Flow Control
828 /** Set/unset notification of delivery of packets, from the host controller to the host.
830 @param aFrame The HCI frame to format
831 @param aFlowFlag Flow Control Enable flag
835 virtual void SetHostControllerToHostFlowControl(CHCICommandFrame& aFrame, TBool aHC2HFlowFlag)=0;// may return KErrNoMemory
837 /** Notification to host controller of the number of packets that the above
838 layers (L2CAP) have consumed. HostNumberOfCompletedPackets command to be
841 @param aFrame The HCI frame to format
842 @param aNumHandles Number of connectionhandles
843 @param aConnH Connection handle
844 @param aCompletedPacketsNo Host num of completed packets
848 virtual void HostNumberOfCompletedPackets(CHCICommandFrame& aFrame, TUint8 aNumHandles, THCIConnHandle aConnH[], TUint16 aCompletedPacketsNo[])=0;
850 /** Notifies the host controller of the hosts buffering capabilities.
852 @param aFrame The HCI frame to format
853 @param aACLDataLength Host's ACL Data Packet Length
854 @param aSCODataLength Host's SCO Data Packet Length
855 @param aTotalACLPackets Total Number of ACL Data Packets that the Host can handle
856 @param aTotalSCOPackets Total Number of SCO Data Packets that the Host can handle
860 virtual void HostBufferSize(CHCICommandFrame& aFrame, TUint16 aACLDataLength,TUint8 aSCODataLength,
861 TUint16 aTotalACLPackets, TUint16 aTotalSCOPackets)=0;
863 /** Writes link supervision timeout.
865 @param aFrame The HCI frame to format
866 @param aConnH Connection handle
867 @param aTimeout Timeout to write
871 virtual void WriteLinkSupervisionTimeout(CHCICommandFrame& aFrame, THCIConnHandle aConnH, TBasebandTime aTimeout)=0;
873 /** This call allows for a raw HCI command frame to be written to the HC.
875 This is intended for vendor specific commands for which the opcode
876 field will be known to the HCI.
878 These raw frames should be constructed by calling the HCI factory
879 function with the opcode constructed of the vendor debug opcode group field
880 and the particular OCF required. This function should then be called with the
881 appropriately formatted parameters which shall be placed into the frame's
882 payload. It should be noted that the client need NOT to be concerned
883 with the HCTL framing at all.
885 The HCI will only then copy this frame to the host controller after putting
888 Note that the client is responsible for policing the size of the descriptor
889 passed to this function. The length should be: 0 <= n <= KHCIMaxCommandLength
891 @param aFrame The HCI frame to format
892 @param aData The frame parameters
896 virtual void WriteVendorRawFrameCommand(CHCICommandFrame& aFrame, const TDesC8& aData)=0;
899 // HCI Status Parameters Commands
902 // HCI Testing Commands
904 /** Used for testing.
909 virtual TAny *LogIndex() const=0;
911 // methods to allow stack to query HCI about its features
912 /** Reads ACL reporting interval.
914 @return the ACL reporting interval.
918 virtual TUint16 ReadACLReportingInterval() = 0; // Some hardware only reports on the nth ACL data packet being sent
919 // this is an opportunity for the HCI to supply a minimum value of n
920 // to the Link Manager
922 /** Reads size of HCI framing overhead per frame.
924 @return size of HCI framing overhead per frame.
928 virtual TUint16 ReadACLFramingOverhead() = 0; // Size of HCI framing overhead per frame
930 // Adaptive Frequency Hopping (AFH)
932 /** Notifies the host controller of channels that are known by the host to be bad or to be about to be bad.
934 This allows those channels to be avoided if Adaptive Frequency Hopping is active on a connection.
936 @param aFrame The HCI frame to format
937 @param aChannelClassification Bitwise representation of the bad channels
941 virtual void SetAFHHostChannelClassification(CHCICommandFrame& aFrame, const TDesC8& aChannelClassification)=0;
943 /** Retrieves the AFH channel map being used on the specified connection.
945 If we are master this will be the local AFH channel map. If we are slave it
946 will be the remote master's AFH channel map.
948 @param aFrame The HCI frame to format
949 @param aConnH Connection handle
953 virtual void ReadAFHChannelMap(CHCICommandFrame& aFrame, THCIConnHandle aConnH)=0;
955 /** Notifies the host controller whether or not it is required to keep checking for busy channels..
957 @param aFrame The HCI frame to format
958 @param aEnable Check for busy channels if ETrue, otherwise don't
962 virtual void WriteAFHChannelAssessmentMode(CHCICommandFrame& aFrame, TBool aEnable)=0;
964 /** Asks the host controller whether or not it is checking for busy channels..
966 @param aFrame The HCI frame to format
970 virtual void ReadAFHChannelAssessmentMode(CHCICommandFrame& aFrame)=0;
974 @param aLevel The Ioctl level
975 @param aName The Ioctl function number
976 @param aOption Data associated with this Ioctl
977 @param aStackSAP A pointer to the SAP, used to track Ioctls
981 virtual void Ioctl(TUint aLevel,TUint aName, TDes8* aOption, TAny* aStackSAP) = 0;
983 /** Cancel HCI level Ioctl
985 @param aLevel The Ioctl level
986 @param aName The Ioctl function number
987 @param aStackSAP A pointer to the SAP, used to track Ioctls
991 virtual void CancelIoctl(TUint aLevel,TUint aName, TAny* aStackSAP) = 0;
998 /** Event handler mixin that must be implemented by the client of HCI.
1000 A class that implements this interface must be passed into the
1001 CHCIBase derived class on construction, and will be used by the HCI
1002 class to notify the client of events received over the HCI interface.
1007 class MHCIEventObserver
1010 // Interfaces to allow HCI to notify LL
1011 /** This provides command credits.
1013 @param aCredits Provided command credits.
1017 virtual void SetCommandCredits(TUint16 aCredits)=0;
1019 /** Informs of the ACL MTU for this host.
1021 @param aMTU Maximum size of ACL packet the host can send.
1025 virtual void HCIMaximumACLPacketSize(TUint16 aMTU)=0;
1027 /** Called when transport channels have become free.
1029 @param aChannel Channel that is free.
1033 virtual void CanSend(THCITransportChannel aChannel = KHCITransportAllChannels)=0;
1035 // Events as per spec
1036 /** Called on an inquiry complete event.
1038 @param aNumResponses Number of responses received from the inquiry. This is zero if not supported or there is an error.
1039 @param aErr HCI specific or system wide error code.
1043 virtual void InquiryCompleteEvent(THCIErrorCode aErr, TUint8 aNumResponses)=0;
1045 /** Called on an inquiry result complete event.
1047 @param aEntry TInquiryLogEntry containing results of inquiry.
1048 @param aErr HCI specific or system wide error code.
1052 virtual void InquiryResultCompleteEvent(THCIErrorCode aErr,const TInquiryLogEntry& aEntry)=0;
1054 /** Called on a connection complete event.
1056 @param aConn Contains information about the completed connection.
1057 @param aErr HCI specific or system wide error code.
1061 virtual void ConnectionCompleteEvent(THCIErrorCode aErr, const TBTConnect &aConn)=0;
1063 /** Called on a connection request event.
1065 @param aConn Information about the device requesting the connection.
1069 virtual void ConnectionRequestEvent(const TBTConnect &aConn)=0;
1071 /** Called on a disconnection complete event.
1073 @param aConnH Connection handle
1074 @param aReason Reason for disconnection.
1075 @param aErr HCI specific or system wide error code.
1079 virtual void DisconnectionCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH, THCIErrorCode aReason)=0;
1081 /** Called on an authentication complete event.
1083 @param aConnH Connection handle
1084 @param aErr HCI specific or system wide error code.
1088 virtual void AuthenticationCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH)=0;
1090 /** Called on a remote name request complete event.
1092 @param aBdaddr Bluetooth address of remote device
1093 @param aBuf Name of remote device (max 248 bytes as defined by the bluetooth specification).
1094 @param aErr HCI specific or system wide error code.
1098 virtual void RemoteNameReqCompleteEvent(THCIErrorCode aErr, const TBTDevAddr& aBdaddr, const TDesC8& aBuf)=0;
1100 /** Called on encryption change event.
1102 @param aConnH Connection handle
1103 @param aEnable Whether encryption is enabled
1104 @param aErr HCI specific or system wide error code.
1108 virtual void EncryptionChangeEvent(THCIErrorCode aErr, THCIConnHandle aConnH,TBool aEnable)=0;
1110 /** Called on link key complete event.
1112 @param Connection handle
1113 @param aErr HCI specific or system wide error code.
1117 virtual void ChangeLinkKeyCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH)=0;
1119 /** Called on master link key complete event.
1121 @param aConnH Connection handle
1122 @param aKeyFlag See bluetooth specification
1123 @param aErr HCI specific or system wide error code.
1127 virtual void MasterLinkKeyCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH,TBool aKeyFlag)=0;
1129 /** Called on read remote supported features complete event.
1131 @param aConnH Connection handle
1132 @param aBitMaskList LMP_Features Bit Mask List (8 bytes)
1133 @param aErr HCI specific or system wide error code.
1137 virtual void ReadRemoteSupportedFeaturesCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH, TUint64 aBitMaskList)=0;
1138 /** Called on read remote version info complete event.
1140 @param aConnH Connection handle
1141 @param aVer Information on remote hardware version
1142 @param aErr HCI specific or system wide error code.
1146 virtual void ReadRemoteVersionInfoCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH, const TBTDevRemoteHwVersion& aVer)=0;
1148 /** Called on QOS setup complete event.
1150 @param aQOS QOS information.
1151 @param aErr HCI specific or system wide error code.
1152 @param aConnH Connection handle
1156 virtual void QOSSetupCompleteEvent(THCIErrorCode aErr, THCIConnHandle aConnH, TBTQOS aQOS)=0;
1158 /** Called on Command Complete Event.
1160 @param aErr HCI specific or system wide error code.
1164 virtual void CommandCompleteEvent(THCIErrorCode aErr,THCIOpcode aOpcode)=0;
1166 /** Called on command status event.
1168 @param aOpcode Opcode of the successfully completed event.
1172 virtual void CommandStatusEvent(THCIOpcode aOpcode)=0;
1174 /** Called on Hardware Error Event.
1176 @param aHwCode Hardware code.
1180 virtual void HardwareErrorEvent(TUint8 aHwCode)=0;
1182 /** Called on Flush Occurred Event.
1184 @param aErr HCI specific or system wide error code.
1185 @param aConnH Connection handle
1189 virtual void FlushOccurredEvent(THCIErrorCode aErr, THCIConnHandle aConnH)=0;
1191 /** Called on Role Change Event.
1193 @param aRole New role.
1194 @param aBdaddr Bluetooth device address of remote device.
1195 @param aErr HCI specific or system wide error code.
1199 virtual void RoleChangeEvent(THCIErrorCode aErr, const TBTDevAddr& aBdaddr,TBTBasebandRole aRole)=0;
1201 /** Called on HCI Completed Packets event.
1203 @param aConnH Connection handle
1204 @param aNumPacketsCompleted Number of packets completed.
1208 virtual void HCICompletedPackets(THCIConnHandle aConnH, TUint16 aNumPacketsCompleted)=0; //NumberCompletedPacketsEvent
1210 /** Called on Mode Change Event.
1212 @param aMode Current mode.
1213 @param aInterval Interval defined according to current mode (see bluetooth specification).
1214 @param aErr HCI specific or system wide error code.
1215 @param aConnH Connection handle
1219 virtual void ModeChangeEvent(THCIErrorCode aErr, THCIConnHandle aConnH, TBTLinkMode aMode, TUint16 aInterval)=0;
1221 /** Called on Return Link Keys Event.
1223 @param aBdaddr Bluetooth device address of remote device.
1224 @param aLinkKey Link key.
1225 @param aErr HCI specific or system wide error code.
1229 virtual void ReturnLinkKeysEvent(THCIErrorCode aErr, const TBTDevAddr& aBdaddr,const TBTLinkKey& aLinkKey)=0;
1231 /** Called on PIN Code Request Event.
1233 @param aBdaddr Bluetooth device address
1237 virtual void PINCodeRequestEvent(const TBTDevAddr& aBdaddr)=0;
1239 /** Called on Link Key Request Event.
1241 @param aBdaddr Bluetooth device address
1245 virtual void LinkKeyRequestEvent(const TBTDevAddr& aBdaddr)=0;
1247 /** Called on Link Key Notification Event.
1249 @param aBdaddr Bluetooth device address.
1250 @param aLinkKey Link key.
1254 virtual void LinkKeyNotificationEvent(const TBTDevAddr& aBdaddr,const TBTLinkKey& aLinkKey)=0;
1256 /** Called on Loopback Command Event. Not currently supported.
1261 virtual void LoopbackCommandEvent()=0; //not supported yet
1263 /** Called on Data Buffer Overflow Event.
1269 virtual void DataBufferOverflowEvent(TUint8 aLinkType)=0;
1271 /** Called on Max Slots Change Event.
1273 @param aMaxSlots New value of max slots.
1274 @param aConnH Connection handle
1278 virtual void MaxSlotsChangeEvent(THCIConnHandle aConnH, TUint8 aMaxSlots)=0;
1280 /** Called on Read Clock Offset Result Event.
1282 @param aClockOffset Clock offset.
1283 @param aErr HCI specific or system wide error code.
1284 @param aConnH Connection handle
1288 virtual void ReadClockOffsetResultEvent(THCIErrorCode aErr, THCIConnHandle aConnH, TBasebandTime aClockOffset)=0;
1290 /** Called on Connection Packet Type Changed Event.
1292 @param aPacketType New packet type.
1293 @param aErr HCI specific or system wide error code.
1294 @param aConnH Connection handle
1298 virtual void ConnectionPacketTypeChangedEvent(THCIErrorCode aErr,
1299 THCIConnHandle aConnH, TUint16 aPacketType)=0;
1301 /** Called on QOS Violation Event.
1303 @param aConnH Connection handle
1307 virtual void QOSViolationEvent(THCIConnHandle aConnH)=0;
1309 /** Called on Page Scan Mode Change Event.
1311 @param aBdaddr Bluetooth device address.
1312 @param aPageScanMode New page scan mode
1316 virtual void PageScanModeChangeEvent(const TBTDevAddr& aBdaddr, TUint8 aPageScanMode)=0;
1318 /** Called on Page Scan Repetition Mode Change Event.
1320 @param aBdaddr Bluetooth device address
1321 @param aPageScanRepetitionMode New page scan repetition mode
1325 virtual void PageScanRepetitionModeChangeEvent(const TBTDevAddr& aBdaddr, TUint8 aPageScanRepetitionMode)=0;
1329 /** Called on ACLDataReceivedEvent.
1331 @param aConnH Connection handle
1332 @param aData Received data
1333 @param aFlag See bluetooth specification
1337 virtual void ACLDataReceivedEvent(THCIConnHandle aConnH,TUint8 aFlag,const TDesC8& aData)=0;
1339 /** Called on SCO Data Received Event.
1341 @param aData Recieved data.
1342 @param aConnH Connection handle
1346 virtual void SCODataReceivedEvent(THCIConnHandle aConnH, const TDesC8& aData)=0;
1351 /** Called on Reset Complete Event.
1353 @param aStatus HCI specific or system wide error code.
1357 virtual void ResetCompleteEvent(THCIErrorCode aStatus)=0;
1359 /** Called on Write Link Supervision Timeout Complete Event.
1361 @param aStatus HCI specific or system wide error code.
1365 virtual void WriteLinkSupervisionTimeoutCompleteEvent(THCIErrorCode aStatus)=0;
1367 /** Called on Link Key Request Reply Complete Event.
1369 @param aStatus HCI specific or system wide error code.
1373 virtual void LinkKeyRequestReplyCompleteEvent(THCIErrorCode aStatus)=0;
1375 /** Called on Link Key Request Reply Negative Complete Event.
1377 @param aStatus HCI specific or system wide error code.
1381 virtual void LinkKeyRequestReplyNegativeCompleteEvent(THCIErrorCode aStatus)=0;
1383 /** Called on PIN Code Request Reply Complete Event.
1385 @param aStatus HCI specific or system wide error code.
1389 virtual void PINCodeRequestReplyCompleteEvent(THCIErrorCode aStatus)=0;
1391 /** Called on PIN Code Request Reply Negative Complete Event.
1393 @param aStatus HCI specific or system wide error code.
1397 virtual void PINCodeRequestReplyNegativeCompleteEvent(THCIErrorCode aStatus)=0;
1399 /** Called on Inquiry Cancel Complete Event.
1401 @param aStatus HCI specific or system wide error code.
1405 virtual void InquiryCancelCompleteEvent(THCIErrorCode aStatus)=0;
1407 /** Called on Periodic Inquiry Mode Complete Event.
1409 @param aStatus HCI specific or system wide error code.
1413 virtual void PeriodicInquiryModeCompleteEvent(THCIErrorCode aStatus)=0;
1415 /** Called on Exit Periodic Inquiry Mode Complete Event.
1417 @param aStatus HCI specific or system wide error code.
1421 virtual void ExitPeriodicInquiryModeCompleteEvent(THCIErrorCode aStatus)=0;
1423 /** Called on Set Event Mask Complete Event.
1425 @param aStatus HCI specific or system wide error code.
1429 virtual void SetEventMaskCompleteEvent(THCIErrorCode aStatus)=0;
1431 /** Called on Set Event Filter Complete Event.
1433 @param aStatus HCI specific or system wide error code.
1437 virtual void SetEventFilterCompleteEvent(THCIErrorCode aStatus)=0;
1439 /** Called on Create New Unit Key Complete Event.
1441 @param aStatus HCI specific or system wide error code.
1445 virtual void CreateNewUnitKeyCompleteEvent(THCIErrorCode aStatus)=0;
1447 /** Called on Change Local Name Complete Event.
1449 @param aStatus HCI specific or system wide error code.
1453 virtual void ChangeLocalNameCompleteEvent(THCIErrorCode aStatus)=0;
1455 /** Called on Write Authentication Enable Complete Event.
1457 @param aStatus HCI specific or system wide error code.
1461 virtual void WriteAuthenticationEnableCompleteEvent(THCIErrorCode aStatus)=0;
1463 /** Called on Write Encryption Mode Complete Event.
1465 @param aStatus HCI specific or system wide error code.
1469 virtual void WriteEncryptionModeCompleteEvent(THCIErrorCode aStatus)=0;
1471 /** Called on Write Page Timeout Complete Event.
1473 @param aStatus HCI specific or system wide error code.
1477 virtual void WritePageTimeoutCompleteEvent(THCIErrorCode aStatus)=0;
1479 /** Called on Write Connection Accept Timeout Complete Event.
1481 @param aStatus HCI specific or system wide error code.
1485 virtual void WriteConnectionAcceptTimeoutCompleteEvent(THCIErrorCode aStatus)=0;
1487 /** Called on Write Class Of Device Complete Event.
1489 @param aStatus HCI specific or system wide error code.
1493 virtual void WriteClassOfDeviceCompleteEvent(THCIErrorCode aStatus)=0;
1495 /** Called on Write Voice Setting Complete Event.
1497 @param aStatus HCI specific or system wide error code.
1501 virtual void WriteVoiceSettingCompleteEvent(THCIErrorCode aStatus)=0;
1503 /** Called on Write Current IAC LAP Complete Event.
1505 @param aStatus HCI specific or system wide error code.
1509 virtual void WriteCurrentIACLAPCompleteEvent(THCIErrorCode aStatus)=0;
1511 /** Called on Set Host Controller To Host Flow Complete Event.
1513 @param aStatus HCI specific or system wide error code.
1517 virtual void SetHostControllerToHostFlowCompleteEvent(THCIErrorCode aStatus)=0;
1519 /** Called on Host Buffer Size Complete Event.
1521 @param aStatus HCI specific or system wide error code.
1525 virtual void HostBufferSizeCompleteEvent(THCIErrorCode aStatus)=0;
1527 /** Called on Host Number Of Completed Packets Complete Event.
1529 @param aStatus HCI specific or system wide error code.
1533 virtual void HostNumberOfCompletedPacketsCompleteEvent(THCIErrorCode aStatus)=0;
1535 /** Called on Write Scan Enable Complete Event.
1537 @param aStatus HCI specific or system wide error code.
1541 virtual void WriteScanEnableCompleteEvent(THCIErrorCode aStatus)=0;
1543 /** Called on Write Link Policy Settings Complete Event.
1545 @param aConnH Connection handle
1546 @param aStatus HCI specific or system wide error code.
1550 virtual void WriteLinkPolicySettingsCompleteEvent(THCIErrorCode aStatus, THCIConnHandle aConnH)=0;
1552 // results of local commands
1555 /** Called on Read Stored Link Key Result.
1557 @param aNumKeysRead Number of keys read
1558 @param aMaxNumKeys Max number of keys
1559 @param aErr HCI specific or system wide error code.
1563 virtual void ReadStoredLinkKeyResult(THCIErrorCode aErr,TUint16 aNumKeysRead,TUint16 aMaxNumKeys)=0;
1565 /** Called on Write Stored Link Key Result.
1567 @param aNumKeysStored Number of keys stored
1568 @param aErr HCI specific or system wide error code.
1572 virtual void WriteStoredLinkKeyResult(THCIErrorCode aErr,TUint8 aNumKeysStored)=0;
1574 /** Called on Delete Stored Link Key Result.
1576 @param aNumKeysDeleted Number of keys deleted
1577 @param aErr HCI specific or system wide error code.
1581 virtual void DeleteStoredLinkKeyResult(THCIErrorCode aErr,TUint8 aNumKeysDeleted)=0;
1583 /** Called on Read Scan Enable Result.
1585 @param aEnable See bluetooth specification
1586 @param aErr HCI specific or system wide error code.
1590 virtual void ReadScanEnableResult(THCIErrorCode aErr,TUint8 aEnable)=0;
1592 /** Called on Read Authentication Enable Result.
1594 @param aEnable See bluetooth specification
1595 @param aErr HCI specific or system wide error code.
1599 virtual void ReadAuthenticationEnableResult(THCIErrorCode aErr,TUint8 aEnable)=0;
1601 /** Called on Read Encryption Enable Result.
1603 @param aEnable See bluetooth specification
1604 @param aErr HCI specific or system wide error code.
1608 virtual void ReadEncryptionEnableResult(THCIErrorCode aErr,THCIEncryptModeFlag aEnable)=0;
1610 /** Called on Read Bdaddr Result.
1612 @param aBdaddr Bluetooth device address of remote device
1613 @param aErr HCI specific or system wide error code.
1617 virtual void ReadBdaddrResult(THCIErrorCode aErr,const TBTDevAddr& aBdaddr)=0;
1619 /** Called on Read Class Of Device Result.
1621 @param aCoD Class of device of remote device
1622 @param aErr HCI specific or system wide error code.
1626 virtual void ReadClassOfDeviceResult(THCIErrorCode aErr,TUint aCoD)=0;
1628 /** Called on Read Voice Setting Result.
1630 @param aVoiceChannelSetting Voice channel setting
1631 @param aErr HCI specific or system wide error code.
1635 virtual void ReadVoiceSettingResult(THCIErrorCode aErr,TUint16 aVoiceChannelSetting)=0;
1637 /** Called on Read Local Name Result.
1639 @param aLocalName Local name
1640 @param aErr HCI specific or system wide error code.
1644 virtual void ReadLocalNameResult(THCIErrorCode aErr,const TDesC8& aLocalName)=0;
1646 /** Called on Read Timeout Result.
1648 @param aType See bluetooth specification
1649 @param aTimeout See bluetooth specification
1650 @param aErr HCI specific or system wide error code.
1654 virtual void ReadTimeoutResult(THCIErrorCode aErr,THCITimeoutType aType,TBasebandTime aTimeout)=0;
1656 /** Called on Read Local Version Info Result.
1658 @param aHCIVersion Version information of local device hardware
1659 @param aLMPVersion Version information of local LMP
1660 @param aErr HCI specific or system wide error code.
1664 virtual void ReadLocalVersionInfoResult(THCIErrorCode aErr, TBTDevHCIVersion aHCIVersion, TBTDevLMPVersion aLMPVersion)=0;
1666 /** Called on Read Local Supported Features Result.
1668 @param aBitMaskList See bluetooth specification
1669 @param aErr HCI specific or system wide error code.
1673 virtual void ReadLocalSupportedFeaturesResult(THCIErrorCode aErr, TUint64 aBitMaskList)=0;
1674 /** Called on Read Country Code Result.
1676 @param aCountryCode Country code
1677 @param aErr HCI specific or system wide error code.
1681 virtual void ReadCountryCodeResult(THCIErrorCode aErr, TUint8 aCountryCode)=0;
1683 /** Called on Read Number Of Supported IAC Result.
1685 @param aNumIACs Number of IACs
1686 @param aErr HCI specific or system wide error code.
1690 virtual void ReadNumberOfSupportedIACResult(THCIErrorCode aErr, TUint8 aNumIACs)=0;
1692 /** Called on Read Discoverability Result.
1694 @param aNumIACs The number of concurrent IACs on which scanning is/would take place
1695 @param aIAC IAC_LAP array.
1696 @param aErr HCI specific or system wide error code.
1700 virtual void ReadDiscoverabilityResult(THCIErrorCode aErr, TUint8 aNumIACs, TUint aIAC[])=0;
1702 /** Called on Read Buffer Size Result.
1704 @param aAclMaxLen Maximum length of each ACL packet
1705 @param aScoMaxLen Maximum length of each SCO packet
1706 @param aNoACL Total number of ACL data packets
1707 @param aNoSCO Total number of SCO data packets
1708 @param aErr HCI specific or system wide error code.
1712 virtual void ReadBufferSizeResult(THCIErrorCode aErr,TUint16 aAclMaxLen,
1713 TUint8 aScoMaxLen,TUint16 aNoACL,TUint16 aNoSCO)=0;
1715 /** Called on Read Role Discovery Result.
1717 @param aRole Current role
1718 @param aStatus HCI specific or system wide error code.
1722 virtual void ReadRoleDiscoveryResult(THCIErrorCode aStatus, TBTBasebandRole aRole)=0;
1724 /** Called on Vendor Specific Debug Event.
1726 @param aEventFrame The frame holds the event parameters and parameter length field
1730 virtual void VendorSpecificDebugEvent(TPtrC8 aEventFrame)=0;
1734 /** Called on Handle Power Status Change.
1736 @param aState New power state
1740 virtual void HandlePowerStatusChange(TBTPowerState aState)=0;
1743 // Results of Adaptive Frequency Hopping (AFH) commands
1745 /** Called in response to a SetAFHHostChannelClassification command.
1747 @param aStatus The success or not of the SetAFHHostChannelClassification command
1748 @see SetAFHHostChannelClassification
1752 virtual void SetAFHHostChannelClassificationCompleteEvent(THCIErrorCode aStatus)=0;
1754 /** Called in response to a ReadAFHChannelMap command.
1756 @param aStatus The success or not of the ReadAFHChannelMap command
1757 @param aConnH Connection handle
1758 @param aAFHMode ETrue if AFH is enabled, EFalse if not
1759 @param aAFHChannelMap The AFH channel map being used on the specified connection
1760 @see ReadAFHChannelMap
1764 virtual void ReadAFHChannelMapCompleteEvent(THCIErrorCode aStatus, THCIConnHandle aConnH, TBool aAFHMode, const TDesC8& aAFHChannelMap)=0;
1766 /** Called in response to a WriteAFHChannelAssessmentMode command.
1768 @param aStatus The success or not of the WriteAFHChannelAssessmentMode command
1769 @see WriteAFHChannelAssessmentMode
1773 virtual void WriteAFHChannelAssessmentModeCompleteEvent(THCIErrorCode aStatus)=0;
1775 /** Called in response to a ReadAFHChannelAssessmentMode command.
1777 @param aStatus The success or not of the ReadAFHChannelAssessmentMode command
1778 @param aChannelAssessmentMode The host controller is checking for busy channels if ETrue, otherwise it is not
1779 @see ReadAFHChannelAssessmentMode
1783 virtual void ReadAFHChannelAssessmentModeCompleteEvent(THCIErrorCode aStatus, TBool aChannelAssessmentMode)=0;
1786 /** Called in response to a Flush command.
1788 @param aStatus The success or not of the Flush command
1789 @param aConnH The connection handle
1793 virtual void FlushCompleteEvent(THCIErrorCode aStatus, THCIConnHandle aConnH)=0;
1796 /** Called on a synchronous connection complete event.
1798 @param aConnH HCI connection handle
1799 @param aBdaddr BT device address
1800 @param aLinkType Link Type:SCO, Reserved or eSCO
1801 @param aTransmissionInterval Transmission Interval
1802 @param aRetransmissionWindow Retransmission Window
1803 @param aRxPacketLength Rx Packet Length
1804 @param aTxPacketLength Tx Packet Length
1805 @param aAirMode Air Mode: uLaw, ALaw, CVSD or Transparent data
1809 virtual void SynchronousConnectionCompleteEvent(const THCIErrorCode aErr,
1810 const THCIConnHandle aConnH,
1811 const TBTDevAddr& aBdaddr,
1812 const TLinkType aLinkType,
1813 const TUint8 aTransmissionInterval,
1814 const TUint8 aRetransmissionWindow,
1815 const TUint16 aRxPacketLength,
1816 const TUint16 aTxPacketLength,
1817 const TAirMode aAirMode)=0;
1819 /** Called on a synchronous connection changed event
1821 @param aConnH HCI connection handle
1822 @param aTransmissionInterval Transmission Interval
1823 @param aRetransmissionWindow Retransmission Window
1824 @param aRxPacketLength Rx Packet Length
1825 @param aTxPacketLength Tx Packet Length
1829 virtual void SynchronousConnectionChangedEvent(const THCIErrorCode aErr,
1830 const THCIConnHandle aConnH,
1831 const TUint8 aTransmissionInterval,
1832 const TUint8 aRetransmissionWindow,
1833 const TUint16 aRxPacketLength,
1834 const TUint16 aTxPacketLength)=0;
1838 /** Called when an HCI level Ioctl completes.
1840 @param aLevel The Ioctl level
1841 @param aName The Ioctl function number
1842 @param aOption Data associated with this Ioctl
1843 @param aErr System-wide error code
1844 @param aStackSAP A pointer to the SAP, used to track Ioctls
1848 virtual void CompleteIoctl(TUint aLevel,TUint aName,TDes8* aOption,TInt aErr, TAny* aStackSAP)=0;
1853 * Constants used for Symbian's RHCIDirectAccess test functionality
1857 enum THCIDirectAccessTestIoctl
1859 EHCIDirectAccessTestIoctlSetFlag1 = 0,
1860 EHCIDirectAccessTestIoctlSetFlag2,
1861 EHCIDirectAccessTestIoctlGetFlag1,
1862 EHCIDirectAccessTestIoctlGetFlag2,
1863 EHCIDirectAccessTestIoctlValidateFlag1,
1864 EHCIDirectAccessTestIoctlValidateFlag2,
1865 EHCIDirectAccessTestIoctlTimerFiveSeconds,
1866 EHCIDirectAccessTestIoctlTimerEightSeconds,
1867 EHCIDirectAccessTestIoctlTestDataPath,
1868 EHCIDirectAccessTestIoctlNotifyOnEventX,
1869 EHCIDirectAccessTestIoctlTriggerEventX,
1872 // text strings for testing data path
1873 _LIT8(KHCIDirectAccessTestExpectedText, "ExpectedText");
1874 _LIT8(KHCIDirectAccessTestUnexpectedText, "UnexpectedText");