|
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/rejectsynchronousconnectionrequestcommand.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/synchronousconnectioncompleteevent.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 CRejectSynchronousConnectionRequestCommand* CRejectSynchronousConnectionRequestCommand::NewL(const TBTDevAddr& aBDADDR, TUint8 aReason) |
|
41 { |
|
42 CRejectSynchronousConnectionRequestCommand* self = new (ELeave) CRejectSynchronousConnectionRequestCommand(aBDADDR, aReason); |
|
43 CleanupStack::PushL(self); |
|
44 self->CHCICommandBase::BaseConstructL(); |
|
45 CleanupStack::Pop(self); |
|
46 return self; |
|
47 } |
|
48 |
|
49 EXPORT_C CRejectSynchronousConnectionRequestCommand* CRejectSynchronousConnectionRequestCommand::NewL() |
|
50 { |
|
51 CRejectSynchronousConnectionRequestCommand* self = new (ELeave) CRejectSynchronousConnectionRequestCommand(); |
|
52 CleanupStack::PushL(self); |
|
53 self->CHCICommandBase::BaseConstructL(); |
|
54 CleanupStack::Pop(self); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // Constructors |
|
59 |
|
60 CRejectSynchronousConnectionRequestCommand::CRejectSynchronousConnectionRequestCommand(const TBTDevAddr& aBDADDR, TUint8 aReason) |
|
61 : CHCICommandBase(KRejectSynchronousConnectionRequestOpcode) |
|
62 , iBDADDR(aBDADDR) |
|
63 , iReason(aReason) |
|
64 { |
|
65 SetExpectsCommandCompleteEvent(EFalse); |
|
66 } |
|
67 |
|
68 CRejectSynchronousConnectionRequestCommand::CRejectSynchronousConnectionRequestCommand() |
|
69 : CHCICommandBase(KRejectSynchronousConnectionRequestOpcode) |
|
70 { |
|
71 SetExpectsCommandCompleteEvent(EFalse); |
|
72 } |
|
73 |
|
74 // Destructor |
|
75 CRejectSynchronousConnectionRequestCommand::~CRejectSynchronousConnectionRequestCommand() |
|
76 { |
|
77 |
|
78 } |
|
79 |
|
80 /*virtual*/ void CRejectSynchronousConnectionRequestCommand::Match(const THCIEventBase& aEvent, TBool& aMatchesCmd, TBool& aConcludesCmd, TBool& aContinueMatching) const |
|
81 { |
|
82 if (aEvent.EventCode() == ESynchronousConnectionCompleteEvent) |
|
83 { |
|
84 TSynchronousConnectionCompleteEvent& event = TSynchronousConnectionCompleteEvent::Cast(aEvent); |
|
85 if (event.BDADDR() == BDADDR()) |
|
86 { |
|
87 aMatchesCmd = ETrue; |
|
88 aConcludesCmd = ETrue; |
|
89 aContinueMatching = EFalse; |
|
90 } |
|
91 } |
|
92 // Command Status Event and default Command Complete Event matching |
|
93 // is implemented in the base class. If we haven't matched already |
|
94 // then we should try the default matching. |
|
95 if (!aMatchesCmd) |
|
96 { |
|
97 CHCICommandBase::Match(aEvent, aMatchesCmd, aConcludesCmd, aContinueMatching); |
|
98 } |
|
99 } |
|
100 |
|
101 |
|
102 // Override of pure virtual from CHCICommandBase. This method embodies the knowledge |
|
103 // of how to format the specifics of this command into the HCTL command frame. |
|
104 void CRejectSynchronousConnectionRequestCommand::Format(CHctlCommandFrame& aCommandFrame) const |
|
105 { |
|
106 aCommandFrame.PutDevAddr(iBDADDR); |
|
107 aCommandFrame.PutByte(iReason); |
|
108 } |
|
109 |
|
110 // Assign new values to the parameters of this command |
|
111 EXPORT_C void CRejectSynchronousConnectionRequestCommand::Reset(const TBTDevAddr& aBDADDR, TUint8 aReason) |
|
112 { |
|
113 iBDADDR = aBDADDR; |
|
114 iReason = aReason; |
|
115 } |
|
116 |
|
117 // Accessor methods for the parameters of the command |
|
118 |
|
119 EXPORT_C TBTDevAddr CRejectSynchronousConnectionRequestCommand::BDADDR() const |
|
120 { |
|
121 return iBDADDR; |
|
122 } |
|
123 |
|
124 EXPORT_C TUint8 CRejectSynchronousConnectionRequestCommand::Reason() const |
|
125 { |
|
126 return iReason; |
|
127 } |
|
128 |
|
129 |
|
130 |
|
131 // Extension function. Use this to retrieve any extension interfaces from CRejectSynchronousConnectionRequestCommand |
|
132 // or any class from which it derives. |
|
133 /*virtual*/ TInt CRejectSynchronousConnectionRequestCommand::Extension_(TUint aExtensionId, TAny*& aInterface, TAny* aData) |
|
134 { |
|
135 // To add an additional interface implementation specific for this class check the |
|
136 // provided ID and return an appropriate interface. |
|
137 |
|
138 // If a specific interface implementation is not provided - forward the call to the base class. |
|
139 return CHCICommandBase::Extension_(aExtensionId, aInterface, aData); |
|
140 } |
|
141 |