|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #if !defined(__FaxStd_H__) |
|
17 #define __FaxStd_H__ |
|
18 |
|
19 /** |
|
20 we start off with data constants |
|
21 |
|
22 error codes |
|
23 |
|
24 @internalComponent |
|
25 */ |
|
26 const TInt KFaxErrModemNotWorking (-101); |
|
27 const TInt KFaxErrCannotConnect (-102); |
|
28 const TInt KFaxErrCSIorCIG (-103); |
|
29 const TInt KFaxErrDISorDTC (-104); |
|
30 const TInt KFaxErrFrameFail (-105); |
|
31 const TInt KFaxErrAtNegotiatedSpeed (-106); |
|
32 const TInt KFaxErrCFR (-107); |
|
33 const TInt KFaxErrMCF (-108); |
|
34 const TInt KFaxErrCRP (-109); |
|
35 const TInt KFaxErrNoDial (-110); |
|
36 const TInt KFaxErrNoDialTone (-111); |
|
37 const TInt KFaxErrBusy (-112); |
|
38 const TInt KFaxErrNoAnswer (-113); |
|
39 const TInt KFaxErrNoCarrier (-114); |
|
40 const TInt KFaxErrRemoteCannotReceive (-115); |
|
41 const TInt KFaxErrCompression (-116); |
|
42 const TInt KFaxErrPageTooLong (-117); |
|
43 const TInt KFaxErrDCN (-118); |
|
44 const TInt KFaxErrRemoteDCN (-119); |
|
45 const TInt KFaxErrHDLC (-120); |
|
46 const TInt KFaxErrStopAndWait (-121); |
|
47 const TInt KFaxErrTrainStop (-122); |
|
48 const TInt KFaxErrReceiveTimeout (-123); |
|
49 const TInt KFaxErrCannotEndData (-124); |
|
50 const TInt KFaxErrEOP (-125); |
|
51 const TInt KFaxErrMPS (-126); |
|
52 const TInt KFaxErrNoReceiveMode (-127); |
|
53 const TInt KFaxErrCannotAnswer (-128); |
|
54 const TInt KFaxErrPrematureHangup (-129); |
|
55 const TInt KFaxErrModemResponse (-130); |
|
56 const TInt KFaxErrPrematureOK (-131); |
|
57 const TInt KFaxErrNoFinalOK (-132); |
|
58 const TInt KFaxErrUnknownPageCode (-133); |
|
59 const TInt KFaxErrNoHangup (-134); |
|
60 const TInt KFaxErrNoNegotiate (-135); |
|
61 const TInt KFaxErrModemDisconnect (-136); |
|
62 const TInt KFaxErrWrongModemType (-137); |
|
63 const TInt KFaxErrTrainFail (-138); |
|
64 const TInt KFaxTransmitterStalled (-139); |
|
65 const TInt KFaxReceiverOverflow (-140); |
|
66 const TInt KFaxCannotOpenPort (-141); |
|
67 const TInt KFaxCannotCloseStore (-142); |
|
68 const TInt KFaxCannotOpenStore (-143); |
|
69 const TInt KFaxThreadError (-144); |
|
70 const TInt KFaxFileSessionError (-145); |
|
71 const TInt KFaxLogCreateError (-146); // was KFaxFileCreateError till 7/10/97 |
|
72 const TInt KFaxFileSeekError (-147); |
|
73 const TInt KFaxPDDError (-148); |
|
74 const TInt KFaxLDDError (-149); |
|
75 const TInt KFaxC32Error (-150); |
|
76 const TInt KFaxCommsServerError (-151); |
|
77 const TInt KFaxCommsPortError (-152); |
|
78 const TInt KFaxCancelRequested (-153); |
|
79 const TInt KFaxNoClass2Xon (-154); |
|
80 const TInt KFaxConfigError (-155); |
|
81 const TInt KFaxCannotAutodetect (-156); |
|
82 const TInt KCannotFindFirstPage (-157); |
|
83 const TInt KFaxBadInitialization (-158); |
|
84 const TInt KFaxOnlyJustAutoDetected (-159); |
|
85 const TInt KFaxBelowMinSpeed (-160); |
|
86 const TInt KFaxPollingUnsupported (-161); |
|
87 const TInt KFaxNothingToPoll (-162); |
|
88 const TInt KFaxEtelServerError (-163); |
|
89 |
|
90 /** |
|
91 standard communication bytes |
|
92 @internalComponent |
|
93 */ |
|
94 const TUint8 Knul (0x00); |
|
95 const TUint8 Kdle (0x10); |
|
96 const TUint8 Ketx (0x03); |
|
97 const TUint8 Kbackspace (0x08); |
|
98 const TUint8 Kreturn (0x0d); |
|
99 const TUint8 Klinefeed (0x0a); |
|
100 const TUint8 Kxon (0x11); |
|
101 const TUint8 Kxoff (0x13); |
|
102 const TUint8 Kdc2 (0x12); |
|
103 const TUint8 Kcan (0x18); |
|
104 |
|
105 /** |
|
106 apparent clock granularity |
|
107 @internalComponent |
|
108 */ |
|
109 |
|
110 const TInt CLK_TCK (1000000); |
|
111 |
|
112 /** |
|
113 maximum size of a descriptor for reading and writing T4 scan lines |
|
114 |
|
115 the longest possible encoded scan line is alternating black and white dots |
|
116 that's 8 bits, as single white dot = 00111 single black dot = 010 |
|
117 there's a maximum of 864 such pairs in a 1728 dot scan line |
|
118 let's be generous and allow for eols and padding - 896 |
|
119 this is sufficient for faxes we generate ourselves |
|
120 |
|
121 On the other hand, a scan line can take up to 5 seconds to transmit |
|
122 At 14400 bps, it could contain 72000 bits = 9000 bytes |
|
123 There could be internal line padding (alternate run lengths of zero) |
|
124 So this bigger figure is needed for faxes which we receive via the line |
|
125 |
|
126 we also use this when sending phase C data to the modem |
|
127 we also use this when receiving phase C data from the modem |
|
128 |
|
129 @internalComponent |
|
130 */ |
|
131 const TInt KMaxT4Des (896); |
|
132 const TInt KMaxFaxBuf ((KMaxT4Des + sizeof (TInt)) * 2); |
|
133 |
|
134 /** |
|
135 base for sizing buffers |
|
136 @internalComponent |
|
137 */ |
|
138 |
|
139 const TInt KBufSize (512); |
|
140 |
|
141 /** |
|
142 A version must be specifyed when creating a session with the server |
|
143 @internalComponent |
|
144 */ |
|
145 |
|
146 const TUint KEtelFaxMajorVersionNumber = 1; |
|
147 const TUint KEtelFaxMinorVersionNumber = 0; |
|
148 const TUint KEtelFaxVersionNumber = 601; |
|
149 |
|
150 /** |
|
151 @internalComponent |
|
152 */ |
|
153 IMPORT_C TInt StartThread (); |
|
154 |
|
155 |
|
156 /********************************************************************/ |
|
157 |
|
158 // fax structures |
|
159 /********************************************************************/ |
|
160 |
|
161 /** |
|
162 The next enumerations is bitmapped giving useful TFaxMode masks |
|
163 @internalComponent |
|
164 */ |
|
165 const TUint KFaxReceive (0x01); |
|
166 const TUint KFaxOffHook (0x02); |
|
167 const TUint KFaxWaitForRing (0x04); |
|
168 const TUint KFaxNoDial (0x06); |
|
169 const TUint KFaxPoll (0x08); |
|
170 |
|
171 /** |
|
172 @internalComponent |
|
173 */ |
|
174 enum TFaxMode |
|
175 { |
|
176 EDialAndTransmit=0, // this is a normal fax machine type send |
|
177 EDialAndReceiveFaxBack=1, // this dials a fax on demand service |
|
178 EImmediateTransmit=2, // for switching from voice to send |
|
179 EImmediateReceive=3, // for switching from voice to receive |
|
180 EWaitForRingAndTransmit=4, // this make us into a fax on demand |
|
181 EWaitForRingAndReceive=5, // this is a normal fax machine type receive |
|
182 EDialAndReceivePoll=9 // this is for fax polling |
|
183 }; |
|
184 |
|
185 #endif |
|
186 |