|
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 completeeventsource.tmpl |
|
15 // on Wed, 25 Jul 2007 17:00:37 (time stamp) |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include <bluetooth/hci/readlocalversioninfocompleteevent.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 TReadLocalVersionInfoCompleteEvent::TReadLocalVersionInfoCompleteEvent(const TDesC8& aEventData) |
|
35 : THCICommandCompleteEvent(aEventData) |
|
36 { |
|
37 iErrorCode = THCIErrorCode(iEventData[5]); // Status field is in octet 6 |
|
38 } |
|
39 |
|
40 // Construct an event object to generate a faked event using the supplied parameters |
|
41 EXPORT_C TReadLocalVersionInfoCompleteEvent::TReadLocalVersionInfoCompleteEvent(THCIErrorCode aStatus, TUint8 aNumHCICommandPackets, TUint8 aVersion, TUint16 aRevision, TUint8 aLMPVersion, TUint16 aManufacturerName, TUint16 aLMPSubversion, TDes8& aEventData) |
|
42 : THCICommandCompleteEvent(9 + KCommandCompleteCommonFieldsLength, aNumHCICommandPackets, KReadLocalVersionInfoOpcode, aEventData) |
|
43 { |
|
44 iErrorCode = aStatus; |
|
45 PutTUint8(aStatus, aEventData); |
|
46 PutTUint8(aVersion, aEventData); |
|
47 PutTUint16(aRevision, aEventData); |
|
48 PutTUint8(aLMPVersion, aEventData); |
|
49 PutTUint16(aManufacturerName, aEventData); |
|
50 PutTUint16(aLMPSubversion, aEventData); |
|
51 iEventData.Set(aEventData); |
|
52 } |
|
53 |
|
54 // The static Cast method is used to obtain a pointer to the derived class object |
|
55 EXPORT_C TReadLocalVersionInfoCompleteEvent& TReadLocalVersionInfoCompleteEvent::Cast(const THCIEventBase& aEvent) |
|
56 { |
|
57 __ASSERT_DEBUG(aEvent.EventCode() == ECommandCompleteEvent, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode)); |
|
58 __ASSERT_DEBUG(THCICommandCompleteEvent::Cast(aEvent).CommandOpcode() == KReadLocalVersionInfoOpcode, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode)); |
|
59 return *(reinterpret_cast<TReadLocalVersionInfoCompleteEvent*>(&const_cast<THCIEventBase&>(aEvent))); |
|
60 } |
|
61 |
|
62 // Accessor methods for the parameters of the event |
|
63 |
|
64 EXPORT_C TUint8 TReadLocalVersionInfoCompleteEvent::Version() const |
|
65 { |
|
66 return AsTUint8(6); |
|
67 } |
|
68 |
|
69 EXPORT_C TUint16 TReadLocalVersionInfoCompleteEvent::Revision() const |
|
70 { |
|
71 return AsTUint16(7); |
|
72 } |
|
73 |
|
74 EXPORT_C TUint8 TReadLocalVersionInfoCompleteEvent::LMPVersion() const |
|
75 { |
|
76 return AsTUint8(9); |
|
77 } |
|
78 |
|
79 EXPORT_C TUint16 TReadLocalVersionInfoCompleteEvent::ManufacturerName() const |
|
80 { |
|
81 return AsTUint16(10); |
|
82 } |
|
83 |
|
84 EXPORT_C TUint16 TReadLocalVersionInfoCompleteEvent::LMPSubversion() const |
|
85 { |
|
86 return AsTUint16(12); |
|
87 } |
|
88 |
|
89 |