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