ComD v0.2. p  COM p⮬ p IP.
(c) 2001 by madded2.

* v0.1 - initial
* v0.2 - break added
--


comd.exe - , ᪠     COM-p⮬.
 pp. p p⠥ ⮫쪮  1 p⮬.   p tcp/9990.
p 室  , ᫨ 㦥  p ⠭ ᮥ,
p . - TCP - 3 .  p  ⥭ 
 p  600 kb -  砩 p ⥭    p,
  ip .


comd_cli.dll -   裡  p  comd.
 ᮣ襭  맮 - 32  Cdecl, ⠭p .

㭪:
   Comd_open(const host:PChar;
		   port_N:Long;
		   speed:Long;
		   dlen:Long;
		   parity:Long;
		   stop:Long;
		   signals:Long;
                   break_ms:Long):Long;
   p 200.
   host - 㪠⥫  ASCIIZ p    ip pᮬ -pp;
   port_N - p p (1 - com1, 2 - com2...);
   speed - ᪮p p;
   dlen - ᪮쪮   (8, 7 );
   parity - ⭮ (. inf  㫪  ASYNC ioctl);
   stop - ⮯  (. inf  㫪  ASYNC ioctl);
   signals - bit0 = DTR, bit1 = RTS;
   break_ms - p  ᥪ㭤 ᪮쪮  뤠   Break,
              ᫨ 0 -  뤠.

   p頥:
   0  - all ok
  -1 - misc tcp error             \
  -2 - hostname resolving error    |
  -3 - connection refused          | 訡 裡 tcp
  -4 - tcp send error              |
  -5 - answer timeout error        |
  -6 - tcp read error             /
   1 - port open error            \
   2 - port set parameters error   | 訡 p  p⮬
   3 - port set signals error     /


   Comd_close:Long;
   p 203.

   p뢠 ᮥ. p頥 ᥣ 0.


   Comd_read(var buf; buflen:Long):Long;
   p 201.

   ⠥   buf pp buflen. p頥 ⢮ p⠭
   . ᫨ <= 0 - 訡 tcp  ⠩.  - 3 .
 !! H ᫥ 뢠      p  tcp ⥪.
     㪠뢠  buflen ᨬ pp 襣 p,  p頥
   㭪  易⥫쭮 ⠪ ᫮ ⮢,  ⮫쪮 ᪮쪮 .


   Comd_write(var buf; buflen:Long):Long;
   p 202.

      buf pp buflen. p頥 ⢮ ᫠ .
   ᫨ <= 0 - 訡 tcp.


comd_term.exe  comd_term.pas - ⮢ pp, 㤠 p.
