|
1 // Copyright (c) 2007-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 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file te_uloggerostv2integsuite_defs.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 |
|
23 #include <e32cons.h> |
|
24 #include <e32def.h> |
|
25 #include "te_ostv2integsuite_defs.h" |
|
26 |
|
27 //C.A. previously:using namespace UTF; |
|
28 using namespace Ulogger; //CA:added so can use old ulogger api |
|
29 CClearConfig::~CClearConfig() |
|
30 { |
|
31 /*Destructor*/ |
|
32 } |
|
33 |
|
34 CClearConfig::CClearConfig() |
|
35 { |
|
36 /*Constructor*/ |
|
37 } |
|
38 |
|
39 void CClearConfig::Clear(RULogger& loggerSession) |
|
40 { |
|
41 loggerSession.Stop();//C.A. previously:loggerSession.StopOutputting(); |
|
42 loggerSession.DeActivateInputPlugin(); |
|
43 CArrayPtrFlat<HBufC8> *allplugins = new (ELeave)CArrayPtrFlat<HBufC8>(1); |
|
44 loggerSession.GetInstalledOutputPlugins(*allplugins);//C.A. previously:loggerSession.InstalledOutputPlugins(*allplugins); |
|
45 for(TInt i=0;i<(allplugins->Count());i++) |
|
46 if(allplugins->Count()) |
|
47 { |
|
48 TBuf8<50> dataBuf; |
|
49 dataBuf.Copy(allplugins->At(i)->Des()); |
|
50 loggerSession.RemovePluginConfigurations(dataBuf); |
|
51 } |
|
52 CArrayFixFlat<TUint8> *getfilter = new (ELeave)CArrayFixFlat<TUint8>(1); |
|
53 loggerSession.GetPrimaryFiltersEnabled(*getfilter);//C.A. previously:loggerSession.GetEnabledClassifications(*getfilter); |
|
54 TInt Result=loggerSession.SetPrimaryFiltersEnabled(*getfilter,EFalse);//C.A. previously:TInt Result=loggerSession.DisableClassifications(*getfilter); |
|
55 RArray<TUint32> get2filter; |
|
56 loggerSession.GetSecondaryFiltersEnabled(get2filter);//C.A. previously:loggerSession.GetEnabledModuleUids(get2filter); |
|
57 loggerSession.SetSecondaryFiltersEnabled(get2filter,EFalse);//C.A. previously:loggerSession.DisableModuleUids(get2filter); |
|
58 //C.A. previously:loggerSession.EnableClassificationFiltering(); |
|
59 loggerSession.SetSecondaryFilteringEnabled(ETrue);//C.A. previously:loggerSession.EnableModuleUidFiltering(); |
|
60 loggerSession.SetBufferSize(1024); |
|
61 loggerSession.SetNotificationSize(512); |
|
62 loggerSession.SetBufferMode(1);//C.A. previously:loggerSession.SetBufferMode(EStraight); |
|
63 } |
|
64 |
|
65 //NB: currently this method does not set the default values for serial and usb! hanging the server |
|
66 void CClearConfig::Default(RULogger& loggerSession) |
|
67 { |
|
68 Clear(loggerSession); |
|
69 //Now set default configurations shipped with ulogger |
|
70 CArrayFixFlat<TUint8> *setfilter=new (ELeave)CArrayFixFlat<TUint8>(1);//CA:added so can use old ulogger api |
|
71 setfilter->AppendL(3);//CA:added so can use old ulogger api |
|
72 //setfilter->AppendL(13);//reintroduce this filter when pick up uloggerv2 - needed for SWAP analysis |
|
73 //set Classification filter |
|
74 loggerSession.SetPrimaryFiltersEnabled(*setfilter,ETrue);//CA:added so can use old ulogger api |
|
75 //C.A. previously:loggerSession.EnableClassification(3); |
|
76 //C.A. previously:loggerSession.EnableClassification(13); |
|
77 |
|
78 //set file plugin |
|
79 _LIT8(KTextmedia,"uloggerfileplugin"); |
|
80 const TPtrC8 mediaPtr(KTextmedia); |
|
81 _LIT(KTextsetting, "output_path"); |
|
82 _LIT(KTextvalue, "c:\\logs\\utracedata.utf"); |
|
83 TPluginConfiguration pluginConfig; |
|
84 pluginConfig.SetKey(KTextsetting); |
|
85 pluginConfig.SetValue(KTextvalue); |
|
86 loggerSession.SetPluginConfigurations(mediaPtr,pluginConfig); |
|
87 |
|
88 //set serial plugin |
|
89 |
|
90 _LIT8(KSerialTextmedia,"uloggerserialplugin"); |
|
91 const TPtrC8 serialMediaPtr(KSerialTextmedia); |
|
92 _LIT(KSerialTextsetting, "output_port"); |
|
93 _LIT(KSerialTextvalue, "3"); |
|
94 TPluginConfiguration serialPluginConfig; |
|
95 serialPluginConfig.SetKey(KSerialTextsetting); |
|
96 serialPluginConfig.SetValue(KSerialTextvalue); |
|
97 loggerSession.SetPluginConfigurations(serialMediaPtr,serialPluginConfig); |
|
98 |
|
99 //set usb plugin |
|
100 //add into TCl code >>TclDefault class/method |
|
101 |
|
102 /* this needs to be implemented |
|
103 * -->usb plugin not available on the MCL |
|
104 * either implement another version of this for MCL |
|
105 * or change MCL version of the config file |
|
106 * _LIT8(KUsbTextmedia,"uloggerusbplugin"); |
|
107 * const TPtrC8 usbMediaPtr(KUsbTextmedia); |
|
108 * _LIT(KUsbTextsetting, "mode"); |
|
109 * _LIT(KUsbTextvalue, "raw"); |
|
110 * TPluginConfiguration usbPluginConfig; |
|
111 * pluginConfig.SetKey(KUsbTextsetting); |
|
112 * pluginConfig.SetValue(KUsbTextvalue); |
|
113 * loggerSession.SetPluginConfigurations(usbMediaPtr,usbPluginConfig); |
|
114 */ |
|
115 |
|
116 |
|
117 //activate file plugin as active |
|
118 loggerSession.ActivateOutputPlugin(mediaPtr);//C.A. previously:loggerSession.SetActiveOutputPlugin(mediaPtr); |
|
119 |
|
120 } |