Página 1 de 1

HB_COMIO grav/imp em disp. USB/COM

Enviado: 10 Mar 2014 16:08
por Itamar M. Lins Jr.
Fwd.

Código: Selecionar todos

2014-03-10 18:59 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
  * contrib/hbtcpio/tcpio.c
    * use default timeout defined in initial hostname string in read/write
      operations

  * include/hbapicom.h
  * src/rtl/hbcom.c
    + added new C function:
         int hb_comFindPort( const char * pszDevName, HB_BOOL fCreate );
      It check if given port name is already defined and if not and second
      parameter fCreate is TRUE then it allocates such port in one of last
      free slots. On success port number is returned. If port cannot be
      found or created 0 is returned.

  * include/harbour.hbx
  * src/rtl/hbcomhb.c
    + added new PRG function:
         hb_comFindPort( <cDeviceName> [, <lCreate> = .F. ] ) -> <nPort>

  * contrib/hbplist.txt
  + contrib/hbcomio/comio.c
  + contrib/hbcomio/hbcomio.hbc
  + contrib/hbcomio/hbcomio.hbp
    + added new Harbour FILE IO redirector.
      It recognizes and process names with "COM<n>:" prefix, in form like:
         COM<n>:[<com_params>]
      <n> is port number or port name prefixed with "$" character.
      <com_params> may contain serial port parameters like baud rate, stop
      and data bits, parity and flow control (XON,XOFF,CTS, RTS,DST,DTR).
      As delimiter comma "," is accepted.
      This redirector can be used in different subsystems using Harbour
      FILE IO and stream read/write operations, i.e.
         REQUEST HB_COMIO
         SET PRINTER TO COM2:38400,N81,XONXOFF
      can be used to connect to serial printers.
      Please remember that redirectors like NETIO can be used as wrapper
      to other redirectors so code like:
         pFile := hb_vfOpen( "NET:192.168.0.1:::COM1:9600,8N1" )
      opens 1-st serial port on the server and
         pFile := hb_vfOpen( "NET:192.168.0.1:::COM$/dev/ttyUSB0:9600,8N1" )
      opens "/dev/ttyUSB0" serial device on the server.

best regards
Przemek
Bom p/ testar em Pen Driver, só falta saber como achar o dispositivo USB.

Saudações,
Itamar M. Lins Jr.