|
1 /* |
|
2 * Copyright (c) 2005 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: See class definition below. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CTCSERIALCONNECTION_H__ |
|
19 #define __CTCSERIALCONNECTION_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include "CTcBaseConnection.h" |
|
23 |
|
24 #include <c32comm.h> |
|
25 |
|
26 // CLASS DEFINITION |
|
27 /** |
|
28 * CTcSerialConnection implements Serial port specific connection |
|
29 * initialization on top of CTcBaseConnection. |
|
30 */ |
|
31 class CTcSerialConnection |
|
32 : public CTcBaseConnection |
|
33 { |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /// Default constructor |
|
37 CTcSerialConnection( RCommServ& aCommServ, |
|
38 const TDesC& aPortName, |
|
39 TUint aPortSpeed ); |
|
40 |
|
41 /// Destructor |
|
42 ~CTcSerialConnection(); |
|
43 |
|
44 protected: // From CActive |
|
45 |
|
46 void DoCancel(); |
|
47 |
|
48 public: // From CTcBaseConnection |
|
49 |
|
50 void ConnectL(); |
|
51 |
|
52 void Close(); |
|
53 |
|
54 void Send( const TDesC8& aDes ); |
|
55 |
|
56 void Receive( TDes8& aDes ); |
|
57 |
|
58 void ReceiveOneOrMore( TDes8& aDes ); |
|
59 |
|
60 void SetupPortL(); |
|
61 |
|
62 private: |
|
63 |
|
64 void SetupPortBaudrateValuesL(); |
|
65 |
|
66 private: |
|
67 |
|
68 RComm iCommPort; |
|
69 |
|
70 RCommServ& iCommServ; |
|
71 |
|
72 const TDesC& iPortName; |
|
73 |
|
74 TUint iPortSpeed; |
|
75 |
|
76 TBps iBaudrate; |
|
77 |
|
78 TUint iBaudrateCap; |
|
79 }; |
|
80 |
|
81 #endif // __CTCSERIALCONNECTION_H__ |