Serial IO to the com ports on NT and to device files on Unix can be
achieved using the sequential file statements.
In addition certain control operations can be performed using the IOCTL function.
Serial IO can be handled via the OPENSEQ statement however the OPENSER statement has also been provided.
OPENSER Path,DevInfo| PIPE TO FileVar THEN | ELSE Statements
Path is the pathname of the required device.
DevInfo consists of the following:
||X-ON X-OFF flow control (default)
||no flow control
||input flow control
||output flow control
||7 bit even parity
||7 bit odd parity
||8 bit no parity, (Default)
||8 bit no parity, strip top bit
PIPE specifies the file is to be opened to a PIPE for reading.
The PIPE functionality allows a process to open a PIPE, once opened then the process
can execute a command via the WRITESEQ/SEND statement and then received the result back
via the GET/READSEQ statements.
FileName = "/dev/tty01s"
OPENSER FileName TO File ELSE STOP 201,FileName
WRITESEQ "ls -ail" ON File,"" ;* ONLY for PIPEs
Terminator = CHAR(10)
WaitTime = 4
GET Input SETTING Count FROM File UNTIL Terminator RETURNING TermChar
WAITING WaitTime THEN
CRT "Get Ok, Input ":Input:"
Count ":Count:"TermChar ":TermChar
CRT "Get Timed out Input
":Input:" Count ":Count:" TermChar ":TermChar
WHILE Input NE "" DO