1 /* |
|
2 * Copyright (c) 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: Observer for socket router for test purposes. |
|
15 * This is currently the only way to get the parsed frame back to |
|
16 * the unit test class. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef MSOCKETROUTERTESTOBSERVER_H |
|
23 #define MSOCKETROUTERTESTOBSERVER_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32def.h> |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CSocket; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Observer for socket router. |
|
36 */ |
|
37 NONSHARABLE_CLASS( MSocketRouterTestObserver ) |
|
38 { |
|
39 public: // Abstract functions |
|
40 |
|
41 /** |
|
42 * Starting point of a frame has been found. |
|
43 */ |
|
44 virtual void FrameStarted() = 0; |
|
45 |
|
46 /** |
|
47 * Forwards the parsed frame info to the observer |
|
48 */ |
|
49 virtual void FrameParsedL( |
|
50 TUint aPort, |
|
51 const TDesC8& aData ) = 0; |
|
52 |
|
53 /** |
|
54 * Error occurred when parsing data. |
|
55 * @param aErrorCode Error code. |
|
56 * @param aReceivedData Whole frame that failed to be parsed. |
|
57 */ |
|
58 virtual void ProtocolErrorL( |
|
59 TInt aErrorCode, |
|
60 const TDesC8& aReceivedData ) = 0; |
|
61 |
|
62 /** |
|
63 * Open a TCP connection to phone side port |
|
64 * @param aPort Port number where to connect |
|
65 */ |
|
66 virtual void OpenLocalTCPConnectionL( TUint aPort ) = 0; |
|
67 |
|
68 /** |
|
69 * Close a TCP connection to phone side port |
|
70 * @param aPort Port number to close |
|
71 */ |
|
72 virtual void CloseTCPConnection( TUint aPort ) = 0; |
|
73 |
|
74 }; |
|
75 |
|
76 #endif // MSOCKETROUTERTESTOBSERVER_H |
|
77 |
|
78 // End of File |
|