|
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:52 (time stamp) |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include <bluetooth/hci/periodicinquirymodecommand.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 |
|
30 |
|
31 #ifdef __FLOG_ACTIVE |
|
32 _LIT8(KLogComponent, LOG_COMPONENT_COMMANDSEVENTS_SYMBIAN); |
|
33 #endif |
|
34 |
|
35 |
|
36 |
|
37 // Factory methods |
|
38 |
|
39 EXPORT_C CPeriodicInquiryModeCommand* CPeriodicInquiryModeCommand::NewL(TUint16 aMaxPeriodLength, TUint16 aMinPeriodLength, TUint32 aLAP, TUint8 aInquiryLength, TUint8 aNumResponses) |
|
40 { |
|
41 CPeriodicInquiryModeCommand* self = new (ELeave) CPeriodicInquiryModeCommand(aMaxPeriodLength, aMinPeriodLength, aLAP, aInquiryLength, aNumResponses); |
|
42 CleanupStack::PushL(self); |
|
43 self->CHCICommandBase::BaseConstructL(); |
|
44 CleanupStack::Pop(self); |
|
45 return self; |
|
46 } |
|
47 |
|
48 EXPORT_C CPeriodicInquiryModeCommand* CPeriodicInquiryModeCommand::NewL() |
|
49 { |
|
50 CPeriodicInquiryModeCommand* self = new (ELeave) CPeriodicInquiryModeCommand(); |
|
51 CleanupStack::PushL(self); |
|
52 self->CHCICommandBase::BaseConstructL(); |
|
53 CleanupStack::Pop(self); |
|
54 return self; |
|
55 } |
|
56 |
|
57 // Constructors |
|
58 |
|
59 CPeriodicInquiryModeCommand::CPeriodicInquiryModeCommand(TUint16 aMaxPeriodLength, TUint16 aMinPeriodLength, TUint32 aLAP, TUint8 aInquiryLength, TUint8 aNumResponses) |
|
60 : CHCICommandBase(KPeriodicInquiryModeOpcode) |
|
61 , iMaxPeriodLength(aMaxPeriodLength) |
|
62 , iMinPeriodLength(aMinPeriodLength) |
|
63 , iLAP(aLAP) |
|
64 , iInquiryLength(aInquiryLength) |
|
65 , iNumResponses(aNumResponses) |
|
66 { |
|
67 SetExpectsCommandStatusEvent(EFalse); |
|
68 } |
|
69 |
|
70 CPeriodicInquiryModeCommand::CPeriodicInquiryModeCommand() |
|
71 : CHCICommandBase(KPeriodicInquiryModeOpcode) |
|
72 { |
|
73 SetExpectsCommandStatusEvent(EFalse); |
|
74 } |
|
75 |
|
76 // Destructor |
|
77 CPeriodicInquiryModeCommand::~CPeriodicInquiryModeCommand() |
|
78 { |
|
79 |
|
80 } |
|
81 |
|
82 |
|
83 |
|
84 // Override of pure virtual from CHCICommandBase. This method embodies the knowledge |
|
85 // of how to format the specifics of this command into the HCTL command frame. |
|
86 void CPeriodicInquiryModeCommand::Format(CHctlCommandFrame& aCommandFrame) const |
|
87 { |
|
88 aCommandFrame.PutBytes16(iMaxPeriodLength); |
|
89 aCommandFrame.PutBytes16(iMinPeriodLength); |
|
90 aCommandFrame.PutBytes32(iLAP, 3); |
|
91 aCommandFrame.PutByte(iInquiryLength); |
|
92 aCommandFrame.PutByte(iNumResponses); |
|
93 } |
|
94 |
|
95 // Assign new values to the parameters of this command |
|
96 EXPORT_C void CPeriodicInquiryModeCommand::Reset(TUint16 aMaxPeriodLength, TUint16 aMinPeriodLength, TUint32 aLAP, TUint8 aInquiryLength, TUint8 aNumResponses) |
|
97 { |
|
98 iMaxPeriodLength = aMaxPeriodLength; |
|
99 iMinPeriodLength = aMinPeriodLength; |
|
100 iLAP = aLAP; |
|
101 iInquiryLength = aInquiryLength; |
|
102 iNumResponses = aNumResponses; |
|
103 } |
|
104 |
|
105 // Accessor methods for the parameters of the command |
|
106 |
|
107 EXPORT_C TUint16 CPeriodicInquiryModeCommand::MaxPeriodLength() const |
|
108 { |
|
109 return iMaxPeriodLength; |
|
110 } |
|
111 |
|
112 EXPORT_C TUint16 CPeriodicInquiryModeCommand::MinPeriodLength() const |
|
113 { |
|
114 return iMinPeriodLength; |
|
115 } |
|
116 |
|
117 EXPORT_C TUint32 CPeriodicInquiryModeCommand::LAP() const |
|
118 { |
|
119 return iLAP; |
|
120 } |
|
121 |
|
122 EXPORT_C TUint8 CPeriodicInquiryModeCommand::InquiryLength() const |
|
123 { |
|
124 return iInquiryLength; |
|
125 } |
|
126 |
|
127 EXPORT_C TUint8 CPeriodicInquiryModeCommand::NumResponses() const |
|
128 { |
|
129 return iNumResponses; |
|
130 } |
|
131 |
|
132 |
|
133 |
|
134 // Extension function. Use this to retrieve any extension interfaces from CPeriodicInquiryModeCommand |
|
135 // or any class from which it derives. |
|
136 /*virtual*/ TInt CPeriodicInquiryModeCommand::Extension_(TUint aExtensionId, TAny*& aInterface, TAny* aData) |
|
137 { |
|
138 // To add an additional interface implementation specific for this class check the |
|
139 // provided ID and return an appropriate interface. |
|
140 |
|
141 // If a specific interface implementation is not provided - forward the call to the base class. |
|
142 return CHCICommandBase::Extension_(aExtensionId, aInterface, aData); |
|
143 } |
|
144 |