jwaaf_irda.pas 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. {******************************************************************************}
  2. { }
  3. { Winsock2 IRDA API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: ad_irda.h, released June 2000. The original Pascal }
  9. { code is: AD_Irda.pas, released December 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. // $Id: JwaAF_Irda.pas,v 1.6 2005/09/08 07:49:25 marquardt Exp $
  43. unit JwaAF_Irda;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "af_irda.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaWindows;
  52. //
  53. // Winsock1.1, IrDA1.1, WindowsNT5.0, Windows98 and WindowsCE1.0.
  54. // Define one of _WIN32_WINNT, _WIN32_WINDOWS, _WIN32_WCE.
  55. // Copyright (C) Microsoft Corporation, 1994-1999.
  56. //
  57. const
  58. WINDOWS_AF_IRDA = 26;
  59. {$EXTERNALSYM WINDOWS_AF_IRDA}
  60. WINDOWS_PF_IRDA = WINDOWS_AF_IRDA;
  61. {$EXTERNALSYM WINDOWS_PF_IRDA}
  62. WCE_AF_IRDA = 22;
  63. {$EXTERNALSYM WCE_AF_IRDA}
  64. WCE_PF_IRDA = WCE_AF_IRDA;
  65. {$EXTERNALSYM WCE_PF_IRDA}
  66. //AF_IRDA = WINDOWS_AF_IRDA;
  67. //{$EXTERNALSYM AF_IRDA}
  68. IRDA_PROTO_SOCK_STREAM = 1;
  69. {$EXTERNALSYM IRDA_PROTO_SOCK_STREAM}
  70. PF_IRDA = WINDOWS_AF_IRDA;
  71. {$EXTERNALSYM PF_IRDA}
  72. // WINNT, WIN98, WINCE
  73. SOL_IRLMP = $00FF;
  74. {$EXTERNALSYM SOL_IRLMP}
  75. IRLMP_ENUMDEVICES = $00000010;
  76. {$EXTERNALSYM IRLMP_ENUMDEVICES}
  77. IRLMP_IAS_SET = $00000011;
  78. {$EXTERNALSYM IRLMP_IAS_SET}
  79. IRLMP_IAS_QUERY = $00000012;
  80. {$EXTERNALSYM IRLMP_IAS_QUERY}
  81. // WINNT, WINCE
  82. IRLMP_SEND_PDU_LEN = $00000013;
  83. {$EXTERNALSYM IRLMP_SEND_PDU_LEN}
  84. IRLMP_EXCLUSIVE_MODE = $00000014;
  85. {$EXTERNALSYM IRLMP_EXCLUSIVE_MODE}
  86. IRLMP_IRLPT_MODE = $00000015;
  87. {$EXTERNALSYM IRLMP_IRLPT_MODE}
  88. IRLMP_9WIRE_MODE = $00000016;
  89. {$EXTERNALSYM IRLMP_9WIRE_MODE}
  90. // WIN98
  91. IRLMP_TINYTP_MODE = $00000017;
  92. {$EXTERNALSYM IRLMP_TINYTP_MODE}
  93. IRLMP_PARAMETERS = $00000018;
  94. {$EXTERNALSYM IRLMP_PARAMETERS}
  95. IRLMP_DISCOVERY_MODE = $00000019;
  96. {$EXTERNALSYM IRLMP_DISCOVERY_MODE}
  97. // WINCE
  98. IRLMP_SHARP_MODE = $00000020;
  99. {$EXTERNALSYM IRLMP_SHARP_MODE}
  100. SIO_LAZY_DISCOVERY = $4004747F; // _IOR('t', 127, u_long)
  101. {$EXTERNALSYM SIO_LAZY_DISCOVERY}
  102. IAS_ATTRIB_NO_CLASS = $00000010;
  103. {$EXTERNALSYM IAS_ATTRIB_NO_CLASS}
  104. IAS_ATTRIB_NO_ATTRIB = $00000000;
  105. {$EXTERNALSYM IAS_ATTRIB_NO_ATTRIB}
  106. IAS_ATTRIB_INT = $00000001;
  107. {$EXTERNALSYM IAS_ATTRIB_INT}
  108. IAS_ATTRIB_OCTETSEQ = $00000002;
  109. {$EXTERNALSYM IAS_ATTRIB_OCTETSEQ}
  110. IAS_ATTRIB_STR = $00000003;
  111. {$EXTERNALSYM IAS_ATTRIB_STR}
  112. IAS_MAX_USER_STRING = 256;
  113. {$EXTERNALSYM IAS_MAX_USER_STRING}
  114. IAS_MAX_OCTET_STRING = 1024;
  115. {$EXTERNALSYM IAS_MAX_OCTET_STRING}
  116. IAS_MAX_CLASSNAME = 64;
  117. {$EXTERNALSYM IAS_MAX_CLASSNAME}
  118. IAS_MAX_ATTRIBNAME = 256;
  119. {$EXTERNALSYM IAS_MAX_ATTRIBNAME}
  120. const
  121. LM_HB_Extension = 128; // Any hint byte
  122. {$EXTERNALSYM LM_HB_Extension}
  123. LM_HB1_PnP = 1; // First hint byte
  124. {$EXTERNALSYM LM_HB1_PnP}
  125. LM_HB1_PDA_Palmtop = 2;
  126. {$EXTERNALSYM LM_HB1_PDA_Palmtop}
  127. LM_HB1_Computer = 4;
  128. {$EXTERNALSYM LM_HB1_Computer}
  129. LM_HB1_Printer = 8;
  130. {$EXTERNALSYM LM_HB1_Printer}
  131. LM_HB1_Modem = 16;
  132. {$EXTERNALSYM LM_HB1_Modem}
  133. LM_HB1_Fax = 32;
  134. {$EXTERNALSYM LM_HB1_Fax}
  135. LM_HB1_LANAccess = 64;
  136. {$EXTERNALSYM LM_HB1_LANAccess}
  137. LM_HB2_Telephony = 1; // Second hint byte
  138. {$EXTERNALSYM LM_HB2_Telephony}
  139. LM_HB2_FileServer = 2;
  140. {$EXTERNALSYM LM_HB2_FileServer}
  141. LmCharSetASCII = 0;
  142. {$EXTERNALSYM LmCharSetASCII}
  143. LmCharSetISO_8859_1 = 1;
  144. {$EXTERNALSYM LmCharSetISO_8859_1}
  145. LmCharSetISO_8859_2 = 2;
  146. {$EXTERNALSYM LmCharSetISO_8859_2}
  147. LmCharSetISO_8859_3 = 3;
  148. {$EXTERNALSYM LmCharSetISO_8859_3}
  149. LmCharSetISO_8859_4 = 4;
  150. {$EXTERNALSYM LmCharSetISO_8859_4}
  151. LmCharSetISO_8859_5 = 5;
  152. {$EXTERNALSYM LmCharSetISO_8859_5}
  153. LmCharSetISO_8859_6 = 6;
  154. {$EXTERNALSYM LmCharSetISO_8859_6}
  155. LmCharSetISO_8859_7 = 7;
  156. {$EXTERNALSYM LmCharSetISO_8859_7}
  157. LmCharSetISO_8859_8 = 8;
  158. {$EXTERNALSYM LmCharSetISO_8859_8}
  159. LmCharSetISO_8859_9 = 9;
  160. {$EXTERNALSYM LmCharSetISO_8859_9}
  161. LmCharSetUNICODE = $ff;
  162. {$EXTERNALSYM LmCharSetUNICODE}
  163. type
  164. LM_BAUD_RATE = u_long;
  165. {$EXTERNALSYM LM_BAUD_RATE}
  166. TLMBaudRate = LM_BAUD_RATE;
  167. PLMBaudRate = ^LM_BAUD_RATE;
  168. const
  169. LM_BAUD_1200 = 1200;
  170. {$EXTERNALSYM LM_BAUD_1200}
  171. LM_BAUD_2400 = 2400;
  172. {$EXTERNALSYM LM_BAUD_2400}
  173. LM_BAUD_9600 = 9600;
  174. {$EXTERNALSYM LM_BAUD_9600}
  175. LM_BAUD_19200 = 19200;
  176. {$EXTERNALSYM LM_BAUD_19200}
  177. LM_BAUD_38400 = 38400;
  178. {$EXTERNALSYM LM_BAUD_38400}
  179. LM_BAUD_57600 = 57600;
  180. {$EXTERNALSYM LM_BAUD_57600}
  181. LM_BAUD_115200 = 115200;
  182. {$EXTERNALSYM LM_BAUD_115200}
  183. LM_BAUD_576K = 576000;
  184. {$EXTERNALSYM LM_BAUD_576K}
  185. LM_BAUD_1152K = 1152000;
  186. {$EXTERNALSYM LM_BAUD_1152K}
  187. LM_BAUD_4M = 4000000;
  188. {$EXTERNALSYM LM_BAUD_4M}
  189. type
  190. LM_IRPARMS = record
  191. nTXDataBytes: u_long; // Max tx data bytes per packet
  192. nRXDataBytes: u_long; // Max rx data bytes per packet
  193. nBaudRate: LM_BAUD_RATE; // Negotiated baud rate
  194. thresholdTime: u_long; // Threshold (ms)
  195. discTime: u_long; // Disconnect (ms)
  196. nMSLinkTurn: u_short; // Link turn around (ms)
  197. nTXPackets: u_char; // Number packets in transmit window
  198. nRXPackets: u_char; // Number packets in receive window
  199. end;
  200. {$EXTERNALSYM LM_IRPARMS}
  201. PLM_IRPARMS = ^LM_IRPARMS;
  202. TLmIrParms = LM_IRPARMS;
  203. PLmIrParms = PLM_IRPARMS;
  204. _SOCKADDR_IRDA = record
  205. irdaAddressFamily: u_short;
  206. irdaDeviceID: array [0..3] of u_char;
  207. irdaServiceName: array [0..24] of Char;
  208. end;
  209. {$EXTERNALSYM _SOCKADDR_IRDA}
  210. SOCKADDR_IRDA = _SOCKADDR_IRDA;
  211. {$EXTERNALSYM SOCKADDR_IRDA}
  212. PSOCKADDR_IRDA = ^SOCKADDR_IRDA;
  213. {$EXTERNALSYM PSOCKADDR_IRDA}
  214. LPSOCKADDR_IRDA = ^SOCKADDR_IRDA;
  215. {$EXTERNALSYM LPSOCKADDR_IRDA}
  216. TSockAddrIrda = SOCKADDR_IRDA;
  217. PSockAddrIrda = LPSOCKADDR_IRDA;
  218. _WINDOWS_IRDA_DEVICE_INFO = record
  219. irdaDeviceID: array [0..3] of u_char;
  220. irdaDeviceName: array [0..21] of Char;
  221. irdaDeviceHints1: u_char;
  222. irdaDeviceHints2: u_char;
  223. irdaCharSet: u_char;
  224. end;
  225. {$EXTERNALSYM _WINDOWS_IRDA_DEVICE_INFO}
  226. WINDOWS_IRDA_DEVICE_INFO = _WINDOWS_IRDA_DEVICE_INFO;
  227. {$EXTERNALSYM WINDOWS_IRDA_DEVICE_INFO}
  228. PWINDOWS_IRDA_DEVICE_INFO = ^WINDOWS_IRDA_DEVICE_INFO;
  229. {$EXTERNALSYM PWINDOWS_IRDA_DEVICE_INFO}
  230. LPWINDOWS_IRDA_DEVICE_INFO = ^WINDOWS_IRDA_DEVICE_INFO;
  231. {$EXTERNALSYM LPWINDOWS_IRDA_DEVICE_INFO}
  232. TWindowsIrdaDeviceInfo = WINDOWS_IRDA_DEVICE_INFO;
  233. PWindowsIrdaDeviceInfo = LPWINDOWS_IRDA_DEVICE_INFO;
  234. _WCE_IRDA_DEVICE_INFO = record
  235. irdaDeviceID: array [0..3] of u_char;
  236. irdaDeviceName: array [0..21] of Char;
  237. Reserved: array [0..1] of u_char;
  238. end;
  239. {$EXTERNALSYM _WCE_IRDA_DEVICE_INFO}
  240. WCE_IRDA_DEVICE_INFO = _WCE_IRDA_DEVICE_INFO;
  241. {$EXTERNALSYM WCE_IRDA_DEVICE_INFO}
  242. PWCE_IRDA_DEVICE_INFO = ^WCE_IRDA_DEVICE_INFO;
  243. {$EXTERNALSYM PWCE_IRDA_DEVICE_INFO}
  244. TWceIrdaDeviceInfo = WCE_IRDA_DEVICE_INFO;
  245. PWceIrdaDeviceInfo = PWCE_IRDA_DEVICE_INFO;
  246. IRDA_DEVICE_INFO = WINDOWS_IRDA_DEVICE_INFO;
  247. {$EXTERNALSYM IRDA_DEVICE_INFO}
  248. PIRDA_DEVICE_INFO = ^WINDOWS_IRDA_DEVICE_INFO;
  249. {$EXTERNALSYM PIRDA_DEVICE_INFO}
  250. LPIRDA_DEVICE_INFO = ^WINDOWS_IRDA_DEVICE_INFO;
  251. {$EXTERNALSYM LPIRDA_DEVICE_INFO}
  252. TIrdaDeviceInfo = IRDA_DEVICE_INFO;
  253. PIrdaDeviceInfo = LPIRDA_DEVICE_INFO;
  254. _WINDOWS_DEVICELIST = record
  255. numDevice: ULONG;
  256. Device: array [0..0] of WINDOWS_IRDA_DEVICE_INFO;
  257. end;
  258. {$EXTERNALSYM _WINDOWS_DEVICELIST}
  259. WINDOWS_DEVICELIST = _WINDOWS_DEVICELIST;
  260. {$EXTERNALSYM WINDOWS_DEVICELIST}
  261. PWINDOWS_DEVICELIST = ^WINDOWS_DEVICELIST;
  262. {$EXTERNALSYM PWINDOWS_DEVICELIST}
  263. LPWINDOWS_DEVICELIST = ^WINDOWS_DEVICELIST;
  264. {$EXTERNALSYM LPWINDOWS_DEVICELIST}
  265. TWindowsDeviceList = WINDOWS_DEVICELIST;
  266. PWindowsDeviceList = LPWINDOWS_DEVICELIST;
  267. _WCE_DEVICELIST = record
  268. numDevice: ULONG;
  269. Device: array [0..0] of WCE_IRDA_DEVICE_INFO;
  270. end;
  271. {$EXTERNALSYM _WCE_DEVICELIST}
  272. WCE_DEVICELIST = _WCE_DEVICELIST;
  273. {$EXTERNALSYM WCE_DEVICELIST}
  274. PWCE_DEVICELIST = ^WCE_DEVICELIST;
  275. {$EXTERNALSYM PWCE_DEVICELIST}
  276. TWceDeviceList = WCE_DEVICELIST;
  277. PWceDeviceList = PWCE_DEVICELIST;
  278. DEVICELIST = WINDOWS_DEVICELIST;
  279. {$EXTERNALSYM DEVICELIST}
  280. PDEVICELIST = ^WINDOWS_DEVICELIST;
  281. {$EXTERNALSYM PDEVICELIST}
  282. LPDEVICELIST = ^WINDOWS_DEVICELIST;
  283. {$EXTERNALSYM LPDEVICELIST}
  284. TDeviceList = DEVICELIST;
  285. _WINDOWS_IAS_SET = record
  286. irdaClassName: array [0..IAS_MAX_CLASSNAME - 1] of Char;
  287. irdaAttribName: array [0..IAS_MAX_ATTRIBNAME - 1] of Char;
  288. irdaAttribType: u_long;
  289. case Integer of
  290. 0: (
  291. irdaAttribInt: Longint);
  292. 1: (
  293. Len: u_short;
  294. OctetSeq: array [0..IAS_MAX_OCTET_STRING - 1] of u_char);
  295. 2: (
  296. Len_: u_char;
  297. CharSet: u_char;
  298. UsrStr: array [0..IAS_MAX_USER_STRING - 1] of u_char);
  299. end;
  300. {$EXTERNALSYM _WINDOWS_IAS_SET}
  301. WINDOWS_IAS_SET = _WINDOWS_IAS_SET;
  302. {$EXTERNALSYM WINDOWS_IAS_SET}
  303. PWINDOWS_IAS_SET = ^WINDOWS_IAS_SET;
  304. {$EXTERNALSYM PWINDOWS_IAS_SET}
  305. LPWINDOWS_IAS_SET = ^WINDOWS_IAS_SET;
  306. {$EXTERNALSYM LPWINDOWS_IAS_SET}
  307. TWindowsIasSet = WINDOWS_IAS_SET;
  308. PWindowsIasSet = LPWINDOWS_IAS_SET;
  309. _WINDOWS_IAS_QUERY = record
  310. irdaDeviceID: array [0..3] of u_char;
  311. irdaClassName: array [0..IAS_MAX_CLASSNAME - 1] of Char;
  312. irdaAttribName: array [0..IAS_MAX_ATTRIBNAME - 1] of Char;
  313. irdaAttribType: u_long;
  314. case Integer of
  315. 0: (
  316. irdaAttribInt: Longint);
  317. 1: (
  318. Len: u_long;
  319. OctetSeq: array [0..IAS_MAX_OCTET_STRING - 1] of u_char);
  320. 2: (
  321. Len_: u_long;
  322. CharSet: u_long;
  323. UsrStr: array [0..IAS_MAX_USER_STRING - 1] of u_char);
  324. end;
  325. {$EXTERNALSYM _WINDOWS_IAS_QUERY}
  326. WINDOWS_IAS_QUERY = _WINDOWS_IAS_QUERY;
  327. {$EXTERNALSYM WINDOWS_IAS_QUERY}
  328. PWINDOWS_IAS_QUERY = ^WINDOWS_IAS_QUERY;
  329. {$EXTERNALSYM PWINDOWS_IAS_QUERY}
  330. LPWINDOWS_IAS_QUERY = ^WINDOWS_IAS_QUERY;
  331. {$EXTERNALSYM LPWINDOWS_IAS_QUERY}
  332. TWindowsIasQuery = WINDOWS_IAS_QUERY;
  333. PWindowsIasQuery = LPWINDOWS_IAS_QUERY;
  334. _WCE_IAS_SET = record
  335. irdaClassName: array [0..60] of Char;
  336. irdaAttribName: array [0..60] of Char;
  337. irdaAttribType: u_short;
  338. case Integer of
  339. 0: (
  340. irdaAttribInt: Integer);
  341. 1: (
  342. Len: Integer;
  343. OctetSeq: array [0..0] of u_char;
  344. Reserved: array [0..2] of u_char);
  345. 2: (
  346. Len_: Integer;
  347. CharSet: u_char;
  348. UsrStr: array [0..0] of u_char;
  349. Reserved_: array [0..1] of u_char);
  350. end;
  351. {$EXTERNALSYM _WCE_IAS_SET}
  352. WCE_IAS_SET = _WCE_IAS_SET;
  353. {$EXTERNALSYM WCE_IAS_SET}
  354. PWCE_IAS_SET = ^WCE_IAS_SET;
  355. {$EXTERNALSYM PWCE_IAS_SET}
  356. TWceIasSet = WCE_IAS_SET;
  357. PWceIasSet = PWCE_IAS_SET;
  358. _WCE_IAS_QUERY = record
  359. irdaDeviceID: array [0..3] of u_char;
  360. irdaClassName: array [0..60] of Char;
  361. irdaAttribName: array [0..60] of Char;
  362. irdaAttribType: u_short;
  363. case Integer of
  364. 0: (irdaAttribInt: Integer);
  365. 1: (
  366. Len: Integer;
  367. OctetSeq: array [0..0] of u_char;
  368. Reserved: array [0..2] of u_char);
  369. 2: (
  370. Len_: Integer;
  371. CharSet: u_char;
  372. UsrStr: array [0..0] of u_char;
  373. Reserved_
  374. : array [0..1] of u_char);
  375. end;
  376. {$EXTERNALSYM _WCE_IAS_QUERY}
  377. WCE_IAS_QUERY = _WCE_IAS_QUERY;
  378. {$EXTERNALSYM WCE_IAS_QUERY}
  379. PWCE_IAS_QUERY = ^WCE_IAS_QUERY;
  380. {$EXTERNALSYM PWCE_IAS_QUERY}
  381. TWceIasQuery = WCE_IAS_QUERY;
  382. PWceIasQuery = PWCE_IAS_QUERY;
  383. IAS_SET = WINDOWS_IAS_SET;
  384. {$EXTERNALSYM IAS_SET}
  385. PIAS_SET = ^WINDOWS_IAS_SET;
  386. {$EXTERNALSYM PIAS_SET}
  387. LPIASSET = ^WINDOWS_IAS_SET;
  388. TIasSet = IAS_SET;
  389. PIasSet = PIAS_SET;
  390. {$EXTERNALSYM LPIASSET}
  391. IAS_QUERY = WINDOWS_IAS_QUERY;
  392. {$EXTERNALSYM IAS_QUERY}
  393. PIAS_QUERY = ^WINDOWS_IAS_QUERY;
  394. {$EXTERNALSYM PIAS_QUERY}
  395. LPIASQUERY = ^WINDOWS_IAS_QUERY;
  396. {$EXTERNALSYM LPIASQUERY}
  397. TIasQuery = IAS_QUERY;
  398. PIasQuery = PIAS_QUERY;
  399. implementation
  400. end.