|
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 * CConsolePort |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CCONSOLEPORT_H__ |
|
22 #define __CCONSOLEPORT_H__ |
|
23 |
|
24 /********************************************************************* |
|
25 * |
|
26 * Definitions |
|
27 * |
|
28 ********************************************************************/ |
|
29 #define MAXLINESIZE 1024 |
|
30 |
|
31 /************************************************************************************* |
|
32 * |
|
33 * Local Includes |
|
34 * |
|
35 ************************************************************************************/ |
|
36 #include <windows.h> |
|
37 #include "CProtocolTypes.h" |
|
38 #include "../Core/UCCS_Interfaces.h" |
|
39 |
|
40 #define E8DataLen 8 |
|
41 #define E4DataLen 4 |
|
42 |
|
43 /************************************************************************************* |
|
44 * |
|
45 * CNetworkPort Definition |
|
46 * |
|
47 ************************************************************************************/ |
|
48 class CConsolePort : public IPort |
|
49 { |
|
50 public: |
|
51 CConsolePort(); |
|
52 ~CConsolePort(); |
|
53 |
|
54 int OpenPort( char *port ); |
|
55 void ClosePort(); |
|
56 int ReceiveBytes( char *aBuff, int *aLength ); |
|
57 int SendBytes( char *aBuff, int *aLength ); |
|
58 |
|
59 private: |
|
60 int ParseNextLine( int *uid ); |
|
61 int GetTPCommand( int aCommandID, TPCommand* aTPCommand ); |
|
62 int ReadHeader( char* aBuff, int *aSize); |
|
63 int ReadData( char* aBuff, int *aSize); |
|
64 |
|
65 int iReadingData; |
|
66 int iUcid; // Member variable to reocrd the last usecase id read on the commandline |
|
67 int iCommand; // Member varaible to record the last command read on the commandline |
|
68 char iCommandLine[MAXLINESIZE]; |
|
69 |
|
70 }; |
|
71 |
|
72 #endif //__CCONSOLEPORT_H__ |