|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Internal definitions file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SENSRVDEFINES_H |
|
20 #define SENSRVDEFINES_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "sensrvtrace.h" |
|
24 |
|
25 /** |
|
26 * Sensor server process name |
|
27 */ |
|
28 _LIT(KSensrvProcessName, "!SensorServer"); |
|
29 |
|
30 /** |
|
31 * Sensor server main thread name |
|
32 */ |
|
33 _LIT(KSensrvMainThreadName, "SensrvMain"); |
|
34 |
|
35 /** |
|
36 * SSY thread name prefix. A number is appended to this. |
|
37 */ |
|
38 _LIT(KSensrvSsyThreadNameBase, "Ssy@"); |
|
39 |
|
40 /** |
|
41 * Length of the KSensrvSsyThreadNameBase _LIT |
|
42 */ |
|
43 const TInt KSensrvSsyThreadNameBaseLen(4); |
|
44 |
|
45 /** |
|
46 * SSY Thread name maxlength |
|
47 */ |
|
48 const TInt KSensrvSsyThreadNameMaxLen(16); |
|
49 |
|
50 /** |
|
51 * Sensor server executable name |
|
52 */ |
|
53 _LIT( KSensrvExeName, "sensorserver.exe" ); |
|
54 |
|
55 /** |
|
56 * Drive identifier of the drive where sensor server executable is. |
|
57 */ |
|
58 _LIT( KSensrvExeDrive, "z:" ); |
|
59 |
|
60 /** |
|
61 * Panic category |
|
62 */ |
|
63 _LIT( KSensrvPanicCategory, "SensorServer" ); |
|
64 |
|
65 /** |
|
66 * Number of times sensor server client should try reconneting if session is not found. |
|
67 */ |
|
68 const TInt KSensrvClientTryCount(2); |
|
69 |
|
70 /** |
|
71 * Major version number |
|
72 */ |
|
73 const TInt KSensrvVersionMajor(1); |
|
74 |
|
75 /** |
|
76 * Minor version number |
|
77 */ |
|
78 const TInt KSensrvVersionMinor(0); |
|
79 |
|
80 /** |
|
81 * Build number |
|
82 */ |
|
83 const TInt KSensrvVersionBuild(0); |
|
84 |
|
85 /** |
|
86 * Priority for server's active objects |
|
87 */ |
|
88 const TInt KSensrvCActivePriority(CActive::EPriorityHigh); |
|
89 |
|
90 /** |
|
91 * Async message slots to be used in client server comms. |
|
92 * - Data listener |
|
93 * - Condition listener |
|
94 * - Property listener |
|
95 * - New channel listener? |
|
96 */ |
|
97 const TInt KSensrvDefaultAsyncSlots(4); |
|
98 |
|
99 /** |
|
100 * Separate TInt needed or DLL's won't compile because of static data if UID is used in some policy lit |
|
101 */ |
|
102 const TInt KSensrvUid2Int(0x1020507E); |
|
103 |
|
104 /** |
|
105 * Sensor server UID |
|
106 */ |
|
107 const TUid KSensrvUid2 = { KSensrvUid2Int }; |
|
108 |
|
109 /** |
|
110 * Millisecond to microsecond multiplier |
|
111 */ |
|
112 const TInt KMillisToMicros(1000); |
|
113 |
|
114 /** |
|
115 * Second to microsecond multiplier |
|
116 */ |
|
117 const TInt KSecondsToMicros(1000000); |
|
118 |
|
119 /** |
|
120 * Default timeout of transactions, in microseconds |
|
121 */ |
|
122 const TInt KSensrvDefaultTransactionTimeout(60000000); |
|
123 |
|
124 /** |
|
125 * SID of the test framework. This is the only process that |
|
126 * is allowed to shutdown the sensor server. |
|
127 */ |
|
128 const TUint32 KSensrvTestFrameworkUid(0x102073E4); |
|
129 |
|
130 /** |
|
131 * Default data rate multiplier. |
|
132 * CSensrvChannel.iMaxBufferingCount is set to channel data rate |
|
133 * times multiplier divided by KSensrvDataBufferLengthMultiplier. |
|
134 */ |
|
135 const TInt KSensrvDefaultDataRateMultiplier(5); |
|
136 |
|
137 /** |
|
138 * Buffer length multiplier. |
|
139 * Buffer lenght is set to CSensrvChannel.iMaxBufferingCount times this. |
|
140 * For practical reason, buffering count should always be less than half of buffer size, as |
|
141 * otherwise getting new block will invalidate some of the just written block. |
|
142 * To allow some wiggle-room for possible client delays, minimum practical value for this is 3. |
|
143 */ |
|
144 const TInt KSensrvDataBufferLengthMultiplier(4); |
|
145 |
|
146 /** |
|
147 * CSensrvChannel.iMaxBufferingCount will be set to this if it cannot be |
|
148 * calculated. |
|
149 */ |
|
150 const TInt KSensrvDefaultMaxBufferingCount(64); |
|
151 |
|
152 /** |
|
153 * Buffer length must be at least this much. |
|
154 */ |
|
155 const TInt KSensrvMinimumBufferLength(3); |
|
156 |
|
157 /** |
|
158 * Minimum buffering count for clients and SSY |
|
159 */ |
|
160 const TInt KSensrvMinimumBufferingCount(1); |
|
161 |
|
162 /** |
|
163 * Minumum acceptable buffering period in milliseconds. |
|
164 * For practical reasons 1/64th of second is the effective |
|
165 * minimum anyway, as that is the limit of normal timer resolution. |
|
166 */ |
|
167 const TInt KSensrvMinimumBufferingPeriod(15); |
|
168 |
|
169 /** |
|
170 * Maximum allowed buffering period in milliseconds |
|
171 */ |
|
172 const TInt KSensrvMaximumBufferingPeriod(30*60*1000); // 30 minutes |
|
173 |
|
174 /** |
|
175 * Default SSY stack size |
|
176 */ |
|
177 const TInt KSensrvDefaultSsyStackSize(4096); |
|
178 |
|
179 /** |
|
180 * Default SSY heap max size |
|
181 */ |
|
182 const TInt KSensrvDefaultSsyHeapMaxSize(65535); |
|
183 |
|
184 /** |
|
185 * SSY heap initial size |
|
186 */ |
|
187 const TInt KSensrvSsyHeapInitialSize(4096); |
|
188 |
|
189 /** |
|
190 * SSY thread graceful cleanup time, microseconds |
|
191 */ |
|
192 const TInt KSensrvSsyGracefulCleanupTime(15000000); |
|
193 |
|
194 /** |
|
195 * SSY thread inactivity period befor unloading, microseconds |
|
196 */ |
|
197 const TInt KSensrvSsyInactivityPeriod(60000000); |
|
198 |
|
199 /** |
|
200 * Maximum count of conditions with same index in a set |
|
201 */ |
|
202 const TInt KSensrvMaxConditionIndexCount(2); |
|
203 |
|
204 /** |
|
205 * Ecom rescan timer period, also used for proxy deletion |
|
206 */ |
|
207 const TInt KSensrvEcomRescanTimerPeriod(1000000); |
|
208 |
|
209 |
|
210 /** |
|
211 * Sensor server panic codes |
|
212 */ |
|
213 enum TSensrvPanic |
|
214 { |
|
215 // Run error panics |
|
216 ESensrvPanicMediatorRunError = 0, |
|
217 ESensrvPanicThreadMonitorRunError = 1, |
|
218 ESensrvPanicEcomChangeRunError = 3, |
|
219 |
|
220 // State panics |
|
221 ESensrvPanicInvalidPluginState = 10, |
|
222 ESensrvPanicInvalidChannelState = 11, |
|
223 ESensrvPanicInvalidTransactionState = 12, |
|
224 |
|
225 // Misc panics |
|
226 ESensrvPanicUnknownTransactionType = 20, |
|
227 ESensrvPanicWrongProxy = 21, |
|
228 ESensrvPanicSsyControlExists = 22, |
|
229 ESensrvPanicUnexpectedSsyCallback = 23, |
|
230 ESensrvPanicOutOfBounds = 24, |
|
231 ESensrvPanicPreviousBlockNotYetWritten = 25, |
|
232 ESensrvPanicRequestedFreeBlockTooSmall = 26, |
|
233 ESensrvPanicDuplicateListener = 27, |
|
234 ESensrvPanicBufferTooSmall = 28, |
|
235 ESensrvPanicInvalidRemoveType = 29, |
|
236 ESensrvPanicInvalidFunction = 30, |
|
237 ESensrvPanicUnexpectedBranch = 31, |
|
238 ESensrvPanicInvalidDataSize = 32, |
|
239 |
|
240 // NULL panics |
|
241 ESensrvPanicNullServerMediator = 100, |
|
242 ESensrvPanicNullSsyMediator = 101, |
|
243 ESensrvPanicNullSsyControl = 102, |
|
244 ESensrvPanicNullChannel = 103, |
|
245 ESensrvPanicNullTransaction = 104, |
|
246 ESensrvPanicNullProxy = 105, |
|
247 ESensrvPanicNullMutex = 106, |
|
248 ESensrvPanicNullMessage = 107, |
|
249 ESensrvPanicNullSession = 108, |
|
250 ESensrvPanicNullProvider = 109, |
|
251 ESensrvPanicNullListener = 110, |
|
252 ESensrvPanicNullBuffer = 111, |
|
253 ESensrvPanicNullCallback = 112, |
|
254 ESensrvPanicNullScheduler = 113, |
|
255 ESensrvPanicNullMetData = 114, |
|
256 ESensrvPanicNullEvaluator = 115, |
|
257 ESensrvPanicNullImplInfos = 116 |
|
258 }; |
|
259 |
|
260 #endif // SENSRVDEFINES_H |