bthci/bthci2/CommandsEvents/generator/eventsource.tmpl
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 01:12:20 +0200
changeset 4 28479eeba3fb
parent 0 29b1cd4cb562
child 13 16aa830c86c8
permissions -rw-r--r--
Revision: 201003
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
4
28479eeba3fb Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
0
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
4
28479eeba3fb Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
0
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
//
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
//
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
// Contributors:
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
//
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
// Description:
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
// This file was generated automatically from the template eventsource.tmpl
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
// on $GENERATE_TIME_STAMP
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
// 
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
//
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
/**
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
 @file
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
 @internalComponent
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
*/
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <bluetooth/hci/$FILENAME.h>
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <bluetooth/hci/hcierrors.h>
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <bluetooth/hci/hciopcodes.h>
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include "symbiancommandseventsutils.h"
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#ifdef __FLOG_ACTIVE
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
_LIT8(KLogComponent, LOG_COMPONENT_COMMANDSEVENTS_SYMBIAN);
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#endif
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
// Construct an event object to wrap existing event data received from the Controller
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
EXPORT_C $CLASSNAME::$CLASSNAME(const TDesC8& aEventData)
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
	: THCIEventBase(aEventData)
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
	{
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
	$EVENTSETERRORCODEBYEXTRACT
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
	}
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
// Construct a faked event, storing the supplied event parameters into the supplied empty event data buffer.
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
EXPORT_C $CLASSNAME::$CLASSNAME($FAKERPARAMETERS)
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
	: THCIEventBase($EVENTCODE, $FAKER_PARAMETER_TOTAL_LENGTH, aEventData)
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
	{
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
	$FAKERSETERRORCODEBYPARAM
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
	$FAKERWRITE_IMPLEMENTATION
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
	iEventData.Set(aEventData);
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
	}
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
// Destructor
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
EXPORT_C $CLASSNAME::~$CLASSNAME()
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
	{
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
	}
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
// The static Cast method is used to obtain a pointer to the derived class object
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
EXPORT_C $CLASSNAME& $CLASSNAME::Cast(const THCIEventBase& aEvent)
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
	{
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
	__ASSERT_DEBUG(aEvent.EventCode() == $EVENTCODE, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode));
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
	return *(reinterpret_cast<$CLASSNAME*>(&const_cast<THCIEventBase&>(aEvent)));
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
	}
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
// Accessor methods for the parameters of the event
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
29b1cd4cb562 Revision: 200951_001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
$ACCESSOR_IMPLEMENTATION