testtoolsconn/stat/desktop/source/lib/inc/statcommon.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 
       
    21 #ifndef STATCOMMON_H
       
    22 #define STATCOMMON_H
       
    23 
       
    24 // external definitions
       
    25 #include "stat.h"
       
    26 
       
    27 // current version - edit this for version updates to DLL
       
    28 #define STAT_VERSION_MAJOR "3"
       
    29 #define STAT_VERSION_MINOR "4"
       
    30 #define STAT_VERSION_PATCH "1001"
       
    31 
       
    32 
       
    33 // amount of time a thread sleeps between each processing cycle
       
    34 #define STAT_THREAD_SLEEP_TIME 5
       
    35 
       
    36 #define STAT_INI_NAME _T("stat.ini")
       
    37 
       
    38 
       
    39 #define STAT_WORKINGPATH_VALUE		_T("c:\\apps\\stat\\Work")
       
    40 
       
    41 #define STAT_LOGFILEPATH_VALUE		_T("c:\\apps\\stat\\LogFiles")
       
    42 
       
    43 #define STAT_SCRIPTFILEPATH_VALUE	_T("c:\\apps\\stat\\Scripts")
       
    44 
       
    45 #define STAT_INSTALLPATH_VALUE	_T("c:\\apps\\stat")
       
    46 
       
    47 
       
    48 // STAT Desktop and DLL Tester registry settings
       
    49 #define ST_TEST_KEY						_T("Settings")
       
    50 #define ST_ITERATIONS					_T("Iterations")
       
    51 
       
    52 #define ST_DELAY						_T("Delay")
       
    53 #define ST_DELAY_VALUE					_T("")
       
    54 
       
    55 #define ST_LOGFILE						_T("Logfile")
       
    56 #define ST_CMDFILE						_T("Commandfile")
       
    57 #define ST_RAWCMD						_T("RawCommand")
       
    58 
       
    59 #define ST_FUDGE						_T("FudgeFactor")
       
    60 #define ST_FUDGE_VALUE					_T("0")
       
    61 
       
    62 #define ST_SNAPSHOT						_T("Snapshot")
       
    63 
       
    64 #define ST_REFDIR						_T("RefDir")
       
    65 #define ST_REFDIR_VALUE					_T("")
       
    66 
       
    67 #define ST_ADDRESS						_T("Address")
       
    68 #define ST_RAWCMD						_T("RawCommand")
       
    69 #define ST_LINK							_T("LinkIndex")
       
    70 #define ST_CONNECTIONIDX				_T("ConnectionIndex")
       
    71 #define ST_CONNECTIONDLL				_T("ConnectionDLL")
       
    72 
       
    73 #define ST_CONNECTION					_T("Connection")
       
    74 #define ST_CONNECTION_VALUE				_T("SymbianSerial:COM2")
       
    75 
       
    76 #define ST_PLATFORM						_T("PlatformIndex")
       
    77 #define ST_VERIFYREMOVEIMAGES			_T("VerifyRemoveImages")
       
    78 
       
    79 #define ST_VERIFYIMAGE					_T("VerifyImage")
       
    80 #define ST_VERIFYIMAGE_VALUE			0
       
    81 
       
    82 #define ST_LOGTOFILE					_T("LogToFile")
       
    83 #define ST_LOGTOFILE_VALUE				0
       
    84 
       
    85 
       
    86 #define ST_SCRIPT						_T("Script")
       
    87 #define ST_SCRIPT_VALUE					_T("<b><s><e>")
       
    88 
       
    89 #define ST_CUST_LOGFILE					_T("CustomLogFile")
       
    90 #define ST_CUST_LOGFILE_VALUE			_T("")
       
    91 
       
    92 #define ST_APPEND						_T("Append")
       
    93 #define ST_APPEND_VALUE					0
       
    94 
       
    95 #define ST_CHKRAWCMD					_T("ChkRawCmd")
       
    96 #define ST_CHKCMDFILE					_T("ChkCmdFile")
       
    97 #define ST_CHKVERIF						_T("ChkVerif")
       
    98 #define ST_CHKSNAP						_T("ChkSnap")
       
    99 #define ST_CHKLOGTOFILE					_T("ChkLogtofile")
       
   100 
       
   101 #define ST_WORKINGPATH					_T("WorkingPath")
       
   102 #define ST_WORKINGPATH_VALUE			_T("c:\\apps\\stat\\Work")
       
   103 
       
   104 #define ST_LOGFILEPATH					_T("LogFilePath")
       
   105 #define ST_LOGFILEPATH_VALUE			_T("c:\\apps\\stat\\LogFiles")
       
   106 
       
   107 #define ST_SCRIPTFILEPATH				_T("ScriptFilePath")
       
   108 #define ST_SCRIPTFILEPATH_VALUE			_T("c:\\apps\\stat\\Scripts")
       
   109 
       
   110 #define ST_INSTALLPATH				_T("InstallPath")
       
   111 #define ST_INSTALLPATH_VALUE			_T("c:\\apps\\stat")
       
   112 
       
   113 // STAT Service registry settings
       
   114 #define ST_CONTROLLER_LIST				_T("Controllers")
       
   115 #define ST_CONNECTION_LIST				_T("Connections")
       
   116 #define ST_TRANSPORT_TYPE				_T("ServiceTransport")
       
   117 #define ST_TRANSPORT_PORT				_T("ServicePort")
       
   118 #define ST_SCRIPTLOCATION				_T("ScriptLocation")
       
   119 #define ST_LOGLOCATION					_T("LogLocation")
       
   120 
       
   121 // STAT Service command types
       
   122 typedef enum STATCommandType
       
   123 {
       
   124 	SymbianScript		= 1,
       
   125 	SymbianError		= 2,
       
   126 	SymbianDeviceInfo	= 3,
       
   127 	SymbianServiceLogs	= 4
       
   128 } STATCOMMANDTYPE;
       
   129 
       
   130 // default socket communication ports
       
   131 #define ST_DEFAULTDEVICEPORT			3000
       
   132 #define ST_DEFAULTSERVICEPORT			3001
       
   133 #define ST_MAX_CONNECTION_COUNT			25
       
   134 
       
   135 // script execution states
       
   136 typedef enum StatState
       
   137 {
       
   138 	STAT_RUN,
       
   139 	STAT_PAUSE,
       
   140 	STAT_STOP
       
   141 } STAT_STATE;
       
   142 
       
   143 #define STAT_APPNAME		"STAT DLL"
       
   144 #define STAT_SERVICENAME	"STAT Service"
       
   145 
       
   146 //not used
       
   147 // logging defaults
       
   148 //#define STAT_APPNAME	"STAT DLL"
       
   149 //#define STAT_LOGDIR		"C:\\"
       
   150 //#define STAT_LOGFILE	"stat_output.log"
       
   151 
       
   152 // debug file returned from remote device
       
   153 //#define STAT_DEBUGFILE	"C:\\stat_debug.log"
       
   154 
       
   155 #define MAX_LOG_MSG_LEN		1024
       
   156 #define MAX_ERROR_MSG_LEN	256
       
   157 
       
   158 #ifdef UNICODE
       
   159 #define MAX_UNICODE_LEN		2048
       
   160 #endif
       
   161 
       
   162 // communications
       
   163 typedef struct STATCommand
       
   164 {
       
   165 	unsigned long cIdentifier;	// used as 'char' but 'unsigned long' to cater for word boundaries
       
   166 //	char cIdentifier;
       
   167 	unsigned long ulLength;
       
   168 } STATCOMMAND;
       
   169 
       
   170 // special command identifiers
       
   171 #define STAT_FAILURE		'*'
       
   172 #define STAT_RESYNCID		'?'
       
   173 #define STAT_REFRESH		'Q'
       
   174 #define STAT_BEGIN			'B'
       
   175 #define STAT_END			'E'
       
   176 #define STAT_REBOOT			'|'
       
   177 
       
   178 
       
   179 // size of data transmissions
       
   180 // This is moved to a header file common to desktop 
       
   181 // and device side code.
       
   182 
       
   183 // timeouts on no data
       
   184 #define STAT_MAXTIME		240000	// max time to process a command
       
   185 #define STAT_RETRYDELAY		330		// delay between checking the port when no data
       
   186 
       
   187 // timeouts on transmission errors
       
   188 #define STAT_MAX_ERRORLEN	1024	// max length of error text
       
   189 #define STAT_MAXERRORS		7		// max errors allowed in a single command
       
   190 
       
   191 // old #defines used in connect transport
       
   192 #define STAT_ERRORDELAY		3000	// delay on an error
       
   193 #define STAT_MAXRETRIES		10		// max retries on error
       
   194 
       
   195 #endif