|
1 /* |
|
2 * Copyright (c) 2007 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: A reference implementation for ISC data transmission base. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef ISCDATATRANSMISSIONBASE_H |
|
21 #define ISCDATATRANSMISSIONBASE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <iscmultiplexerbase.h> |
|
25 #include <kernel.h> |
|
26 |
|
27 // CONSTANTS |
|
28 _LIT(KIscDataTransmissionDriverName,"IscDataTransmissionDriver"); |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class DIscDevice; |
|
38 class DIscBufferAllocator; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * DIscDataTransmissionBase defines the ISC Data Transmission Plug-In API |
|
44 * |
|
45 * @lib IscDataTransmissionBase.LIB |
|
46 * @since 2.8 |
|
47 */ |
|
48 class DIscDataTransmissionBase : public DLogicalDevice |
|
49 { |
|
50 |
|
51 public: |
|
52 /** |
|
53 * C++ default constructor. |
|
54 */ |
|
55 IMPORT_C DIscDataTransmissionBase(); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 IMPORT_C virtual ~DIscDataTransmissionBase(); |
|
61 |
|
62 public: // Functions from base class |
|
63 |
|
64 /** |
|
65 * Implementation of pure-virtual Install from DLogicalDevice. This |
|
66 * function calls Install2ndPhase. |
|
67 * @since 2.8 |
|
68 * @return TInt KErrNone |
|
69 */ |
|
70 IMPORT_C TInt Install(); |
|
71 |
|
72 /** |
|
73 * This method makes the buffer allocations according to the |
|
74 * configuration specified by the ISC Multiplexer |
|
75 * @since 2.8 |
|
76 * @param TIscBufferEntry* aBufferConfig pointer to buffer configuration table |
|
77 * @return void |
|
78 */ |
|
79 IMPORT_C virtual void AllocBuffers( TIscBufferEntry* aBufferConfig ); |
|
80 |
|
81 public: // New functions |
|
82 |
|
83 /** |
|
84 * Second phase initialization, called during ISC Multiplexer loading. |
|
85 * ISC Data Transmission Driver must do all initialization here that |
|
86 * are normally done in Install() |
|
87 * @since ?Series60_version |
|
88 * @return TInt KErrNone if successful |
|
89 */ |
|
90 virtual TInt Install2ndPhase() = 0; |
|
91 |
|
92 /** |
|
93 * ISC Data Transmission driver initialization |
|
94 * @since 2.8 |
|
95 * @param aParameters Initialization parameters passed from |
|
96 * ISC initialization file |
|
97 * @param aDfc Dfc that must be runned after the initialization |
|
98 * has been done |
|
99 * @return void |
|
100 */ |
|
101 virtual void InitializeDataTransmission( TDesC8& aParameters, |
|
102 TDfc* aDfc, |
|
103 TInt& aErrorCode /* KErrNone */) = 0; |
|
104 |
|
105 /** |
|
106 * In asynchronous data transmission checkin if transmission is not yet finished |
|
107 * Access to this method is necessary since transmission can be asynchronous. |
|
108 * @since 2.8 |
|
109 * @return TBool EFalse / ETrue |
|
110 */ |
|
111 virtual TBool IsWritePending() { return EFalse; }; |
|
112 |
|
113 /** |
|
114 * Send frame to Domestic OS |
|
115 * @since 2.8 |
|
116 * @param aFrame Frame to be sent |
|
117 * @param aDfc Dfc function that must be runned after the frame is sent. |
|
118 * Or the dfc can be runned immediately if the driver internally buffers |
|
119 * the outgoing frames |
|
120 * @param aMultiplexerDfc Dfc function in multiplexer to handle send complition |
|
121 * @param aMultiplexerErrorCode error code for frame sending to modem |
|
122 * @return void |
|
123 */ |
|
124 virtual void SendFrame( TDes8& aFrame, TDfc* aDfc, TAny* aFrameInfo ) = 0; |
|
125 |
|
126 /** |
|
127 * Get the connection status |
|
128 * @since 2.8 |
|
129 * @return TInt EIscConnectionOk / EIscConnectionNotOk |
|
130 */ |
|
131 virtual TInt ConnectionStatus() = 0; |
|
132 |
|
133 /** |
|
134 * Connects ISC Driver to ISC Data Transmission Driver |
|
135 * @since 2.8 |
|
136 * @param aDevice Pointer to DIscDevice class in ISC Driver |
|
137 * @return void |
|
138 */ |
|
139 IMPORT_C virtual void Connect(DIscDevice* aDevice); |
|
140 |
|
141 /** |
|
142 * Reserve memory block |
|
143 * @since 2.8 |
|
144 * @param aPtr Pointer to reserved memory block, NULL if not successful |
|
145 * @param aSize Required minimun size of the block |
|
146 * @return void |
|
147 */ |
|
148 IMPORT_C virtual void ReserveMemoryBlock( TDes8*& aPtr, TUint16 aSize); |
|
149 |
|
150 /** |
|
151 * Release the reserved memory block |
|
152 * @since 2.8 |
|
153 * @param aPtr Pointer to memory block to be released |
|
154 * @return void |
|
155 */ |
|
156 IMPORT_C virtual void ReleaseMemoryBlock( TDes8* aPtr ); |
|
157 |
|
158 protected: // New functions |
|
159 |
|
160 /** |
|
161 * Transfer incoming frame to ISC Driver |
|
162 * @since 2.8 |
|
163 * @param aFrame Frame that was received |
|
164 * @return void |
|
165 */ |
|
166 IMPORT_C void ReceiveFrame(TDesC8& aFrame); |
|
167 |
|
168 /** |
|
169 * Notifies any connection status changes to ISC Driver |
|
170 * @since 2.8 |
|
171 * @param aStatus EIscConnectionOk / EIscConnectionNotOk |
|
172 * @return void |
|
173 */ |
|
174 IMPORT_C void NotifyConnectionStatus( TInt aStatus ); |
|
175 |
|
176 private: // Data |
|
177 |
|
178 // pointer to DIscDevice class from ISC Driver |
|
179 DIscDevice* iDevice; // No ownership |
|
180 |
|
181 // pointer to pre-allocated buffers |
|
182 DIscBufferAllocator* iIscBufferAllocator; // Ownership |
|
183 |
|
184 }; |
|
185 |
|
186 #endif // ISCDATATRANSMISSIONBASE_H |
|
187 |
|
188 // End of File |