|
1 /* |
|
2 * Copyright (c) 1997-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 __REGISTRATIONPORT_H__ |
|
19 #define __REGISTRATIONPORT_H__ |
|
20 |
|
21 #include <cs_port.h> |
|
22 |
|
23 class MAcmController; |
|
24 |
|
25 /** |
|
26 The registration port. |
|
27 This is a deprecated method for controlling (bringing up and down) ACM |
|
28 functions. |
|
29 ACM Class Controllers open a registration port and use SetSignalsToMark and |
|
30 SetSignalsToSpace to bring ACM functions up and down. |
|
31 The newer method involved creating a session on the ACM server (RAcmServer) |
|
32 and using the APIs provided. |
|
33 */ |
|
34 NONSHARABLE_CLASS(CRegistrationPort) : public CPort |
|
35 { |
|
36 public: |
|
37 static CRegistrationPort* NewL(MAcmController& aAcmController, |
|
38 TUint aUnit); |
|
39 ~CRegistrationPort(); |
|
40 |
|
41 private: |
|
42 CRegistrationPort(MAcmController& aAcmController); |
|
43 void ConstructL(TUint aUnit); |
|
44 |
|
45 private: // from CPort |
|
46 virtual void StartRead(const TAny* aClientBuffer,TInt aLength); |
|
47 virtual void ReadCancel(); |
|
48 virtual TInt QueryReceiveBuffer(TInt& aLength) const; |
|
49 virtual void ResetBuffers(TUint aFlags); |
|
50 virtual void StartWrite(const TAny* aClientBuffer,TInt aLength); |
|
51 virtual void WriteCancel(); |
|
52 virtual void Break(TInt aTime); |
|
53 virtual void BreakCancel(); |
|
54 virtual TInt GetConfig(TDes8& aDes) const; |
|
55 virtual TInt SetConfig(const TDesC8& aDes); |
|
56 virtual TInt SetServerConfig(const TDesC8& aDes); |
|
57 virtual TInt GetServerConfig(TDes8& aDes); |
|
58 virtual TInt GetCaps(TDes8& aDes); |
|
59 virtual TInt GetSignals(TUint& aSignals); |
|
60 virtual TInt SetSignalsToMark(TUint aNoAcms); |
|
61 virtual TInt SetSignalsToSpace(TUint aNoAcms); |
|
62 virtual TInt GetReceiveBufferLength(TInt& aLength) const; |
|
63 virtual TInt SetReceiveBufferLength(TInt aLength); |
|
64 virtual void Destruct(); |
|
65 virtual void FreeMemory(); |
|
66 virtual void NotifySignalChange(TUint aSignalMask); |
|
67 virtual void NotifySignalChangeCancel(); |
|
68 virtual void NotifyConfigChange(); |
|
69 virtual void NotifyConfigChangeCancel(); |
|
70 virtual void NotifyFlowControlChange(); |
|
71 virtual void NotifyFlowControlChangeCancel(); |
|
72 virtual void NotifyBreak(); |
|
73 virtual void NotifyBreakCancel(); |
|
74 virtual void NotifyDataAvailable(); |
|
75 virtual void NotifyDataAvailableCancel(); |
|
76 virtual void NotifyOutputEmpty(); |
|
77 virtual void NotifyOutputEmptyCancel(); |
|
78 virtual TInt GetFlowControlStatus(TFlowControl& aFlowControl); |
|
79 virtual TInt GetRole(TCommRole& aRole); |
|
80 virtual TInt SetRole(TCommRole aRole); |
|
81 |
|
82 private: // unowned |
|
83 MAcmController& iAcmController; |
|
84 |
|
85 private: // owned |
|
86 // Dummy role of the serial port (DTE or DCE) |
|
87 TCommRole iRole; |
|
88 }; |
|
89 |
|
90 #endif // __REGISTRATIONPORT_H__ |