Dec 312017
 
Sample communications program written in C for OS/2.
File OS2COM14.ZIP from The Programmer’s Corner in
Category OS/2 Files
Sample communications program written in C for OS/2.
File Name File Size Zip Size Zip Type
OS2COM12.C 8254 2599 deflated
OS2COM14.C 25331 6642 deflated
OS2COMM.EXE 15373 8905 deflated
READ.ME 4344 1892 deflated

Download File OS2COM14.ZIP Here

Contents of the READ.ME file


OS2Comm.c - a simple OS/2 comm program - version 1.4 9/17/88

OS2Comm is the program which accompanies my article "OS/2
Communications" in the Byte Magazine IBM Special Issue 1988. I've
included two versions in this ARC, one (version 1.2) is identical to the
listing in the magazine, the other (version 1.4) has several additional
features. OS2Comm is intended as an example for those who wish to read
(and improve!) its code; it is not really intended to be very useable as
is.

This program uses the multitasking features of OS/2 and the OS/2
communications device driver to provide a simple communications
function. It is not intended to provide complete communications
capabilities, instead it is intended to demonstrate the use of the comm
device driver under OS/2. In particular, it does not provide any
dialing scripts, or other common features of communications software.
It does provide a simple glass TTY terminal function. It also provides
a simple capture file, which will capture every byte which comes in from
the COM port. There is no provision made to allow selective capture,
though.

Version 1.4 of OS2Comm contains several useful additions. First of all,
it has the capability to send an ASCII file to the remote machine.
Press Alt-A or Alt-F to invoke this feature. Either of these will cause
OS2Comm to prompt you for a filespec, then will send the contents of
that file to the remote system. Using Alt-F will cause the file to be
transmitted with no translation. Using Alt-A will cause the file to be
transmitted with Carriage Returns, but no Line Feeds. This (Alt-A) is
the usual mode for performing an "ASCII Upload" to a remote system.

Note: Alt-F is the function which was used to perform the file transfer
performance tests which were reported in the article.

Version 1.4 also contains an XModem receive capability. (No, there is
no corresponding send function.) After preparing the remote system to
send you a file using XModem, press Alt-R and OS2Comm will prompt you
for a filespec. The file will be received using the XModem protocol.

The supplied EXE file is version 1.4 of the program. Version 1.2 is
supplied as source code only.

To use either program, type OS2COMM at the OS/2 prompt,
followed by the port, baud rate, parity, databits, and stopbits, and
optionally a file name for a capture file:

OS2COMM COMx:baudrate,parity,databits,stopbits capture-filename

The format looks much like the MODE command.

For example:

OS2COMM COM1:1200,N,8,1 C:\work\capture.dat

would start communications using 1200 bits per second, no parity,
8 databits, and one stop bit. All received data would be captured
in a file called capture.dat in the \work directory on drive C:.

Once you have started OS2Comm, everything you type is sent to your
modem. Since OS2Comm does not have any facility to place a call under
program control, you must perform this function yourself. The command
to cause Hayes compatible modems to place a data call is "ATDT"
followed by the desired phone number. Note that uppercase is required
for Hayes modem commands.

To end this program, press Alt-X. This will disconnect the phone line
and return you to the OS/2 prompt.

This program will run only in the protected mode of OS/2. It will not
run under DOS.

For those of you who may have an earlier version of OS2Comm, this
version has been updated to use the header files supplied with the
Microsoft C compiler version 5.1. If you are using an earlier version
of the compiler, this code will have to be modified before it will
compile successfully.

Note: Additional remarks on the workings of OS2Comm can be found within
the source code itself.

This program requires the use of the COM0x.SYS device driver in
CONFIG.SYS. Use COM01.SYS for AT class machines. Use COM02.SYS for
PS/2 machines.

If you have comments about this program, I can be reached on BIX as
"jgilliland", and if there is an Opus BBS in your neighborhood, I can
also be found frequenting the OS/2 Echo.

I hope you find this program both instructive and useful. If you are
able to use its concepts as a base for developing a more sophisticated
comm program, that's better yet. Good Luck.

Jim Gilliland.


 December 31, 2017  Add comments

Leave a Reply