0
|
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 |
* Filename: UCCS_Interfaces.h
|
|
16 |
* Service interfaces
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef __UCCSINTERFACES_H__
|
|
23 |
#define __UCCSINTERFACES_H__
|
|
24 |
|
|
25 |
|
|
26 |
/*************************************************************************************
|
|
27 |
*
|
|
28 |
* Local Includes
|
|
29 |
*
|
|
30 |
************************************************************************************/
|
|
31 |
#include "UCCS_CDataRecord.h"
|
|
32 |
#include "../DeviceControlChannel/CommandControlErrors.h"
|
|
33 |
|
|
34 |
|
|
35 |
/*************************************************************************************
|
|
36 |
*
|
|
37 |
* IRetrieveCommand - interface on the command retriever called by the batch engine
|
|
38 |
*
|
|
39 |
************************************************************************************/
|
|
40 |
class IRetrieveCommand
|
|
41 |
{
|
|
42 |
public:
|
|
43 |
virtual int StartUseCase( int aUsecaseID ) = 0;
|
|
44 |
virtual int EndUseCase() = 0;
|
|
45 |
virtual int GetNextCommand( char *aBuffer, int aLength ) = 0;
|
|
46 |
};
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
/*************************************************************************************
|
|
51 |
*
|
|
52 |
* IOutput - interface on the output object called by everyone
|
|
53 |
*
|
|
54 |
************************************************************************************/
|
|
55 |
typedef enum {
|
|
56 |
UC_INVALID,
|
|
57 |
UC_QUIT,
|
|
58 |
UC_RUNCMD,
|
|
59 |
UC_ASSIGN,
|
|
60 |
UC_WAITFOR,
|
|
61 |
UC_WAITFORSIGNAL,
|
|
62 |
UC_RENDEZVOUS,
|
|
63 |
UC_REQUIRE,
|
|
64 |
UC_REQUIRENOT,
|
|
65 |
UC_CHECK,
|
|
66 |
UC_CHECKNOT,
|
|
67 |
UC_PRINTENVIRONMENT,
|
|
68 |
UC_WAITFORNOT,
|
|
69 |
UC_SIGNAL,
|
|
70 |
} TUccsCommand;
|
|
71 |
|
|
72 |
|
|
73 |
class IOutput
|
|
74 |
{
|
|
75 |
public:
|
|
76 |
virtual void StartUsecase( int aID ) = 0;
|
|
77 |
virtual void EndUsecase( int aID, int aResult ) = 0;
|
|
78 |
virtual void Error( int aErrorCode, char *aErrorString ) = 0;
|
|
79 |
virtual void CompletedScript() = 0;
|
|
80 |
|
|
81 |
virtual void ExecuteCommand( TUccsCommand aCommand, CDataRecord *aArgs ) = 0;
|
|
82 |
virtual void ExecuteCommandResult( int aUccsErrorcode ) = 0;
|
|
83 |
virtual void ExecuteCommandReply( CDataRecord *aReply ) = 0;
|
|
84 |
|
|
85 |
virtual void DisplayHelp() = 0;
|
|
86 |
virtual void DisplayLastCommand( CDataRecord *aCommand ) = 0;
|
|
87 |
virtual void DisplayLastReply( CDataRecord *aResult ) = 0;
|
|
88 |
virtual void DisplayEnvironment( CDataRecord *aEnvironment ) = 0;
|
|
89 |
|
|
90 |
virtual void ExecuteString( char *aCommandLine ) = 0;
|
|
91 |
virtual void ExecuteStringResult( int aUccsErrorcode ) = 0;
|
|
92 |
|
|
93 |
virtual void StartServiceResult( int aServiceID, char *aServiceHost, int aStubReturnCode, int aErrorCode, int aUnused ) = 0;
|
|
94 |
virtual void StopServiceResult( int aServiceID, char *aServiceHost, int aStubReturnCode, int aErrorCode, int aUnused ) = 0;
|
|
95 |
};
|
|
96 |
|
|
97 |
|
|
98 |
/*************************************************************************************
|
|
99 |
*
|
|
100 |
* IPort - interface on the transport port called by the remote control
|
|
101 |
*
|
|
102 |
************************************************************************************/
|
|
103 |
class IPort
|
|
104 |
{
|
|
105 |
public:
|
|
106 |
virtual int OpenPort( char *aComPort ) = 0;
|
|
107 |
virtual void ClosePort() = 0;
|
|
108 |
virtual int ReceiveBytes( char *aBuff, int *aLength ) = 0;
|
|
109 |
virtual int SendBytes( char *aBuff, int *aLength ) = 0;
|
|
110 |
};
|
|
111 |
|
|
112 |
|
|
113 |
/*************************************************************************************
|
|
114 |
*
|
|
115 |
* IRemoteControl - interface on the remote control input guy called by the creator
|
|
116 |
* and the batch engine
|
|
117 |
*
|
|
118 |
************************************************************************************/
|
|
119 |
typedef enum {
|
|
120 |
RCI_NONE,
|
|
121 |
RCI_SERIAL,
|
|
122 |
RCI_SERVERSOCKET,
|
|
123 |
RCI_CONSOLE,
|
|
124 |
RCI_TCP
|
|
125 |
} TRemoteControlTransport;
|
|
126 |
|
|
127 |
class IRemoteControl
|
|
128 |
{
|
|
129 |
public:
|
|
130 |
virtual TCommandControlError Start( TRemoteControlTransport aTransport, char* aPortname, int *aErrorCode, int *aScriptError ) = 0;
|
|
131 |
};
|
|
132 |
|
|
133 |
|
|
134 |
/*************************************************************************************
|
|
135 |
*
|
|
136 |
* IService - interface on the service stubs called by the service manager
|
|
137 |
*
|
|
138 |
************************************************************************************/
|
|
139 |
class IService
|
|
140 |
{
|
|
141 |
|
|
142 |
public:
|
|
143 |
virtual int StartUccsService( char *aHostName, int *aLocalError, int *aRemoteError ) = 0;
|
|
144 |
virtual int StopUccsService( int *aLocalerror, int *aRemoteError ) = 0;
|
|
145 |
virtual CDataRecord* IssueCommand(CDataRecord* aCommand) = 0; //return result of the actual command
|
|
146 |
virtual int GetStatus() = 0;
|
|
147 |
//virtual int RegisterObserver(aNotify) = 0;
|
|
148 |
};
|
|
149 |
|
|
150 |
|
|
151 |
/*************************************************************************************
|
|
152 |
*
|
|
153 |
* MUccsControl - interface on the batch engine called by the remote controller
|
|
154 |
*
|
|
155 |
************************************************************************************/
|
|
156 |
class MUccsControl
|
|
157 |
{
|
|
158 |
public:
|
|
159 |
virtual int StartUsecase( int aUsecaseID ) = 0;
|
|
160 |
virtual int Signal( int aUsecaseID ) = 0;
|
|
161 |
virtual int Rendezvous( int aUseCaseID ) = 0;
|
|
162 |
virtual int Wait( int aUseCaseID ) = 0;
|
|
163 |
virtual int EndUsecase( int aUsecaseID, int aResult, int *aScriptResult ) = 0;
|
|
164 |
virtual int GetEnvVariable( char *aVariableName, char *aOutputBuffer, int aOutputBufferLen ) = 0;
|
|
165 |
virtual int RunCommand( char* aCommandLine ) = 0;
|
|
166 |
};
|
|
167 |
|
|
168 |
|
|
169 |
#endif __UCCSINTERFACES_H__
|