bthci/hci2implementations/qdps/symbian/inc/hcisymbianqdp.h
changeset 0 29b1cd4cb562
child 1 b4a7eebaaebf
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef HCISYMBIANQDP_H
       
    22 #define HCISYMBIANQDP_H
       
    23 
       
    24 #include <bluetooth/hci/hcicmdqueuedecisionplugin.h>
       
    25 #include <bluetooth/hci/hcicmdqueuedecisioninterface.h>
       
    26 #include <bluetooth/hci/hcitypes.h>
       
    27 
       
    28 /**
       
    29 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 */
       
    32 class CHCISymbianQdp : 	public CHCICmdQueueDecisionPlugin,
       
    33 						public MHCICmdQueueDecisionInterface,
       
    34 						public MHCICmdQueueEventModifierInterface,
       
    35 						public MHCICmdQueueUtilityUser
       
    36 	{
       
    37 public:
       
    38 	static CHCISymbianQdp* NewL();
       
    39 
       
    40 	virtual TAny* Interface(TUid aUid);
       
    41 	
       
    42 	// virtuals from MHCICmdQueueDecisionInterface
       
    43 	TBool MhcqdiDoesCommandRequireWorkaround(const CHCICommandQItem& aParent);
       
    44 	
       
    45 	CHCICommandQItem* MhcqdiGetPreChildCommand(const CHCICommandQItem& aParent,
       
    46 											   const CHCICommandQItem* const aPreviousWorkaroundCmd,
       
    47 											   const THCIEventBase* const aPreviousCmdResult);
       
    48 	
       
    49 	CHCICommandQItem* MhcqdiGetPostChildCommand(const CHCICommandQItem& aParent,
       
    50 												const CHCICommandQItem* const aPreviousPostChild,
       
    51 												const THCIEventBase* aPreviousCmdResult);
       
    52 	
       
    53 	THCIEventBase* MhcqdiGetFakedUnsolicitedEvent(const CHCICommandQItem& aParent,
       
    54 												  const THCIEventBase* aPreviousFakedEvent);
       
    55 
       
    56 	void MhcqdiCommandAboutToBeDeleted(const CHCICommandQItem& aDyingCmd);
       
    57 
       
    58 	TInt MhcqdiCanSend(CHCICommandQItem& aCommand, const TDblQue<const CHCICommandQItem>& aSentCommands);
       
    59 
       
    60 	TUint MhcqdiTimeoutRequired(const CHCICommandQItem& aCmdAboutToBeSent);
       
    61 
       
    62 	void MhcqdiMatchedEventReceived(const THCIEventBase& aEvent, const CHCICommandQItem& aRelatedCommand);
       
    63 	
       
    64 	TCommandErroredAction MhcqdiMatchedErrorEventReceived(const THCIEventBase& aErrorEvent, 
       
    65 												 		  const CHCICommandQItem& aRelatedCommand);
       
    66 
       
    67 	void MhcqdiUnmatchedEventReceived(const THCIEventBase& aEvent);
       
    68 	
       
    69 	TCommandTimedOutAction MhcqdiCommandTimedOut(const CHCICommandQItem& aCommand,
       
    70 												 const TDblQue<const CHCICommandQItem>& aSentCommands,
       
    71 												 TUint aCurrentCommandCredits,
       
    72 												 TUint& aCreditsToBeRefunded);
       
    73 
       
    74 	void MhcqdiSetPhysicalLinksState(const MPhysicalLinksState& aPhysicalLinkState);
       
    75 
       
    76 	void MhcqdiSetHardResetInitiator(const MHardResetInitiator& aHardResetInitiator);
       
    77 
       
    78 	void MhcqdiSetHCICommandQueue(MHCICommandQueue& aHCICommandQueue);
       
    79 
       
    80 	void MhcqdiSetTimeouts(TUint aQueueStarvationTimeout, TUint aMaxHciCommandTimeout);
       
    81 
       
    82 	TUint MhcqdiReset();
       
    83 
       
    84 	void MhcqemiMatchedEventReceived(THCIEventBase& aEvent, const CHCICommandQItem& aRelatedCommand);
       
    85 	
       
    86 	void MhcqemiUnmatchedEventReceived(THCIEventBase& aEvent);
       
    87 
       
    88 	void MhcquuSetUtilitiesProvider(MHCICmdQueueUtilities& aProvider);
       
    89 private:
       
    90 	// The initial number of command credits for the HCI Command Queue.
       
    91 	const static TInt KHCIDefaultCmdCredits = 1;
       
    92 
       
    93 	// Workarounds for broken firmware
       
    94 	void FirmwareFixIgnoreErrorOnSetEventMaskForCasira(THCIEventBase& aEvent);
       
    95 	void FirmwareFixFakeCompletionEventsOnDisconnectionForBelkin(THCIEventBase& aEvent);
       
    96 
       
    97 private:
       
    98 	CHCISymbianQdp();
       
    99 
       
   100 private:
       
   101 	MHCICmdQueueUtilities* iProvider;
       
   102 	TUint8 iHCIVersion;
       
   103 	};
       
   104 
       
   105 #endif // HCISYMBIANQDP_H