|
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 commandsource.tmpl |
|
15 // on Thu, 29 May 2008 15:17:53 (time stamp) |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include <bluetooth/hci/exitparkmodecommand.h> |
|
25 #include <bluetooth/hci/event.h> |
|
26 #include <bluetooth/hci/commandcompleteevent.h> |
|
27 #include <bluetooth/hci/hciframe.h> |
|
28 #include <bluetooth/hci/hciopcodes.h> |
|
29 #include <bluetooth/hci/modechangeevent.h> |
|
30 |
|
31 |
|
32 #ifdef __FLOG_ACTIVE |
|
33 _LIT8(KLogComponent, LOG_COMPONENT_COMMANDSEVENTS_SYMBIAN); |
|
34 #endif |
|
35 |
|
36 |
|
37 |
|
38 // Factory methods |
|
39 |
|
40 EXPORT_C CExitParkModeCommand* CExitParkModeCommand::NewL(THCIConnectionHandle aConnectionHandle) |
|
41 { |
|
42 CExitParkModeCommand* self = new (ELeave) CExitParkModeCommand(aConnectionHandle); |
|
43 CleanupStack::PushL(self); |
|
44 self->CHCICommandBase::BaseConstructL(); |
|
45 CleanupStack::Pop(self); |
|
46 return self; |
|
47 } |
|
48 |
|
49 EXPORT_C CExitParkModeCommand* CExitParkModeCommand::NewL() |
|
50 { |
|
51 CExitParkModeCommand* self = new (ELeave) CExitParkModeCommand(); |
|
52 CleanupStack::PushL(self); |
|
53 self->CHCICommandBase::BaseConstructL(); |
|
54 CleanupStack::Pop(self); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // Constructors |
|
59 |
|
60 CExitParkModeCommand::CExitParkModeCommand(THCIConnectionHandle aConnectionHandle) |
|
61 : CHCICommandBase(KExitParkModeOpcode) |
|
62 , iConnectionHandle(aConnectionHandle) |
|
63 { |
|
64 SetExpectsCommandCompleteEvent(EFalse); |
|
65 } |
|
66 |
|
67 CExitParkModeCommand::CExitParkModeCommand() |
|
68 : CHCICommandBase(KExitParkModeOpcode) |
|
69 { |
|
70 SetExpectsCommandCompleteEvent(EFalse); |
|
71 } |
|
72 |
|
73 // Destructor |
|
74 CExitParkModeCommand::~CExitParkModeCommand() |
|
75 { |
|
76 |
|
77 } |
|
78 |
|
79 /*virtual*/ void CExitParkModeCommand::Match(const THCIEventBase& aEvent, TBool& aMatchesCmd, TBool& aConcludesCmd, TBool& aContinueMatching) const |
|
80 { |
|
81 if (aEvent.EventCode() == EModeChangeEvent) |
|
82 { |
|
83 TModeChangeEvent& event = TModeChangeEvent::Cast(aEvent); |
|
84 if (event.ConnectionHandle() == ConnectionHandle()) |
|
85 { |
|
86 aMatchesCmd = ETrue; |
|
87 aConcludesCmd = ETrue; |
|
88 aContinueMatching = EFalse; |
|
89 } |
|
90 } |
|
91 // Command Status Event and default Command Complete Event matching |
|
92 // is implemented in the base class. If we haven't matched already |
|
93 // then we should try the default matching. |
|
94 if (!aMatchesCmd) |
|
95 { |
|
96 CHCICommandBase::Match(aEvent, aMatchesCmd, aConcludesCmd, aContinueMatching); |
|
97 } |
|
98 } |
|
99 |
|
100 |
|
101 // Override of pure virtual from CHCICommandBase. This method embodies the knowledge |
|
102 // of how to format the specifics of this command into the HCTL command frame. |
|
103 void CExitParkModeCommand::Format(CHctlCommandFrame& aCommandFrame) const |
|
104 { |
|
105 aCommandFrame.PutConnectionHandle(iConnectionHandle); |
|
106 } |
|
107 |
|
108 // Assign new values to the parameters of this command |
|
109 EXPORT_C void CExitParkModeCommand::Reset(THCIConnectionHandle aConnectionHandle) |
|
110 { |
|
111 iConnectionHandle = aConnectionHandle; |
|
112 } |
|
113 |
|
114 // Accessor methods for the parameters of the command |
|
115 |
|
116 EXPORT_C THCIConnectionHandle CExitParkModeCommand::ConnectionHandle() const |
|
117 { |
|
118 return iConnectionHandle; |
|
119 } |
|
120 |
|
121 |
|
122 |
|
123 // Extension function. Use this to retrieve any extension interfaces from CExitParkModeCommand |
|
124 // or any class from which it derives. |
|
125 /*virtual*/ TInt CExitParkModeCommand::Extension_(TUint aExtensionId, TAny*& aInterface, TAny* aData) |
|
126 { |
|
127 // To add an additional interface implementation specific for this class check the |
|
128 // provided ID and return an appropriate interface. |
|
129 |
|
130 // If a specific interface implementation is not provided - forward the call to the base class. |
|
131 return CHCICommandBase::Extension_(aExtensionId, aInterface, aData); |
|
132 } |
|
133 |