Technical information
Cterm Serial Solutions
the same byte as the end of file character as a legitimate piece
of data.
On put, the specified file is sent to the serial port. Unless
the ānā switch is used the file is translated in exactly the same
way that characters typed at the keyboard are. The end of file
character, possibly after a translation, is sent to the serial port.
The transfer can be halted by pressing a key at any stage.
On get, the serial port is read and the characters received
are written to the file specified. If the ānā switch is present the
characters are not translated on input. If an end of file character
is present the transfer continues until that character is read,
otherwise a five second timeout is used. The end of file
character is not carried over to the file. The transfer can be
halted by pressing a key at any stage.
Examples:
g file1.txt 26
Read data into file1.txt until character 26, CTRL-Z, is
received.
u file2.exe n
Send file2.exe, do not translate, and add no termination
characters.
g file3.tmp n
Read file3.tmp, do not translate, stop if no data arrives for
five seconds.
The CTERM Serial Connection.____________________________
This section will look at the parts of CTERM that access
the serial port and so explain how any C program could use the
serial port with NewCOM. The use of the serial port is quite
straight- forward, as NewCOM does most of the hard work.
Quick Summary._______________
To send and receive characters to an from a serial port in
C use the following functions.
FILE *com; /* Create a file variable */
.
Chapter 7 Page 117