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