|
1 /* |
|
2 * Copyright (c) 2004 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: Common constant definitions for Watcher |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __WATCHERCONSTANTS_H__ |
|
19 #define __WATCHERCONSTANTS_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 |
|
24 /// Watcher log name |
|
25 _LIT( KTcLogName, "TestClientWatcher.log" ); |
|
26 #define LOG_NAME_DEFINED |
|
27 |
|
28 /** |
|
29 * Unique name for the server used as: |
|
30 * - server name |
|
31 * - server executable file name (+.exe) |
|
32 * - server thread name on WINS |
|
33 * - server semaphore name |
|
34 */ |
|
35 _LIT( KTcWatcherName, "WatcherServ" ); |
|
36 |
|
37 /** |
|
38 * The server version. A version must be specifyed when creating |
|
39 * a session with the server. It is used to verify that the |
|
40 * client dll is compatible with the server. Doesn't matter |
|
41 * much in our case. |
|
42 */ |
|
43 const TUint KTcWatcherMajorVersion = 1; |
|
44 const TUint KTcWatcherMinorVersion = 0; |
|
45 const TUint KTcWatcherBuildVersion = 0; |
|
46 |
|
47 /// Opcodes used in message passing between client and server. |
|
48 /// Used to identify functions in the server sessions. |
|
49 enum TTcWatcherRequest |
|
50 { |
|
51 /// Client-server framework opcodes |
|
52 ECloseSession, |
|
53 EConfigAndStart, |
|
54 EPing |
|
55 }; |
|
56 |
|
57 /// Number of message slots (1 read, 1 write, 1 cancel, 1 spare) |
|
58 /// As recommended by Symbian. |
|
59 const TUint KTcWatcherMessageSlots( 4 ); |
|
60 |
|
61 /// Time to wait before trying to restart |
|
62 /// a dying server in RTcWatcher::StartServer() |
|
63 const TInt KTcServerDyingTime( 100000 ); |
|
64 |
|
65 // Shut down server after 10 seconds have elapsed since last client disconnect |
|
66 const TInt KTcShutdownTime( 10000000 ); |
|
67 |
|
68 /// One second as microseconds |
|
69 const TInt KSecondAsMicroseconds( 1000000 ); |
|
70 |
|
71 #ifdef __WINS__ |
|
72 /// Default heap size for the server thread on WINS = 16Kb |
|
73 const TUint KTcDefaultHeapSize( 0x4000 ); |
|
74 /// Maximum heap size for the server thread on WINS = 1Mb |
|
75 const TUint KTcMaxHeapSize( 0x100000 ); |
|
76 #endif |
|
77 |
|
78 /** |
|
79 * Global function for PANICing the server |
|
80 * |
|
81 * @param aPanic Panic code |
|
82 */ |
|
83 void PanicServer( TInt aPanic ); |
|
84 |
|
85 #endif // __WATCHERCONSTANTS_H__ |