|
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 Wed, 25 Jul 2007 17:00:41 (time stamp) |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include <bluetooth/hci/synchronousconnectioncompleteevent.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 TSynchronousConnectionCompleteEvent::TSynchronousConnectionCompleteEvent(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 TSynchronousConnectionCompleteEvent::TSynchronousConnectionCompleteEvent(THCIErrorCode aStatus, THCIConnectionHandle aConnectionHandle, const TBTDevAddr& aBDADDR, TUint8 aLinkType, TUint8 aTransmissionInterval, TUint8 aRetransmissionWindow, TUint16 aRxPacket_Length, TUint16 aTxPacket_Length, TUint8 aAirMode, TDes8& aEventData) |
|
42 : THCIEventBase(ESynchronousConnectionCompleteEvent, 17, aEventData) |
|
43 { |
|
44 iErrorCode = aStatus; |
|
45 PutTUint8(aStatus, aEventData); |
|
46 PutConnectionHandle(aConnectionHandle, aEventData); |
|
47 PutDevAddr(aBDADDR, aEventData); |
|
48 PutTUint8(aLinkType, aEventData); |
|
49 PutTUint8(aTransmissionInterval, aEventData); |
|
50 PutTUint8(aRetransmissionWindow, aEventData); |
|
51 PutTUint16(aRxPacket_Length, aEventData); |
|
52 PutTUint16(aTxPacket_Length, aEventData); |
|
53 PutTUint8(aAirMode, aEventData); |
|
54 iEventData.Set(aEventData); |
|
55 } |
|
56 |
|
57 // Destructor |
|
58 EXPORT_C TSynchronousConnectionCompleteEvent::~TSynchronousConnectionCompleteEvent() |
|
59 { |
|
60 } |
|
61 |
|
62 // The static Cast method is used to obtain a pointer to the derived class object |
|
63 EXPORT_C TSynchronousConnectionCompleteEvent& TSynchronousConnectionCompleteEvent::Cast(const THCIEventBase& aEvent) |
|
64 { |
|
65 __ASSERT_DEBUG(aEvent.EventCode() == ESynchronousConnectionCompleteEvent, PANIC(KSymbianCommandsEventsPanicCat, EWrongEventCode)); |
|
66 return *(reinterpret_cast<TSynchronousConnectionCompleteEvent*>(&const_cast<THCIEventBase&>(aEvent))); |
|
67 } |
|
68 |
|
69 // Accessor methods for the parameters of the event |
|
70 |
|
71 EXPORT_C THCIConnectionHandle TSynchronousConnectionCompleteEvent::ConnectionHandle() const |
|
72 { |
|
73 return AsConnectionHandle(3); |
|
74 } |
|
75 |
|
76 EXPORT_C TBTDevAddr TSynchronousConnectionCompleteEvent::BDADDR() const |
|
77 { |
|
78 return AsDevAddr(5); |
|
79 } |
|
80 |
|
81 EXPORT_C TUint8 TSynchronousConnectionCompleteEvent::LinkType() const |
|
82 { |
|
83 return AsTUint8(11); |
|
84 } |
|
85 |
|
86 EXPORT_C TUint8 TSynchronousConnectionCompleteEvent::TransmissionInterval() const |
|
87 { |
|
88 return AsTUint8(12); |
|
89 } |
|
90 |
|
91 EXPORT_C TUint8 TSynchronousConnectionCompleteEvent::RetransmissionWindow() const |
|
92 { |
|
93 return AsTUint8(13); |
|
94 } |
|
95 |
|
96 EXPORT_C TUint16 TSynchronousConnectionCompleteEvent::RxPacket_Length() const |
|
97 { |
|
98 return AsTUint16(14); |
|
99 } |
|
100 |
|
101 EXPORT_C TUint16 TSynchronousConnectionCompleteEvent::TxPacket_Length() const |
|
102 { |
|
103 return AsTUint16(16); |
|
104 } |
|
105 |
|
106 EXPORT_C TUint8 TSynchronousConnectionCompleteEvent::AirMode() const |
|
107 { |
|
108 return AsTUint8(18); |
|
109 } |
|
110 |
|
111 |