testexecmgmt/ucc/RemoteInterface/inc/CRemoteInterface.h
changeset 0 3da2a79470a7
equal deleted inserted replaced
-1:000000000000 0:3da2a79470a7
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CREMOTEINTERFACE_H__
       
    21 #define __CREMOTEINTERFACE_H__
       
    22 
       
    23 #include <string>
       
    24 #include "MUCCTransport.h"
       
    25 
       
    26 #define MAXCOMMANDLINELEN		1024
       
    27 
       
    28 // Error codes
       
    29 typedef enum {
       
    30 	TRI_SUCCESS,
       
    31 	TRI_ERRINTIALISING,
       
    32 	TRI_ERRSENDING,
       
    33 	TRI_ERRRECV,
       
    34 	TRI_INVALIDREPLY,
       
    35 	TRI_VARNAMETOOLONG,
       
    36 	TRI_VARVALTOOLONG,
       
    37 	TRI_COMMANDLINETOOLONG
       
    38 } TRIError;
       
    39 
       
    40 // Definitions
       
    41 #define CMD_REQ_RUNCOMMAND		6
       
    42 
       
    43 typedef struct {
       
    44 	int iUid;
       
    45 	int iCmdID;
       
    46 	int iDataLen;
       
    47 } TPHeader;
       
    48 
       
    49 typedef struct {
       
    50 	char iCommandLine[MAXCOMMANDLINELEN] ;
       
    51 	int iResult;
       
    52 } TRunCommandRequest;
       
    53 
       
    54 typedef struct {
       
    55 	int iResult;
       
    56 } TRunCommandReply;
       
    57 
       
    58 class CRemoteInterface
       
    59 	{
       
    60 public:
       
    61 	CRemoteInterface( const string &aDestination );
       
    62 	~CRemoteInterface();
       
    63 
       
    64 	void SetupStartService( const string &aServiceName );
       
    65 	void SetupStopService( const string &aServiceName );
       
    66 	void SetupCall( const string &aServiceName, const string &aCall );
       
    67 	void AddParam( const string &aName, const string &aValue );
       
    68 	int Send();
       
    69 
       
    70 private:
       
    71 	void DefaultSetupCall( const string &aServiceName, const string &aMethodID );
       
    72 
       
    73 	MUCCTransport	*iTransport;
       
    74 	bool			iConnected;
       
    75 	string			iDestination;
       
    76 	bool			iIsSetup;
       
    77 	string			iCommandLine;
       
    78 
       
    79 	int				iRand_UID;
       
    80 	double			iRandomSeed;
       
    81 	};
       
    82 
       
    83 #endif // __CREMOTEINTERFACE_H__