This section describes how to run a custom command.
Before you start, you must refer to the CommandList resource file that contains the list of custom commands.
The SSM_START_CUSTOM_COMMAND resource struct provides data to be interpreted by the custom command as arguments. The MSsmCustomCommand interface provides a mechanism to initialise Thread Local Storage (TLS). TLS is used by multiple custom command implementations within a single DLL. This interface provides a mechanism for the plug-in to perform some clean-up before the DLL is unloaded.
Follow the procedure given below to run the custom command:
Create a custom command as shown in the code snippet.
CreateCustomCommand::CreateCustomCommand()
Initialize the custom command as shown in the code snippet.
TInt CreateCustomCommand::Initialize( CSsmCustomCommandEnv* aCmdEnv )
Call the custom command using SSM_START_CUSTOM_COMMAND as shown in the code snippet.
// Valid ESsmWaitForStart struct with data RESOURCE SSM_START_CUSTOM_COMMAND r_command_custom_cmd1 { severity = ECmdCriticalSeverity; execution_behaviour = ESsmWaitForStart; dllname = "tcust_cmd.dll"; ordinal = 1; unload_on_finish = EUnloadImmediately; retries = 3; dll_data = r_command_custom_cmd_good_data; } // Custom command data RESOURCE SSM_COMMAND_CUSTOM_CMD_DATA r_command_custom_cmd_good_data { val1 = '1'; val2 = '2'; val3 = '3'; val4 = '4'; val5 = '5'; }
Run the custom command as shown in the code snippet.
void CreateCustomCommand::Execute( const TDesC8& aParams, TRequestStatus& aRequest )
The custom command is succesfully implemented.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.