williamr@4: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: // All rights reserved. williamr@4: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@4: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: // williamr@4: // Initial Contributors: williamr@4: // Nokia Corporation - initial contribution. williamr@4: // williamr@4: // Contributors: williamr@4: // williamr@4: // Description: williamr@4: // ULogger commands williamr@4: // williamr@4: // williamr@4: williamr@4: /** williamr@4: @file williamr@4: @internalTechnology williamr@4: @prototype williamr@4: */ williamr@4: williamr@4: #ifndef ULOGGERCOMMANDS_H_ williamr@4: #define ULOGGERCOMMANDS_H_ williamr@4: williamr@4: #include williamr@4: williamr@4: /** Ulogger command line syntax description. williamr@4: ULogger is used to configure and enable/disable logging of trace data on device. williamr@4: williamr@4: SYNOPSIS: ulogger [-rqtvhioH][-edl ...][-fsSoicbmn]... williamr@4: williamr@4: DESCRIPTION: williamr@4: ULogger groups the commands into execution and configuration commands williamr@4: where options -rqtvhH belong to the former group and -edlbnmfsSoic to the latter. williamr@4: Execution commands: -rqtvhioH, require no other arguments. williamr@4: Configuration commands are further divided into: williamr@4: -edl, these require one of the following options '-fsSoic' williamr@4: to be present, these will fail if too many or missing options are given. williamr@4: -fsSoicbmn, these will apply the arguments depending on provided option -edl. williamr@4: williamr@4: OPTIONS williamr@4: Execution commands: williamr@4: -r Start logging (Run) williamr@4: -q Stop logging (Quit) williamr@4: -t Restart (restarT) while logging, to update configurations williamr@4: -v Verbose mode, will list all results, or silent mode is williamr@4: assumed and only error codes will be returned williamr@4: -h List of options. williamr@4: -o List active output plugin. williamr@4: -i List active input plugin. williamr@4: -H This man page. williamr@4: -? The version of this tool and most usefull commands. williamr@4: williamr@4: Configuration commands: williamr@4: -e <-fsSoicbmn options> ... Enable/set either of option -fsSoicbmn williamr@4: -d <-fsSoic options> ... Disable/delete either of option -fsSoic williamr@4: -l <-fsSoicbmn options> ... List either of option -fsSoicbmn williamr@4: -f [ ...] Enable/disable/list primary filter 0-255 williamr@4: -s [ ...] Enable/disable/list secondary filter 0-4294967295 williamr@4: -S Enable/disable/list secondary filtering. williamr@4: Enable to filter on secondary filters, williamr@4: Disable to log all traces irrespective of secondary filter. williamr@4: By default filtering is enabled. williamr@4: -o [] Enable/disable an output plugin, list all output plugins williamr@4: -i [] Enable/disable an input plugin, list all input plugins williamr@4: -c [ ...] Enable(set)/delete/list plugin configurations. williamr@4: First argument must be the name of the configuration williamr@4: to be changed and any following arguments are treated as values of williamr@4: this configuration. The configuration keyword can not use any white williamr@4: characters (e.g. space or tabulation key). williamr@4: -b [ ...] Buffer size, 1-1024 Kb rounded up to nearest page size, 4Kb. williamr@4: -n [ ...] Notification size, 0-1024 Kb rounded up to nearest page size, 4Kb. williamr@4: -m [ ...] Buffer mode, 'circular' or 'straight'. Default is straight. williamr@4: */ williamr@4: williamr@4: williamr@4: //ulogger commands williamr@4: _LIT(KCmdEnable, "e"); williamr@4: _LIT(KCmdDisable, "d"); williamr@4: _LIT(KCmdList, "l"); williamr@4: _LIT(KCmdPrimaryFilter, "f"); williamr@4: _LIT(KCmdSecondaryFilter, "s"); williamr@4: _LIT(KCmdSecondaryFilterToggle, "S"); williamr@4: _LIT(KCmdOutputPlugin, "o"); williamr@4: _LIT(KCmdInputPlugin, "i"); williamr@4: _LIT(KCmdPluginConfigurations, "c"); williamr@4: _LIT(KCmdBuffer, "b"); williamr@4: _LIT(KCmdNotification, "n"); williamr@4: _LIT(KCmdBufferMode, "m"); williamr@4: _LIT(KCmdVerboseMode, "v"); williamr@4: _LIT(KCmdStart, "r"); williamr@4: _LIT(KCmdStop, "q"); williamr@4: _LIT(KCmdRestart, "t"); williamr@4: _LIT(KCmdHelp, "h"); williamr@4: _LIT(KCmdMan, "H"); williamr@4: _LIT(KCmdVersion, "?"); williamr@4: _LIT(KCmdIndicator, "-"); williamr@4: _LIT(KCmdAll, "all"); williamr@4: _LIT(KCmdBufferModeCircular, "circular"); williamr@4: _LIT(KCmdBufferModeStraight, "straight"); williamr@4: williamr@4: williamr@4: /** williamr@4: @internalTechnology williamr@4: @prototype williamr@4: */ williamr@4: enum TCommand williamr@4: { williamr@4: EUnknown = 0, williamr@4: ERunAsService, // function not yet implemented in server! williamr@4: EDontRunAsService, // function not yet implemented in server! williamr@4: EStart, williamr@4: EStop, williamr@4: ERestart, williamr@4: ESetPrimaryFilter, williamr@4: EGetPrimaryFilters, williamr@4: ERemovePrimaryFilter, williamr@4: ESetSecondaryFilter, williamr@4: EGetSecondaryFilters, williamr@4: ERemoveSecondaryFilter, williamr@4: EGetSecondaryFiltering, williamr@4: EEnableSecondaryFiltering, williamr@4: EDisableSecondaryFiltering, williamr@4: ESetActivePlugin, williamr@4: EGetActivePlugin, williamr@4: EGetInstalledPlugins, williamr@4: ESetActiveInputPlugin, williamr@4: EGetActiveInputPlugin, williamr@4: EDeactivateInputPlugin, williamr@4: EGetInputPlugins, williamr@4: ESetPluginSettings, williamr@4: EGetPluginSettings, williamr@4: ERemovePluginSettings, williamr@4: EResizeTraceBuffer, williamr@4: EGetTraceBufferSize, williamr@4: ESetDataNotificationSize, williamr@4: EGetDataNotificationSize, williamr@4: ESetBufferMode, williamr@4: EGetBufferMode, williamr@4: EHelp, williamr@4: EManPage, williamr@4: EVersion williamr@4: }; williamr@4: williamr@4: /** williamr@4: @internalTechnology williamr@4: @prototype williamr@4: */ williamr@4: class TCommandLookup williamr@4: { williamr@4: public: williamr@4: TCommandLookup(const TDesC* aMainCommand, const TDesC* aSubCommand, const TCommand aCommand) williamr@4: : iMainCommand(aMainCommand), iSubCommand(aSubCommand), iCommand(aCommand) williamr@4: {} williamr@4: williamr@4: //data williamr@4: const TDesC* iMainCommand; williamr@4: const TDesC* iSubCommand; williamr@4: TCommand iCommand; williamr@4: }; williamr@4: williamr@4: williamr@4: /** williamr@4: Interface to execute command. williamr@4: williamr@4: @internalTechnology williamr@4: @prototype williamr@4: */ williamr@4: class MCommandImpl williamr@4: { williamr@4: public: williamr@4: virtual TInt DoCommandL(TCommand aCommand, const RArray& aValues) = 0; williamr@4: }; williamr@4: williamr@4: williamr@4: /** williamr@4: This is a utility class to parse command line arguments and to generate accurate event williamr@4: to execute required command. williamr@4: To use this class properly, MCommandImpl interface must be implemented and pointer to it williamr@4: must be passed during object construction. williamr@4: williamr@4: @internalTechnology williamr@4: @prototype williamr@4: */ williamr@4: class CCommand : public CBase williamr@4: { williamr@4: public: williamr@4: IMPORT_C static CCommand* NewL(MCommandImpl* aCommandImpl); williamr@4: IMPORT_C static CCommand* NewLC(MCommandImpl* aCommandImpl); williamr@4: IMPORT_C ~CCommand(); williamr@4: IMPORT_C void ConstructL(); williamr@4: IMPORT_C TInt HandleCommandL(const RArray& aArgs); williamr@4: williamr@4: williamr@4: private: williamr@4: CCommand(MCommandImpl* aCommandImpl); williamr@4: TInt PrepareCommandL(RArray& aArgs); williamr@4: williamr@4: //data williamr@4: MCommandImpl* iCommandImpl; williamr@4: TBool iVerbose; williamr@4: RArray iCommandsLookup; williamr@4: }; williamr@4: williamr@4: #endif /*ULOGGERCOMMANDS_H_*/