|
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 #include "uloggerconfig.h" |
|
17 |
|
18 |
|
19 CClearConfig::~CClearConfig() |
|
20 { |
|
21 /*Destructor*/ |
|
22 } |
|
23 |
|
24 CClearConfig::CClearConfig() |
|
25 { |
|
26 /*Constructor*/ |
|
27 } |
|
28 |
|
29 void CClearConfig::Clear(RULogger& aLoggerSession) |
|
30 { |
|
31 aLoggerSession.Stop(); |
|
32 aLoggerSession.DeActivateInputPlugin(); |
|
33 CArrayPtrFlat<HBufC8> *allplugins = new (ELeave)CArrayPtrFlat<HBufC8>(1); |
|
34 //loggerSession.InstalledOutputPlugins(*allplugins); |
|
35 |
|
36 aLoggerSession.GetInstalledOutputPlugins(*allplugins); |
|
37 for(TInt i=0;i<(allplugins->Count());i++) |
|
38 if(allplugins->Count()) |
|
39 { |
|
40 TBuf8<50> dataBuf; |
|
41 dataBuf.Copy(allplugins->At(i)->Des()); |
|
42 aLoggerSession.RemovePluginConfigurations(dataBuf); |
|
43 } |
|
44 CArrayFixFlat<TUint8> *getfilter = new (ELeave)CArrayFixFlat<TUint8>(1); |
|
45 |
|
46 aLoggerSession.GetPrimaryFiltersEnabled(*getfilter); |
|
47 |
|
48 TInt Result = aLoggerSession.SetPrimaryFiltersEnabled(*getfilter, EFalse); |
|
49 RArray<TUint32> get2filter; |
|
50 aLoggerSession.GetSecondaryFiltersEnabled(get2filter); |
|
51 aLoggerSession.SetSecondaryFiltersEnabled(get2filter, EFalse); |
|
52 //-- aLoggerSession. EnableClassificationFiltering(); MF - this is the default |
|
53 aLoggerSession.SetSecondaryFilteringEnabled(ETrue); |
|
54 aLoggerSession.SetBufferSize(1024); |
|
55 aLoggerSession.SetNotificationSize(512); |
|
56 aLoggerSession.SetBufferMode(1);// MF previously EStraight; |
|
57 |
|
58 } |
|
59 |
|
60 //NB: currently this method does not set the default values for serial and usb! hanging the server |
|
61 void CClearConfig::Default(RULogger& aLoggerSession) |
|
62 { |
|
63 Clear(aLoggerSession); |
|
64 //Now set default configurations shipped with ulogger |
|
65 |
|
66 CArrayFixFlat<TUint8>* array = new(ELeave) CArrayFixFlat<TUint8>(4); |
|
67 CleanupStack::PushL(array); |
|
68 array->AppendL(3); |
|
69 array->AppendL(13); |
|
70 //set Classification filter |
|
71 aLoggerSession.SetPrimaryFiltersEnabled(*array, ETrue); |
|
72 CleanupStack::PopAndDestroy(array); |
|
73 |
|
74 //set file plugin |
|
75 _LIT8(KTextmedia,"uloggerfileplugin"); |
|
76 const TPtrC8 mediaPtr(KTextmedia); |
|
77 _LIT(KTextsetting, "output_path"); |
|
78 _LIT(KTextvalue, "c:\\logs\\utracedata.utf"); |
|
79 TPluginConfiguration pluginConfig; |
|
80 pluginConfig.SetKey(KTextsetting); |
|
81 pluginConfig.SetValue(KTextvalue); |
|
82 aLoggerSession.SetPluginConfigurations(mediaPtr,pluginConfig); |
|
83 |
|
84 //set serial plugin |
|
85 |
|
86 _LIT8(KSerialTextmedia,"uloggerserialplugin"); |
|
87 const TPtrC8 serialMediaPtr(KSerialTextmedia); |
|
88 _LIT(KSerialTextsetting, "output_port"); |
|
89 _LIT(KSerialTextvalue, "3"); |
|
90 TPluginConfiguration serialPluginConfig; |
|
91 serialPluginConfig.SetKey(KSerialTextsetting); |
|
92 serialPluginConfig.SetValue(KSerialTextvalue); |
|
93 aLoggerSession.SetPluginConfigurations(serialMediaPtr,serialPluginConfig); |
|
94 |
|
95 //activate file plugin as active |
|
96 aLoggerSession.ActivateOutputPlugin(mediaPtr); |
|
97 |
|
98 } |
|
99 |