bthci/hci2implementations/qdps/symbian/inc/hcisymbianqdp.h
changeset 1 b4a7eebaaebf
parent 0 29b1cd4cb562
equal deleted inserted replaced
0:29b1cd4cb562 1:b4a7eebaaebf
    22 #define HCISYMBIANQDP_H
    22 #define HCISYMBIANQDP_H
    23 
    23 
    24 #include <bluetooth/hci/hcicmdqueuedecisionplugin.h>
    24 #include <bluetooth/hci/hcicmdqueuedecisionplugin.h>
    25 #include <bluetooth/hci/hcicmdqueuedecisioninterface.h>
    25 #include <bluetooth/hci/hcicmdqueuedecisioninterface.h>
    26 #include <bluetooth/hci/hcitypes.h>
    26 #include <bluetooth/hci/hcitypes.h>
       
    27 #include <bluetooth/hci/hciconsts.h>
    27 
    28 
    28 /**
    29 /**
    29 This class represents a QDP that is relevant for hardware that is perfect,
    30 This class represents a QDP that is relevant for hardware that is perfect,
    30 and so the Command Queue can operate normally without any special considerations.
    31 and so the Command Queue can operate normally without any special considerations.
    31 */
    32 */
    35 						public MHCICmdQueueUtilityUser
    36 						public MHCICmdQueueUtilityUser
    36 	{
    37 	{
    37 public:
    38 public:
    38 	static CHCISymbianQdp* NewL();
    39 	static CHCISymbianQdp* NewL();
    39 
    40 
       
    41 private: // from CHCICmdQueueDecisionPlugin
    40 	virtual TAny* Interface(TUid aUid);
    42 	virtual TAny* Interface(TUid aUid);
    41 	
    43 	
    42 	// virtuals from MHCICmdQueueDecisionInterface
    44 private: // virtuals from MHCICmdQueueDecisionInterface
    43 	TBool MhcqdiDoesCommandRequireWorkaround(const CHCICommandQItem& aParent);
    45 	TBool MhcqdiDoesCommandRequireWorkaround(const CHCICommandQItem& aParent);
    44 	
       
    45 	CHCICommandQItem* MhcqdiGetPreChildCommand(const CHCICommandQItem& aParent,
    46 	CHCICommandQItem* MhcqdiGetPreChildCommand(const CHCICommandQItem& aParent,
    46 											   const CHCICommandQItem* const aPreviousWorkaroundCmd,
    47 											   const CHCICommandQItem* const aPreviousWorkaroundCmd,
    47 											   const THCIEventBase* const aPreviousCmdResult);
    48 											   const THCIEventBase* const aPreviousCmdResult);
    48 	
       
    49 	CHCICommandQItem* MhcqdiGetPostChildCommand(const CHCICommandQItem& aParent,
    49 	CHCICommandQItem* MhcqdiGetPostChildCommand(const CHCICommandQItem& aParent,
    50 												const CHCICommandQItem* const aPreviousPostChild,
    50 												const CHCICommandQItem* const aPreviousPostChild,
    51 												const THCIEventBase* aPreviousCmdResult);
    51 												const THCIEventBase* aPreviousCmdResult);
    52 	
       
    53 	THCIEventBase* MhcqdiGetFakedUnsolicitedEvent(const CHCICommandQItem& aParent,
    52 	THCIEventBase* MhcqdiGetFakedUnsolicitedEvent(const CHCICommandQItem& aParent,
    54 												  const THCIEventBase* aPreviousFakedEvent);
    53 												  const THCIEventBase* aPreviousFakedEvent);
    55 
       
    56 	void MhcqdiCommandAboutToBeDeleted(const CHCICommandQItem& aDyingCmd);
    54 	void MhcqdiCommandAboutToBeDeleted(const CHCICommandQItem& aDyingCmd);
    57 
       
    58 	TInt MhcqdiCanSend(CHCICommandQItem& aCommand, const TDblQue<const CHCICommandQItem>& aSentCommands);
    55 	TInt MhcqdiCanSend(CHCICommandQItem& aCommand, const TDblQue<const CHCICommandQItem>& aSentCommands);
    59 
       
    60 	TUint MhcqdiTimeoutRequired(const CHCICommandQItem& aCmdAboutToBeSent);
    56 	TUint MhcqdiTimeoutRequired(const CHCICommandQItem& aCmdAboutToBeSent);
    61 
       
    62 	void MhcqdiMatchedEventReceived(const THCIEventBase& aEvent, const CHCICommandQItem& aRelatedCommand);
    57 	void MhcqdiMatchedEventReceived(const THCIEventBase& aEvent, const CHCICommandQItem& aRelatedCommand);
    63 	
       
    64 	TCommandErroredAction MhcqdiMatchedErrorEventReceived(const THCIEventBase& aErrorEvent, 
    58 	TCommandErroredAction MhcqdiMatchedErrorEventReceived(const THCIEventBase& aErrorEvent, 
    65 												 		  const CHCICommandQItem& aRelatedCommand);
    59 												 		  const CHCICommandQItem& aRelatedCommand);
    66 
       
    67 	void MhcqdiUnmatchedEventReceived(const THCIEventBase& aEvent);
    60 	void MhcqdiUnmatchedEventReceived(const THCIEventBase& aEvent);
    68 	
       
    69 	TCommandTimedOutAction MhcqdiCommandTimedOut(const CHCICommandQItem& aCommand,
    61 	TCommandTimedOutAction MhcqdiCommandTimedOut(const CHCICommandQItem& aCommand,
    70 												 const TDblQue<const CHCICommandQItem>& aSentCommands,
    62 												 const TDblQue<const CHCICommandQItem>& aSentCommands,
    71 												 TUint aCurrentCommandCredits,
    63 												 TUint aCurrentCommandCredits,
    72 												 TUint& aCreditsToBeRefunded);
    64 												 TUint& aCreditsToBeRefunded);
    73 
       
    74 	void MhcqdiSetPhysicalLinksState(const MPhysicalLinksState& aPhysicalLinkState);
    65 	void MhcqdiSetPhysicalLinksState(const MPhysicalLinksState& aPhysicalLinkState);
    75 
       
    76 	void MhcqdiSetHardResetInitiator(const MHardResetInitiator& aHardResetInitiator);
    66 	void MhcqdiSetHardResetInitiator(const MHardResetInitiator& aHardResetInitiator);
    77 
       
    78 	void MhcqdiSetHCICommandQueue(MHCICommandQueue& aHCICommandQueue);
    67 	void MhcqdiSetHCICommandQueue(MHCICommandQueue& aHCICommandQueue);
    79 
       
    80 	void MhcqdiSetTimeouts(TUint aQueueStarvationTimeout, TUint aMaxHciCommandTimeout);
    68 	void MhcqdiSetTimeouts(TUint aQueueStarvationTimeout, TUint aMaxHciCommandTimeout);
    81 
       
    82 	TUint MhcqdiReset();
    69 	TUint MhcqdiReset();
    83 
    70 
       
    71 private: // from MHCICmdQueueEventModifierInterface
    84 	void MhcqemiMatchedEventReceived(THCIEventBase& aEvent, const CHCICommandQItem& aRelatedCommand);
    72 	void MhcqemiMatchedEventReceived(THCIEventBase& aEvent, const CHCICommandQItem& aRelatedCommand);
    85 	
       
    86 	void MhcqemiUnmatchedEventReceived(THCIEventBase& aEvent);
    73 	void MhcqemiUnmatchedEventReceived(THCIEventBase& aEvent);
    87 
    74 
       
    75 private: // from MHCICmdQueueUtilityUser
    88 	void MhcquuSetUtilitiesProvider(MHCICmdQueueUtilities& aProvider);
    76 	void MhcquuSetUtilitiesProvider(MHCICmdQueueUtilities& aProvider);
       
    77 	
    89 private:
    78 private:
    90 	// The initial number of command credits for the HCI Command Queue.
    79 	// The initial number of command credits for the HCI Command Queue.
    91 	const static TInt KHCIDefaultCmdCredits = 1;
    80 	const static TInt KHCIDefaultCmdCredits = 1;
    92 
    81 
    93 	// Workarounds for broken firmware
    82 	// Workarounds for controller problems
    94 	void FirmwareFixIgnoreErrorOnSetEventMaskForCasira(THCIEventBase& aEvent);
    83 	void FixIgnoreInvalidHciParameterErrorOnSetEventMaskOnVersion1_1(THCIEventBase& aEvent);
    95 	void FirmwareFixFakeCompletionEventsOnDisconnectionForBelkin(THCIEventBase& aEvent);
    84 	void FixFakeCompletionEventsOnDisconnection(THCIEventBase& aEvent);
    96 
    85 	void FixAddConnectionHandleForTruncatedInvalidConnectionHandleErrorEvents(THCIEventBase& aEvent, const CHCICommandQItem* aRelatedCommand);
       
    86 	
    97 private:
    87 private:
    98 	CHCISymbianQdp();
    88 	CHCISymbianQdp();
    99 
    89 
   100 private:
    90 private:
   101 	MHCICmdQueueUtilities* iProvider;
    91 	MHCICmdQueueUtilities* iProvider;
   102 	TUint8 iHCIVersion;
    92 	TUint8 iHCIVersion;
       
    93 	TBuf8<KHCIMaxEventSize> iEventModBuffer; // utility buffer for the backend of modified/injected events
   103 	};
    94 	};
   104 
    95 
   105 #endif // HCISYMBIANQDP_H
    96 #endif // HCISYMBIANQDP_H