|
1 // Copyright (c) 1997-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 // Comms debug utility (File and Serial logger) Client side internals header |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 */ |
|
22 |
|
23 #ifndef __COMSDBGSTD_H__ |
|
24 #define __COMSDBGSTD_H__ |
|
25 |
|
26 #include "comsdbgsvr.h" |
|
27 #include "comsdbgaux.h" |
|
28 |
|
29 |
|
30 const TInt KFLogSrvMajorVersionNumber=2; |
|
31 const TInt KFLogSrvMinorVersionNumber=0; |
|
32 const TInt KFLogSrvBuildVersionNumber=0; |
|
33 const TBool KLoggingOnOffDefault = ETrue; ///< Needed to tie together default setting in the client and server. |
|
34 const TText KFullStopChar='.'; |
|
35 const TText8 KFullStopChar8='.'; |
|
36 |
|
37 _LIT(KFLoggerServerName,"!Comsdbg server"); ///< Identifier to symbian OS server system. |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 /** |
|
43 * Message types that are passed from client to server. |
|
44 * |
|
45 */ |
|
46 enum TFileLoggerOperations |
|
47 { |
|
48 EStaticWriteToLog, |
|
49 EWriteToLog, |
|
50 ESetLogTag, |
|
51 EClearLog, |
|
52 EWriteBinary, |
|
53 EShutDownServer, |
|
54 ESetHeapFailure |
|
55 }; |
|
56 |
|
57 |
|
58 /** |
|
59 * FlogOverflow16 - class to quietly handle descriptor overflows |
|
60 * |
|
61 * This class overrides the "Overflow" function in the |
|
62 * TDes16's own overflow class. The overflow function is |
|
63 * designed to quietly ignore any overflow which occurs when |
|
64 * copying/appending strings, thus |
|
65 * enabling flogger to implicitly truncate the |
|
66 * logging strings where necessary. |
|
67 */ |
|
68 class TFlogOverflow16 : public TDes16Overflow |
|
69 { |
|
70 public: |
|
71 void Overflow(TDes16& /*aDes*/) { } |
|
72 }; |
|
73 |
|
74 |
|
75 /** |
|
76 * FlogOverflow8 - class to quietly handle descriptor overflows |
|
77 * |
|
78 * This class overrides the "Overflow" function in the |
|
79 * TDes8's own overflow class. The overflow function is |
|
80 * designed to quietly ignore any overflow which occurs when |
|
81 * copying/appending strings, thus |
|
82 * enabling flogger to implicitly truncate the |
|
83 * logging strings where necessary. |
|
84 */ |
|
85 class TFlogOverflow8 : public TDes8Overflow |
|
86 { |
|
87 public: |
|
88 void Overflow(TDes8& /*aDes*/) { } |
|
89 }; |
|
90 |
|
91 /** |
|
92 * RFileLoggerBody - class to provide all internal data for the client side |
|
93 * |
|
94 * This class contains all data members which would otherwise be in the |
|
95 * RFileLogger class. They are instead in this file since that keeps the |
|
96 * size of RFileLogger to a minimum, and also means its size will not |
|
97 * change very often. |
|
98 * By keeping the RFileLogger class size to a minimum, it means in release |
|
99 * builds where no logging is to be included, only a skeleton of the |
|
100 * RFileLogger is built into each component, numbering a handful of bytes. |
|
101 */ |
|
102 class RFileLoggerBody : public RSessionBase |
|
103 { |
|
104 public: |
|
105 RFileLoggerBody(); |
|
106 |
|
107 // CreateSession is a protected member of RSessionBase, so we must derive from |
|
108 // it and provide a means to call this via pass-through inline functions. |
|
109 // In a normal client-server situation RFileLogger itself would derive from |
|
110 // RSessionBase. |
|
111 inline TInt DoCreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots); |
|
112 inline TInt DoSendReceive(TInt aFunction,const TIpcArgs& aArgs) const; |
|
113 inline TInt DoSendReceive(TInt aFunction) const; |
|
114 inline void Close(); |
|
115 |
|
116 public: |
|
117 // we have no access methods to access these so they are public instead. |
|
118 TPckgBuf<TBool> iLoggingOnPckg; |
|
119 TFlogOverflow16 iFlogOverflow16; |
|
120 TFlogOverflow8 iFlogOverflow8; |
|
121 }; |
|
122 |
|
123 /** |
|
124 FLogger - flogger server process startup class |
|
125 This class contains functions to start the flogger server. |
|
126 @internalComponent |
|
127 */ |
|
128 class FLogger |
|
129 { |
|
130 public: |
|
131 class TSignal; |
|
132 public: |
|
133 IMPORT_C static TInt Start(); |
|
134 IMPORT_C static TInt Run(); |
|
135 private: |
|
136 static TInt Init(); |
|
137 }; |
|
138 |
|
139 /** |
|
140 @removed Stub export for flogger.dll now that flogsvrl.dll contains the FLogger::Run() |
|
141 @internalComponent |
|
142 */ |
|
143 IMPORT_C void ClientRunStubOrdinal1(); |
|
144 |
|
145 #include "comsdbg.inl" |
|
146 |
|
147 |
|
148 #endif // __COMSDBGSTD_H__ |