bthci/bthci2/CommandsEvents/generator/completeeventsource.tmpl
changeset 0 29b1cd4cb562
child 4 28479eeba3fb
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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-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 completeeventsource.tmpl
       
    15 // on $GENERATE_TIME_STAMP
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #include <bluetooth/hci/$FILENAME.h>
       
    25 #include <bluetooth/hci/hciframe.h>
       
    26 #include <bluetooth/hci/hciopcodes.h>
       
    27 #include "symbiancommandseventsutils.h"
       
    28 
       
    29 #ifdef __FLOG_ACTIVE
       
    30 _LIT8(KLogComponent, LOG_COMPONENT_COMMANDSEVENTS_SYMBIAN);
       
    31 #endif
       
    32 
       
    33 // Construct an event object to wrap existing event data received from the Controller
       
    34 EXPORT_C $CLASSNAME::$CLASSNAME(const TDesC8& aEventData)
       
    35 	: THCICommandCompleteEvent(aEventData)
       
    36 	{
       
    37 	$EVENTSETERRORCODEBYEXTRACT
       
    38 	}
       
    39 
       
    40 // Construct an event object to generate a faked event using the supplied parameters
       
    41 EXPORT_C $CLASSNAME::$CLASSNAME($FAKERPARAMETERS)
       
    42 	: THCICommandCompleteEvent($FAKER_PARAMETER_TOTAL_LENGTH, aNumHCICommandPackets, $OPCODE, aEventData)
       
    43 	{
       
    44 	$FAKERSETERRORCODEBYPARAM
       
    45 	$FAKERWRITE_IMPLEMENTATION
       
    46 	iEventData.Set(aEventData);
       
    47 	}
       
    48 
       
    49 // The static Cast method is used to obtain a pointer to the derived class object
       
    50 EXPORT_C $CLASSNAME& $CLASSNAME::Cast(const THCIEventBase& aEvent)
       
    51 	{
       
    52 	__ASSERT_DEBUG(aEvent.EventCode() == ECommandCompleteEvent, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode));
       
    53 	__ASSERT_DEBUG(THCICommandCompleteEvent::Cast(aEvent).CommandOpcode() == $OPCODE, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode));
       
    54 	return *(reinterpret_cast<$CLASSNAME*>(&const_cast<THCIEventBase&>(aEvent)));
       
    55 	}
       
    56 
       
    57 // Accessor methods for the parameters of the event
       
    58 
       
    59 $ACCESSOR_IMPLEMENTATION