|
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 eventsource.tmpl |
|
15 // on Mon, 02 Jun 2008 11:36:19 (time stamp) |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include <bluetooth/hci/sniffsubratingevent.h> |
|
25 #include <bluetooth/hci/hcierrors.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 TSniffSubratingEvent::TSniffSubratingEvent(const TDesC8& aEventData) |
|
35 : THCIEventBase(aEventData) |
|
36 { |
|
37 iErrorCode = THCIErrorCode(iEventData[2]); // Status field is in octet 3 |
|
38 } |
|
39 |
|
40 // Construct a faked event, storing the supplied event parameters into the supplied empty event data buffer. |
|
41 EXPORT_C TSniffSubratingEvent::TSniffSubratingEvent(THCIErrorCode aStatus, THCIConnectionHandle aConnectionHandle, TBasebandTime aMaximumTransmitLatency, TBasebandTime aMaximumReceiveLatency, TBasebandTime aMinimumRemoteTimeout, TBasebandTime aMinimumLocalTimeout, TDes8& aEventData) |
|
42 : THCIEventBase(ESniffSubratingEvent, 11, aEventData) |
|
43 { |
|
44 iErrorCode = aStatus; |
|
45 PutTUint8(aStatus, aEventData); |
|
46 PutConnectionHandle(aConnectionHandle, aEventData); |
|
47 PutTUint16(aMaximumTransmitLatency, aEventData); |
|
48 PutTUint16(aMaximumReceiveLatency, aEventData); |
|
49 PutTUint16(aMinimumRemoteTimeout, aEventData); |
|
50 PutTUint16(aMinimumLocalTimeout, aEventData); |
|
51 iEventData.Set(aEventData); |
|
52 } |
|
53 |
|
54 // Destructor |
|
55 EXPORT_C TSniffSubratingEvent::~TSniffSubratingEvent() |
|
56 { |
|
57 } |
|
58 |
|
59 // The static Cast method is used to obtain a pointer to the derived class object |
|
60 EXPORT_C TSniffSubratingEvent& TSniffSubratingEvent::Cast(const THCIEventBase& aEvent) |
|
61 { |
|
62 __ASSERT_DEBUG(aEvent.EventCode() == ESniffSubratingEvent, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode)); |
|
63 return *(reinterpret_cast<TSniffSubratingEvent*>(&const_cast<THCIEventBase&>(aEvent))); |
|
64 } |
|
65 |
|
66 // Accessor methods for the parameters of the event |
|
67 |
|
68 EXPORT_C THCIConnectionHandle TSniffSubratingEvent::ConnectionHandle() const |
|
69 { |
|
70 return AsConnectionHandle(3); |
|
71 } |
|
72 |
|
73 EXPORT_C TBasebandTime TSniffSubratingEvent::MaximumTransmitLatency() const |
|
74 { |
|
75 return AsTUint16(5); |
|
76 } |
|
77 |
|
78 EXPORT_C TBasebandTime TSniffSubratingEvent::MaximumReceiveLatency() const |
|
79 { |
|
80 return AsTUint16(7); |
|
81 } |
|
82 |
|
83 EXPORT_C TBasebandTime TSniffSubratingEvent::MinimumRemoteTimeout() const |
|
84 { |
|
85 return AsTUint16(9); |
|
86 } |
|
87 |
|
88 EXPORT_C TBasebandTime TSniffSubratingEvent::MinimumLocalTimeout() const |
|
89 { |
|
90 return AsTUint16(11); |
|
91 } |
|
92 |
|
93 |