Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Telepathy Communications Library - <b>tp_open()</b> - open serial port http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   tp_open() - open serial port

   nError := tp_open(nPort, [nIsize], [nOsize], [nBaud],  [nData],
       [cParity], [nStop])

   nPort       Serial port number.
   nIsize      Input buffer size, default 1536.
   nOsize      Output buffer size, default 1536.
   nBaud       Baud rate, default 1200.
   nData       Number of data bits, default 8.
   cParity     Parity setting, default "N".
   nStop       Number of stop bits, default 1.

   Returns     Error code.

   Opens a serial port.  Each port must be opened before it can be used
   for I/O.

   nPort is the port number, from 1 to 8.  Ports 1 and 2 correspond to
   DOS devices COM1 and COM2.  Ports 3 and 4 correspond to COM3 and
   COM4, which are not standard DOS devices on most systems.  Ports 5
   through 8 are initially unassigned, but can be set up for nonstandard
   serial ports by the tp_setport() function.

   nIsize and nOsize are the sizes of the input and output buffers.
   They may range from 32 to 64999 bytes.  The default is 1536 (1-1/2K)
   bytes for each.

   nBaud, nData, cParity, and nStop are the initial baud rate, number of
   data bits, parity setting, and number of stop bits.  The defaults are
   1200 baud, 8 data bits, "N" (no parity), and 1 stop bit.

   Example:

       tp_open(1, NIL, NIL, 9600, 8, "N", 1)
           // Default buffer sizes.

See Also: tp_close() tp_reopen() tp_setport()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson