bthci/hci2implementations/CommandsEvents/symbian/src/enhancedflushcommand.cpp
changeset 0 29b1cd4cb562
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 // This file was generated automatically from the template commandsource.tmpl
       
    15 // on Thu, 29 May 2008 16:17:36 (time stamp)
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #include <bluetooth/hci/enhancedflushcommand.h>
       
    25 #include <bluetooth/hci/event.h>
       
    26 #include <bluetooth/hci/commandcompleteevent.h>
       
    27 #include <bluetooth/hci/hciframe.h>
       
    28 #include <bluetooth/hci/hciopcodes.h>
       
    29 #include <bluetooth/hci/enhancedflushcompleteevent.h>
       
    30 
       
    31 
       
    32 #ifdef __FLOG_ACTIVE
       
    33 _LIT8(KLogComponent, LOG_COMPONENT_COMMANDSEVENTS_SYMBIAN);
       
    34 #endif
       
    35 
       
    36 
       
    37 
       
    38 // Factory methods
       
    39 
       
    40 EXPORT_C CEnhancedFlushCommand* CEnhancedFlushCommand::NewL(THCIConnectionHandle aConnectionHandle, TUint8 aPacketType)
       
    41 	{
       
    42 	CEnhancedFlushCommand* self = new (ELeave) CEnhancedFlushCommand(aConnectionHandle, aPacketType);
       
    43 	CleanupStack::PushL(self);
       
    44 	self->CHCICommandBase::BaseConstructL();
       
    45 	CleanupStack::Pop(self);
       
    46 	return self;
       
    47 	}
       
    48 
       
    49 EXPORT_C CEnhancedFlushCommand* CEnhancedFlushCommand::NewL()
       
    50 	{
       
    51 	CEnhancedFlushCommand* self = new (ELeave) CEnhancedFlushCommand();
       
    52 	CleanupStack::PushL(self);
       
    53 	self->CHCICommandBase::BaseConstructL();
       
    54 	CleanupStack::Pop(self);
       
    55 	return self;
       
    56 	}
       
    57 
       
    58 // Constructors
       
    59 
       
    60 CEnhancedFlushCommand::CEnhancedFlushCommand(THCIConnectionHandle aConnectionHandle, TUint8 aPacketType)
       
    61 	: CHCICommandBase(KEnhancedFlushOpcode)
       
    62 	, iConnectionHandle(aConnectionHandle)
       
    63 	, iPacketType(aPacketType)
       
    64 	{
       
    65 	SetExpectsCommandCompleteEvent(EFalse);
       
    66 	}
       
    67 
       
    68 CEnhancedFlushCommand::CEnhancedFlushCommand()
       
    69 	: CHCICommandBase(KEnhancedFlushOpcode)
       
    70 	{
       
    71 	SetExpectsCommandCompleteEvent(EFalse);
       
    72 	}
       
    73 
       
    74 // Destructor
       
    75 CEnhancedFlushCommand::~CEnhancedFlushCommand()
       
    76 	{
       
    77 	
       
    78 	}	
       
    79 
       
    80 /*virtual*/ void CEnhancedFlushCommand::Match(const THCIEventBase& aEvent, TBool& aMatchesCmd, TBool& aConcludesCmd, TBool& aContinueMatching) const
       
    81 	{
       
    82 	if (aEvent.EventCode() == EEnhancedFlushCompleteEvent)
       
    83 		{
       
    84 		TEnhancedFlushCompleteEvent& event = TEnhancedFlushCompleteEvent::Cast(aEvent);
       
    85 		if (event.ConnectionHandle() == ConnectionHandle())
       
    86 			{
       
    87 			aMatchesCmd = ETrue;
       
    88 			aConcludesCmd = ETrue;
       
    89 			aContinueMatching = EFalse;
       
    90 			}
       
    91 		}
       
    92 	// Command Status Event and default Command Complete Event matching
       
    93 	// is implemented in the base class.  If we haven't matched already
       
    94 	// then we should try the default matching.
       
    95 	if (!aMatchesCmd)
       
    96 		{
       
    97 		CHCICommandBase::Match(aEvent, aMatchesCmd, aConcludesCmd, aContinueMatching);
       
    98 		}
       
    99 	}
       
   100 	
       
   101 
       
   102 // Override of pure virtual from CHCICommandBase. This method embodies the knowledge
       
   103 // of how to format the specifics of this command into the HCTL command frame.
       
   104 void CEnhancedFlushCommand::Format(CHctlCommandFrame& aCommandFrame) const
       
   105 	{
       
   106 	aCommandFrame.PutConnectionHandle(iConnectionHandle);
       
   107 	aCommandFrame.PutByte(iPacketType);
       
   108 	}
       
   109 
       
   110 // Assign new values to the parameters of this command
       
   111 EXPORT_C void CEnhancedFlushCommand::Reset(THCIConnectionHandle aConnectionHandle, TUint8 aPacketType)
       
   112 	{
       
   113 	iConnectionHandle = aConnectionHandle;
       
   114 	iPacketType = aPacketType;
       
   115 	}
       
   116 
       
   117 // Accessor methods for the parameters of the command
       
   118 
       
   119 EXPORT_C THCIConnectionHandle CEnhancedFlushCommand::ConnectionHandle() const
       
   120 	{
       
   121 	return iConnectionHandle;
       
   122 	}
       
   123 
       
   124 EXPORT_C TUint8 CEnhancedFlushCommand::PacketType() const
       
   125 	{
       
   126 	return iPacketType;
       
   127 	}
       
   128 
       
   129 
       
   130 
       
   131 // Extension function.  Use this to retrieve any extension interfaces from CEnhancedFlushCommand
       
   132 // or any class from which it derives.
       
   133 /*virtual*/ TInt CEnhancedFlushCommand::Extension_(TUint aExtensionId, TAny*& aInterface, TAny* aData)
       
   134 	{
       
   135 	// To add an additional interface implementation specific for this class check the 
       
   136 	// provided ID and return an appropriate interface.
       
   137 
       
   138 	// If a specific interface implementation is not provided - forward the call to the base class.
       
   139 	return CHCICommandBase::Extension_(aExtensionId, aInterface, aData);
       
   140 	}
       
   141