1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/traceservices/tracefw/ulogger/inc/uloggercommands.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,207 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// ULogger commands
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @internalTechnology
1.24 + @prototype
1.25 +*/
1.26 +
1.27 +#ifndef ULOGGERCOMMANDS_H_
1.28 +#define ULOGGERCOMMANDS_H_
1.29 +
1.30 +#include <e32base.h>
1.31 +
1.32 +/** Ulogger command line syntax description.
1.33 +ULogger is used to configure and enable/disable logging of trace data on device.
1.34 +
1.35 +SYNOPSIS: ulogger [-rqtvhioH][-edl <config_options>...][-fsSoicbmn]...
1.36 +
1.37 +DESCRIPTION:
1.38 +ULogger groups the commands into execution and configuration commands
1.39 +where options -rqtvhH belong to the former group and -edlbnmfsSoic to the latter.
1.40 +Execution commands: -rqtvhioH, require no other arguments.
1.41 +Configuration commands are further divided into:
1.42 + -edl, these require one of the following options '-fsSoic'
1.43 + to be present, these will fail if too many or missing options are given.
1.44 + -fsSoicbmn, these will apply the arguments depending on provided option -edl.
1.45 +
1.46 +OPTIONS
1.47 +Execution commands:
1.48 +-r Start logging (Run)
1.49 +-q Stop logging (Quit)
1.50 +-t Restart (restarT) while logging, to update configurations
1.51 +-v Verbose mode, will list all results, or silent mode is
1.52 + assumed and only error codes will be returned
1.53 +-h List of options.
1.54 +-o List active output plugin.
1.55 +-i List active input plugin.
1.56 +-H This man page.
1.57 +-? The version of this tool and most usefull commands.
1.58 +
1.59 +Configuration commands:
1.60 +-e <-fsSoicbmn options> ... Enable/set either of option -fsSoicbmn
1.61 +-d <-fsSoic options> ... Disable/delete either of option -fsSoic
1.62 +-l <-fsSoicbmn options> ... List either of option -fsSoicbmn
1.63 +-f [<filter> ...] Enable/disable/list primary filter 0-255
1.64 +-s [<filter> ...] Enable/disable/list secondary filter 0-4294967295
1.65 +-S Enable/disable/list secondary filtering.
1.66 + Enable to filter on secondary filters,
1.67 + Disable to log all traces irrespective of secondary filter.
1.68 + By default filtering is enabled.
1.69 +-o [<filename>] Enable/disable an output plugin, list all output plugins
1.70 +-i [<filename>] Enable/disable an input plugin, list all input plugins
1.71 +-c [<filename> <config> ...] Enable(set)/delete/list plugin configurations.
1.72 + First argument must be the name of the configuration
1.73 + to be changed and any following arguments are treated as values of
1.74 + this configuration. The configuration keyword can not use any white
1.75 + characters (e.g. space or tabulation key).
1.76 +-b [<size> ...] Buffer size, 1-1024 Kb rounded up to nearest page size, 4Kb.
1.77 +-n [<size> ...] Notification size, 0-1024 Kb rounded up to nearest page size, 4Kb.
1.78 +-m [<mode> ...] Buffer mode, 'circular' or 'straight'. Default is straight.
1.79 + */
1.80 +
1.81 +
1.82 +//ulogger commands
1.83 +_LIT(KCmdEnable, "e");
1.84 +_LIT(KCmdDisable, "d");
1.85 +_LIT(KCmdList, "l");
1.86 +_LIT(KCmdPrimaryFilter, "f");
1.87 +_LIT(KCmdSecondaryFilter, "s");
1.88 +_LIT(KCmdSecondaryFilterToggle, "S");
1.89 +_LIT(KCmdOutputPlugin, "o");
1.90 +_LIT(KCmdInputPlugin, "i");
1.91 +_LIT(KCmdPluginConfigurations, "c");
1.92 +_LIT(KCmdBuffer, "b");
1.93 +_LIT(KCmdNotification, "n");
1.94 +_LIT(KCmdBufferMode, "m");
1.95 +_LIT(KCmdVerboseMode, "v");
1.96 +_LIT(KCmdStart, "r");
1.97 +_LIT(KCmdStop, "q");
1.98 +_LIT(KCmdRestart, "t");
1.99 +_LIT(KCmdHelp, "h");
1.100 +_LIT(KCmdMan, "H");
1.101 +_LIT(KCmdVersion, "?");
1.102 +_LIT(KCmdIndicator, "-");
1.103 +_LIT(KCmdAll, "all");
1.104 +_LIT(KCmdBufferModeCircular, "circular");
1.105 +_LIT(KCmdBufferModeStraight, "straight");
1.106 +
1.107 +
1.108 +/**
1.109 +@internalTechnology
1.110 +@prototype
1.111 +*/
1.112 +enum TCommand
1.113 + {
1.114 + EUnknown = 0,
1.115 + ERunAsService, // function not yet implemented in server!
1.116 + EDontRunAsService, // function not yet implemented in server!
1.117 + EStart,
1.118 + EStop,
1.119 + ERestart,
1.120 + ESetPrimaryFilter,
1.121 + EGetPrimaryFilters,
1.122 + ERemovePrimaryFilter,
1.123 + ESetSecondaryFilter,
1.124 + EGetSecondaryFilters,
1.125 + ERemoveSecondaryFilter,
1.126 + EGetSecondaryFiltering,
1.127 + EEnableSecondaryFiltering,
1.128 + EDisableSecondaryFiltering,
1.129 + ESetActivePlugin,
1.130 + EGetActivePlugin,
1.131 + EGetInstalledPlugins,
1.132 + ESetActiveInputPlugin,
1.133 + EGetActiveInputPlugin,
1.134 + EDeactivateInputPlugin,
1.135 + EGetInputPlugins,
1.136 + ESetPluginSettings,
1.137 + EGetPluginSettings,
1.138 + ERemovePluginSettings,
1.139 + EResizeTraceBuffer,
1.140 + EGetTraceBufferSize,
1.141 + ESetDataNotificationSize,
1.142 + EGetDataNotificationSize,
1.143 + ESetBufferMode,
1.144 + EGetBufferMode,
1.145 + EHelp,
1.146 + EManPage,
1.147 + EVersion
1.148 + };
1.149 +
1.150 +/**
1.151 +@internalTechnology
1.152 +@prototype
1.153 + */
1.154 +class TCommandLookup
1.155 + {
1.156 + public:
1.157 + TCommandLookup(const TDesC* aMainCommand, const TDesC* aSubCommand, const TCommand aCommand)
1.158 + : iMainCommand(aMainCommand), iSubCommand(aSubCommand), iCommand(aCommand)
1.159 + {}
1.160 +
1.161 + //data
1.162 + const TDesC* iMainCommand;
1.163 + const TDesC* iSubCommand;
1.164 + TCommand iCommand;
1.165 + };
1.166 +
1.167 +
1.168 +/**
1.169 +Interface to execute command.
1.170 +
1.171 +@internalTechnology
1.172 +@prototype
1.173 + */
1.174 +class MCommandImpl
1.175 + {
1.176 + public:
1.177 + virtual TInt DoCommandL(TCommand aCommand, const RArray<TPtrC>& aValues) = 0;
1.178 + };
1.179 +
1.180 +
1.181 +/**
1.182 +This is a utility class to parse command line arguments and to generate accurate event
1.183 +to execute required command.
1.184 +To use this class properly, MCommandImpl interface must be implemented and pointer to it
1.185 +must be passed during object construction.
1.186 +
1.187 +@internalTechnology
1.188 +@prototype
1.189 + */
1.190 +class CCommand : public CBase
1.191 + {
1.192 + public:
1.193 + IMPORT_C static CCommand* NewL(MCommandImpl* aCommandImpl);
1.194 + IMPORT_C static CCommand* NewLC(MCommandImpl* aCommandImpl);
1.195 + IMPORT_C ~CCommand();
1.196 + IMPORT_C void ConstructL();
1.197 + IMPORT_C TInt HandleCommandL(const RArray<TPtrC>& aArgs);
1.198 +
1.199 +
1.200 + private:
1.201 + CCommand(MCommandImpl* aCommandImpl);
1.202 + TInt PrepareCommandL(RArray<TPtrC>& aArgs);
1.203 +
1.204 + //data
1.205 + MCommandImpl* iCommandImpl;
1.206 + TBool iVerbose;
1.207 + RArray<TCommandLookup> iCommandsLookup;
1.208 + };
1.209 +
1.210 +#endif /*ULOGGERCOMMANDS_H_*/