tsp.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2009 Free Pascal development team.
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. ********************************************************************* }
  10. unit tsp;
  11. interface
  12. {$mode objfpc}
  13. {$calling cdecl}
  14. uses
  15. Windows;
  16. //***************************************************************
  17. //
  18. // consts
  19. //
  20. //***************************************************************
  21. const
  22. CELLTSP_PROVIDERINFO_STRING = 'Cellular TAPI Service Provider';
  23. CELLTSP_LINENAME_STRING = 'Cellular Line';
  24. CELLTSP_PHONENAME_STRING = 'Cellular Phone';
  25. //Maximum length constants
  26. CELLDEVCONFIG_MAXLENGTH_GPRSACCESSPOINTNAME = 64;
  27. CELLDEVCONFIG_MAXLENGTH_GPRSADDRESS = 64;
  28. CELLDEVCONFIG_MAXLENGTH_GPRSPARAMETERS = 32;
  29. //LINEBEARERMODE_ constant to identify GPRS calls
  30. LINEBEARERMODE_GPRS = (8 shl 16);
  31. //When using RAS, the following string MUST be used as the destination address for all GPRS calls
  32. GPRS_DEST_ADDRESS = '~GPRS!';
  33. //LINEDISCONNECTMODE_ constants to provide more detailed error reporting
  34. LINEDISCONNECTMODE_PHONECONNECTIONFAILURE = (1 or ($d0 shl 16));
  35. LINEDISCONNECTMODE_INVALIDSIMCARD = (1 or ($d1 shl 16));
  36. LINEDISCONNECTMODE_SIMCARDBUSY = (1 or ($d2 shl 16));
  37. LINEDISCONNECTMODE_NETWORKSERVICENOTAVAILABLE = (1 or ($d3 shl 16));
  38. LINEDISCONNECTMODE_EMERGENCYONLY = (1 or ($d4 shl 16));
  39. //Bearer Service CE constants define bearer service connection elements for CELLBEARERINFO structure
  40. CELLDEVCONFIG_CONNELEM_UNKNOWN = $00000000; //Bearer service unknown
  41. CELLDEVCONFIG_CONNELEM_TRANSPARENT = $00000001; //Link layer correction enabled
  42. CELLDEVCONFIG_CONNELEM_NONTRANSPARENT = $00000002; //No link layer correction present
  43. CELLDEVCONFIG_CONNELEM_BOTH_TRANSPARENT = $00000003; //Both available, transparent preferred
  44. CELLDEVCONFIG_CONNELEM_BOTH_NONTRANSPARENT = $00000004; //Both available, non-transparent preferred
  45. //Telephony service type constants for CELLBEARERINFO structure
  46. //These flags only apply for data access. When a voice call is being
  47. //placed, this flag is ignored
  48. CELLDEVCONFIG_SERVICE_UNKNOWN = $00000000; //Unknown service
  49. CELLDEVCONFIG_SERVICE_MODEM_ASYNC = $00000001; //Asynchronous modem
  50. CELLDEVCONFIG_SERVICE_MODEM_SYNC = $00000002; //Synchronous modem
  51. CELLDEVCONFIG_SERVICE_PADACCESS_ASYNC = $00000003; //PAD Access (asynchronous)
  52. CELLDEVCONFIG_SERVICE_PACKETACCESS_SYNC = $00000004; //Packet Access (synchronous)
  53. //Data rate constants define protocol dependent data rates for CELLBEARERINFO structure
  54. CELLDEVCONFIG_SPEED_UNKNOWN = $00000000; //Unknown speed
  55. CELLDEVCONFIG_SPEED_AUTO = $00000001; //Automatic selection of speed
  56. CELLDEVCONFIG_SPEED_300_V21 = $00000002; //300 bps (V.21)
  57. CELLDEVCONFIG_SPEED_300_V110 = $00000003; //300 bps (V.100)
  58. CELLDEVCONFIG_SPEED_1200_V22 = $00000004; //1200 bps (V.22)
  59. CELLDEVCONFIG_SPEED_1200_75_V23 = $00000005; //1200/75 bps (V.23)
  60. CELLDEVCONFIG_SPEED_1200_V110 = $00000006; //1200 bps (V.100)
  61. CELLDEVCONFIG_SPEED_1200_V120 = $00000007; //1200 bps (V.120)
  62. CELLDEVCONFIG_SPEED_2400_V22BIS = $00000008; //2400 bps (V.22bis)
  63. CELLDEVCONFIG_SPEED_2400_V26TER = $00000009; //2400 bps (V.26ter)
  64. CELLDEVCONFIG_SPEED_2400_V110 = $0000000a; //2400 bps (V.110 or X.31 flag stuffing)
  65. CELLDEVCONFIG_SPEED_2400_V120 = $0000000b; //2400 bps (V.120)
  66. CELLDEVCONFIG_SPEED_4800_V32 = $0000000c; //4800 bps (V.32)
  67. CELLDEVCONFIG_SPEED_4800_V110 = $0000000d; //4800 bps (V.110 or X.31 flag stuffing)
  68. CELLDEVCONFIG_SPEED_4800_V120 = $0000000e; //4800 bps (V.120)
  69. CELLDEVCONFIG_SPEED_9600_V32 = $0000000f; //9600 bps (V.32)
  70. CELLDEVCONFIG_SPEED_9600_V34 = $00000010; //9600 bps (V.34)
  71. CELLDEVCONFIG_SPEED_9600_V110 = $00000011; //9600 bps (V.110 or X.31 flag stuffing)
  72. CELLDEVCONFIG_SPEED_9600_V120 = $00000012; //9600 bps (V.120)
  73. CELLDEVCONFIG_SPEED_14400_V34 = $00000013; //14400 bps (V.34)
  74. CELLDEVCONFIG_SPEED_14400_V110 = $00000014; //14400 bps (V.100 or X.31 flag stuffing
  75. CELLDEVCONFIG_SPEED_14400_V120 = $00000015; //14400 bps (V.120
  76. CELLDEVCONFIG_SPEED_19200_V34 = $00000016; //9200 bps (V.34)
  77. CELLDEVCONFIG_SPEED_19200_V110 = $00000017; //19200 bps (V.110 or X.31 flag stuffing)
  78. CELLDEVCONFIG_SPEED_19200_V120 = $00000018; //19200 bps (V.120)
  79. CELLDEVCONFIG_SPEED_28800_V34 = $00000019; //28800 bps (V.34)
  80. CELLDEVCONFIG_SPEED_28800_V110 = $0000001a; //28800 bps (V.110 or X.31 flag stuffing)
  81. CELLDEVCONFIG_SPEED_28800_V120 = $0000001b; //28800 bps (V.120)
  82. CELLDEVCONFIG_SPEED_38400_V110 = $0000001c; //38400 bps (V.110 or X.31 flag stuffing)
  83. CELLDEVCONFIG_SPEED_38400_V120 = $0000001d; //38400 bps (V.120)
  84. CELLDEVCONFIG_SPEED_48000_V110 = $0000001e; //48000 bps (V.110 or X.31 flag stuffing)
  85. CELLDEVCONFIG_SPEED_48000_V120 = $0000001f; //48000 bps (V.120)
  86. CELLDEVCONFIG_SPEED_56000_V110 = $00000020; //56000 bps (V.110 or X.31 flag stuffing)
  87. CELLDEVCONFIG_SPEED_56000_V120 = $00000021; //56000 bps (V.120)
  88. CELLDEVCONFIG_SPEED_56000_TRANSP = $00000022; //56000 bps (bit transparent)
  89. CELLDEVCONFIG_SPEED_64000_TRANSP = $00000023; //64000 bps (bit transparent)
  90. CELLDEVCONFIG_SPEED_32000_PIAFS32K = $00000024; //32000 bps (PIAFS32k)
  91. CELLDEVCONFIG_SPEED_64000_PIAFS64K = $00000025; //64000 bps (PIAFS64k)
  92. CELLDEVCONFIG_SPEED_28800_MULTIMEDIA = $00000026; //28800 bps (MultiMedia)
  93. CELLDEVCONFIG_SPEED_32000_MULTIMEDIA = $00000027; //32000 bps (MultiMedia)
  94. CELLDEVCONFIG_SPEED_33600_MULTIMEDIA = $00000028; //33600 bps (MultiMedia)
  95. CELLDEVCONFIG_SPEED_56000_MULTIMEDIA = $00000029; //56000 bps (MultiMedia)
  96. CELLDEVCONFIG_SPEED_64000_MULTIMEDIA = $0000002a; //64000 bps (MultiMedia)
  97. //Data compression directions constants for CELLDATACOMPINFO structure
  98. CELLDEVCONFIG_DATACOMPDIR_UNKNOWN = $00000000; //Unknown direction
  99. CELLDEVCONFIG_DATACOMPDIR_NONE = $00000001; //No compression
  100. CELLDEVCONFIG_DATACOMPDIR_TRANSMIT = $00000002; //Transmit only
  101. CELLDEVCONFIG_DATACOMPDIR_RECEIVE = $00000003; //Receive only
  102. CELLDEVCONFIG_DATACOMPDIR_BOTH = $00000004; //Both directions, accept any direction
  103. //GPRS data compression settings constants for CELLGPRSCONNECTIONINFO structure
  104. CELLDEVCONFIG_GPRSCOMPRESSION_UNKNOWN = $00000000; //Compression unknown
  105. CELLDEVCONFIG_GPRSCOMPRESSION_OFF = $00000001; //Compression off
  106. CELLDEVCONFIG_GPRSCOMPRESSION_ON = $00000002; //Compression on
  107. //GPRS protocol identifier constants for CELLGPRSCONNECTIONINFO structure
  108. CELLDEVCONFIG_GPRSPROTOCOL_UNKNOWN = $00000000; //Unknown
  109. CELLDEVCONFIG_GPRSPROTOCOL_X25 = $00000001; //Unsupported
  110. CELLDEVCONFIG_GPRSPROTOCOL_IP = $00000002; //IP (Radio acts as PPP server)
  111. CELLDEVCONFIG_GPRSPROTOCOL_IHOSP = $00000003; //Unsupported
  112. CELLDEVCONFIG_GPRSPROTOCOL_PPP = $00000004; //Point to Point protocol (PPP frames forwarded to end server)
  113. //GPRS L2 protocol identifier constants for CELLGPRSCONNECTIONINFO structure
  114. CELLDEVCONFIG_GPRSL2PROTOCOL_UNKNOWN = $00000000; //Unknown
  115. CELLDEVCONFIG_GPRSL2PROTOCOL_NULL = $00000001; //Unsupported
  116. CELLDEVCONFIG_GPRSL2PROTOCOL_PPP = $00000002; //WinCE uses PPP
  117. CELLDEVCONFIG_GPRSL2PROTOCOL_PAD = $00000003; //Unsupported
  118. CELLDEVCONFIG_GPRSL2PROTOCOL_X25 = $00000004; //Unsupported
  119. //GPRS precedence classes for CELLGPRSQOSSETTINGS structure
  120. CELLDEVCONFIG_GPRSPRECEDENCECLASS_UNKNOWN = $00000000; //Unknown
  121. CELLDEVCONFIG_GPRSPRECEDENCECLASS_SUBSCRIBED = $00000001; //Subscribed value stored in network
  122. CELLDEVCONFIG_GPRSPRECEDENCECLASS_HIGH = $00000002; //High priority
  123. CELLDEVCONFIG_GPRSPRECEDENCECLASS_NORMAL = $00000003; //Normal priority
  124. CELLDEVCONFIG_GPRSPRECEDENCECLASS_LOW = $00000004; //Low priority
  125. //GPRS delay classes for CELLGPRSQOSSETTINGS structure
  126. CELLDEVCONFIG_GPRSDELAYCLASS_UNKNOWN = $00000000; //Unknown
  127. CELLDEVCONFIG_GPRSDELAYCLASS_SUBSCRIBED = $00000001;
  128. CELLDEVCONFIG_GPRSDELAYCLASS_PREDICTIVE1 = $00000002;
  129. CELLDEVCONFIG_GPRSDELAYCLASS_PREDICTIVE2 = $00000003;
  130. CELLDEVCONFIG_GPRSDELAYCLASS_PREDICTIVE3 = $00000004;
  131. CELLDEVCONFIG_GPRSDELAYCLASS_BESTEFFORT = $00000005;
  132. //GPRS reliability classes for CELLGPRSQOSSETTINGS structure
  133. CELLDEVCONFIG_GPRSRELIABILITYCLASS_UNKNOWN = $00000000; //Unknown
  134. CELLDEVCONFIG_GPRSRELIABILITYCLASS_SUBSCRIBED = $00000001;
  135. CELLDEVCONFIG_GPRSRELIABILITYCLASS_1 = $00000002;
  136. CELLDEVCONFIG_GPRSRELIABILITYCLASS_2 = $00000003;
  137. CELLDEVCONFIG_GPRSRELIABILITYCLASS_3 = $00000004;
  138. CELLDEVCONFIG_GPRSRELIABILITYCLASS_4 = $00000005;
  139. CELLDEVCONFIG_GPRSRELIABILITYCLASS_5 = $00000006;
  140. //GPRS peak throughput classes for CELLGPRSQOSSETTINGS structure
  141. CELLDEVCONFIG_PEAKTHRUCLASS_UNKNOWN = $00000000; //Unknown
  142. CELLDEVCONFIG_PEAKTHRUCLASS_SUBSCRIBED = $00000001;
  143. CELLDEVCONFIG_PEAKTHRUCLASS_8000 = $00000002; //kbit/second
  144. CELLDEVCONFIG_PEAKTHRUCLASS_16000 = $00000003;
  145. CELLDEVCONFIG_PEAKTHRUCLASS_32000 = $00000004;
  146. CELLDEVCONFIG_PEAKTHRUCLASS_64000 = $00000005;
  147. CELLDEVCONFIG_PEAKTHRUCLASS_128000 = $00000006;
  148. CELLDEVCONFIG_PEAKTHRUCLASS_256000 = $00000007;
  149. CELLDEVCONFIG_PEAKTHRUCLASS_512000 = $00000008;
  150. CELLDEVCONFIG_PEAKTHRUCLASS_1024000 = $00000009;
  151. CELLDEVCONFIG_PEAKTHRUCLASS_2048000 = $0000000a;
  152. //GPRS mean throughput classes for CELLGPRSQOSSETTINGS structure
  153. CELLDEVCONFIG_MEANTHRUCLASS_UNKNOWN = $00000000; //Unknown
  154. CELLDEVCONFIG_MEANTHRUCLASS_SUBSCRIBED = $00000001;
  155. CELLDEVCONFIG_MEANTHRUCLASS_100 = $00000002; //octets/hour
  156. CELLDEVCONFIG_MEANTHRUCLASS_500 = $00000004;
  157. CELLDEVCONFIG_MEANTHRUCLASS_1000 = $00000005;
  158. CELLDEVCONFIG_MEANTHRUCLASS_2000 = $00000006;
  159. CELLDEVCONFIG_MEANTHRUCLASS_5000 = $00000007;
  160. CELLDEVCONFIG_MEANTHRUCLASS_10000 = $00000008;
  161. CELLDEVCONFIG_MEANTHRUCLASS_20000 = $00000009;
  162. CELLDEVCONFIG_MEANTHRUCLASS_50000 = $0000000a;
  163. CELLDEVCONFIG_MEANTHRUCLASS_100000 = $0000000b;
  164. CELLDEVCONFIG_MEANTHRUCLASS_200000 = $0000000c;
  165. CELLDEVCONFIG_MEANTHRUCLASS_500000 = $0000000d;
  166. CELLDEVCONFIG_MEANTHRUCLASS_1000000 = $0000000e;
  167. CELLDEVCONFIG_MEANTHRUCLASS_2000000 = $0000000f;
  168. CELLDEVCONFIG_MEANTHRUCLASS_5000000 = $00000010;
  169. CELLDEVCONFIG_MEANTHRUCLASS_10000000 = $00000011;
  170. CELLDEVCONFIG_MEANTHRUCLASS_20000000 = $00000012;
  171. CELLDEVCONFIG_MEANTHRUCLASS_50000000 = $00000013;
  172. CELLDEVCONFIG_MEANTHRUCLASS_DONTCARE = $00000014; //Best effort
  173. //Flags for the CELLDEVCONFIG structure
  174. CELLDEVCONFIG_FLAG_TERMINALAFTERDIALING = $00000001; //(Only valid when used with lineSetDevConfig)
  175. //***********************************************************
  176. //
  177. // types
  178. //
  179. //***********************************************************
  180. type
  181. CALLER_ID_OPTIONS = (CALLER_ID_DEFAULT); //Accept the default behavior
  182. //Structure that can be passed as data for LINECALLPARAMS.dwDevSpecific[Size, Offset]
  183. linecallparamsdevspecific_tag = record
  184. cidoOptions: CALLER_ID_OPTIONS;
  185. end; //linecallparamsdevspecific_tag
  186. LINECALLPARAMSDEVSPECIFIC = linecallparamsdevspecific_tag;
  187. PLINECALLPARAMSDEVSPECIFIC = ^linecallparamsdevspecific_tag;
  188. //Structure containing bearer information
  189. //Used to set different bearers, specifically to enable quick connect.
  190. CELLBEARERINFO_tag = record
  191. dwSpeed : LongInt; //One of the CELLDEVCONFIG_SPEED_* constants
  192. dwService : LongInt; //One of the CELLDEVCONFIG_SERVICE_* constants
  193. dwConnectionElement: LongInt; //One of the CELLDEVCONFIG_CONNELEM_* constants
  194. end; //CELLBEARERINFO_tag
  195. CELLBEARERINFO = CELLBEARERINFO_tag;
  196. PCELLBEARERINFO = ^CELLBEARERINFO_tag;
  197. //Structure containing data compression information
  198. //Used for v.42bis compression settings.
  199. CELLDATACOMPINFO_tag = record
  200. dwDirection : LongInt; //One of the CELLDEVCONFIG_DATACOMPDIR_* constants
  201. dwRequired : Boolean; //Data compression required
  202. dwMaxDictEntries : LongInt; //Maximum number of dictionary entries
  203. dwMaxStringLength: LongInt; //Maximum string length
  204. end; //CELLDATACOMPINFO_tag
  205. CELLDATACOMPINFO = CELLDATACOMPINFO_tag;
  206. PCELLDATACOMPINFO = ^CELLDATACOMPINFO_tag;
  207. //Structure containing radio link protocol settings
  208. //Radio link protocol is a link layer correction protocol that increases
  209. //the perceived reliability of the air link.
  210. CELLRADIOLINKINFO_tag = record
  211. dwVersion : LongInt; //Version number
  212. dwIws : LongInt; //IWF to MS window size
  213. dwMws : LongInt; //MS to IWF window size
  214. dwAckTimer : LongInt; //Acknowledgement timer [T1] (milliseconds)
  215. dwRetransmitAttempts: LongInt; //Retransmit attempts [N2]
  216. dwResequenceTimer : LongInt; //Resequence timer [T4] (milliseconds)
  217. end; //CELLRADIOLINKINFO_tag
  218. CELLRADIOLINKINFO = CELLRADIOLINKINFO_tag;
  219. PCELLRADIOLINKINFO = ^CELLRADIOLINKINFO_tag;
  220. //Structure containing GPRS Quality Of Service (QOS) settings
  221. //Used to specify minimum and requested QOS settings
  222. CELLGPRSQOSSETTINGS_tag = record
  223. dwPrecedenceClass : LongInt; //One of the CELLDEVCONFIG_GPRSPRECEDENCECLASS_* constants }
  224. dwDelayClass : LongInt; //One of the CELLDEVCONFIG_GPRSDELAYCLASS_* constants }
  225. dwReliabilityClass: LongInt; //One of the CELLDEVCONFIG_GPRSRELIABILITYCLASS_* constants }
  226. dwPeakThruClass : LongInt; //One of the CELLDEVCONFIG_GPRSPEAKTHRUCLASS_* constants }
  227. dwMeanThruClass : LongInt; //One of the CELLDEVCONFIG_GPRSMEANTHRUCLASS_* constants }
  228. end; //CELLGPRSQOSSETTINGS_tag
  229. CELLGPRSQOSSETTINGS = CELLGPRSQOSSETTINGS_tag;
  230. PCELLGPRSQOSSETTINGS = ^CELLGPRSQOSSETTINGS_tag;
  231. //Structure containing GPRS connection information }
  232. //Used in the initiation of GPRS calls. }
  233. CELLGPRSCONNECTIONINFO_tag = record
  234. dwProtocolType : LongInt; //One of the CELLDEVCONFIG_GPRSPROTOCOL_* constants
  235. dwL2ProtocolType : LongInt; //One of the CELLDEVCONFIG_GPRSL2PROTOCOL_* constants
  236. wszAccessPointName : array[0..CELLDEVCONFIG_MAXLENGTH_GPRSACCESSPOINTNAME-1] of WCHAR;//Logical name to select the GPRS gateway
  237. wszAddress : array[0..CELLDEVCONFIG_MAXLENGTH_GPRSADDRESS-1] of WCHAR;//The packet address to use (if empty, then a dynamic address will be requested)
  238. dwDataCompression : LongInt; //One of the CELLDEVCONFIG_GPRSCOMPRESSION_* constants
  239. dwHeaderCompression : LongInt; //One of the CELLDEVCONFIG_GPRSCOMPRESSION_* constants
  240. szParameters : array[0..CELLDEVCONFIG_MAXLENGTH_GPRSPARAMETERS-1] of Char; //Prococol-specific parameters (NULL terminated)
  241. bRequestedQOSSettingsValid: Boolean; //TRUE iff sgqsRequestedQOSSettings is valid
  242. cgqsRequestedQOSSettings : CELLGPRSQOSSETTINGS;//GPRS QOS settings structure
  243. bMinimumQOSSettingsValid : Boolean; //TRUE iff sgqsMinimumQOSSettings is valid
  244. cgqsMinimumQOSSettings : CELLGPRSQOSSETTINGS; //GPRS QOS settings structure
  245. end; //CELLGPRSCONNECTIONINFO_tag
  246. CELLGPRSCONNECTIONINFO = CELLGPRSCONNECTIONINFO_tag;
  247. PCELLGPRSCONNECTIONINFO = ^CELLGPRSCONNECTIONINFO_tag;
  248. //A service-provider-specific configuration structure }
  249. //This structure is specific to this version of this TSP. Future versions }
  250. //may append additional data elements to the end of this structure. }
  251. CELLDEVCONFIG_tag = record
  252. dwTotalSize : LongInt; //Standard TAPI structure variable }
  253. dwNeededSize : LongInt; //Standard TAPI structure variable }
  254. dwUsedSize : LongInt; //Standard TAPI structure variable }
  255. bBearerInfoValid : Boolean; //TRUE iff sbiBearerInfo is valid }
  256. cbiBearerInfo : CELLBEARERINFO; //Bearer structure }
  257. bDataCompInfoValid : Boolean; //TRUE iff sdciDataCompInfo is valid }
  258. cdciDataCompInfo : CELLDATACOMPINFO; //Data compression structure }
  259. bRadioLinkInfoValid : Boolean; //TRUE iff srliRadioLinkInfo is valid }
  260. crliRadioLinkInfo : CELLRADIOLINKINFO; //RLP structure }
  261. bGPRSConnectionInfoValid: Boolean; //TRUE iff sgciGPRSConnectionInfo is valid }
  262. cgciGPRSConnectionInfo : CELLGPRSCONNECTIONINFO; //GPRS connection structure }
  263. dwFlags : LongInt; //Bit-mask of CELLDEVCONFIG_FLAG_* constants }
  264. end; //CELLDEVCONFIG_tag
  265. CELLDEVCONFIG = CELLDEVCONFIG_tag;
  266. PCELLDEVCONFIG = ^CELLDEVCONFIG_tag;
  267. implementation
  268. end.