|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __RDbgTrcComm_h__ |
|
19 #define __RDbgTrcComm_h__ |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 |
|
24 // User includes |
|
25 #include "ostprotdefs.h" |
|
26 |
|
27 #define SafeDelete(x) { if (x) delete x; x = NULL; } |
|
28 |
|
29 |
|
30 /** |
|
31 Enumeration of baud rates in bits per second for ACM port configuration. |
|
32 * e.g EBaud1152000 is for 115200Bps data rate |
|
33 */ |
|
34 enum TBaudRates |
|
35 { |
|
36 EBaud50, |
|
37 EBaud75, |
|
38 EBaud110, |
|
39 EBaud134, |
|
40 EBaud150, |
|
41 EBaud300, |
|
42 EBaud600, |
|
43 EBaud1200, |
|
44 EBaud1800, |
|
45 EBaud2000, |
|
46 EBaud2400, |
|
47 EBaud3600, |
|
48 EBaud4800, |
|
49 EBaud7200, |
|
50 EBaud9600, |
|
51 EBaud19200, |
|
52 EBaud38400, |
|
53 EBaud57600, |
|
54 EBaud115200, |
|
55 EBaud230400, |
|
56 EBaud460800, |
|
57 EBaud576000, |
|
58 EBaud1152000, |
|
59 EBaud4000000, |
|
60 EBaud921600, |
|
61 EBaudAutobaud=0x40000000, |
|
62 EBaudSpecial=0x80000000, |
|
63 }; |
|
64 |
|
65 class TAcmConfigV01 |
|
66 { |
|
67 public: |
|
68 TUint iPortNumber; // port number for ACM port is always 1 with S60 devices, atleast when using the PC Suite drivers. |
|
69 TBaudRates iBaudRate; |
|
70 }; |
|
71 typedef TPckgBuf< TAcmConfigV01> TAcmConfig; |
|
72 |
|
73 |
|
74 // Classes referenced |
|
75 |
|
76 //The client-side interface to the dbg trc comms server. |
|
77 class RDbgTrcComm : public RSessionBase |
|
78 { |
|
79 // CONNECT TO SERVER & VERSIONING |
|
80 public: |
|
81 IMPORT_C RDbgTrcComm(); |
|
82 IMPORT_C TInt Connect(); |
|
83 IMPORT_C TInt Disconnect(); |
|
84 IMPORT_C TVersion Version() const; |
|
85 |
|
86 // CMD SPECIFIC FUNCTIONALITY |
|
87 public: |
|
88 IMPORT_C TInt GetAcmConfig(TDes8& aConfig); |
|
89 IMPORT_C TInt SetAcmConfig(TDesC8& aConfig); |
|
90 |
|
91 IMPORT_C TInt Open(); |
|
92 IMPORT_C TInt Close(); |
|
93 IMPORT_C TInt RegisterProtocolID(const TOstProtIds aId, TBool aNeedHeader); |
|
94 IMPORT_C TInt RegisterProtocolIDs(const TOstProtIds* aIds, const TUint aNumberofIds, TBool aNeedHeader); |
|
95 IMPORT_C TInt UnRegisterProtocolID(const TOstProtIds aId); |
|
96 IMPORT_C TInt UnRegisterProtocolIDs(const TOstProtIds* aIds, const TUint aNumberofIds); |
|
97 |
|
98 IMPORT_C void ReadMessage(TRequestStatus& aStatus, TDes8& aDes); |
|
99 IMPORT_C TInt ReadCancel(); |
|
100 IMPORT_C void WriteMessage(TRequestStatus& aStatus, const TDesC8& aDes, TBool aHasHeader=EFalse); |
|
101 IMPORT_C TInt WriteCancel(); |
|
102 }; |
|
103 |
|
104 #endif //__RDbgTrcComm_h__ |