Dec 062017
 
C Source for modem routines. Very good for reference and learning.
File COMMC.ZIP from The Programmer’s Corner in
Category C Source Code
C Source for modem routines. Very good for reference and learning.
File Name File Size Zip Size Zip Type
COMM.C 6812 2175 deflated
COMM.DOC 1790 849 deflated
COMM.H 3008 819 deflated
TERM.C 234 186 deflated

Download File COMMC.ZIP Here

Contents of the COMM.DOC file


The following files are part of COMM.ARC:

COMM.C - Used to create a .OBJ which contains all the communications
functions.

COMM.H - File with documentation for functions, and prototypes.

TERM.C - Sample terminal program using the communications functions.


The COMM.C file creates functions for an interrupt-driven communications
handler. The default buffer size is 4K but can be increased to a larger
value by performing the following in your code:

extern int BufSize;

main()
{
BufSize=NewBufferSize;

Please note that the above assignment must be done before the functions
are called to setup the interrupts.

To compile the COMM.C file, using one of the following lines:

MicroSoft:
CL (or QCL) /c COMM.C

Turbo:
TCC -c COMM.C

This will create a COMM.OBJ file which contains the functions. To test
them, compile the TERM.C program as follows:

MicroSoft:
CL (or QCL) TERM.C COMM.OBJ

TurboC:
TCC TERM.C COMM.OBJ

When the above steps are performed, the TERM.EXE file should have been
created. This program is hard coded to work with a modem at 1200 baud
connect to COM1:. Read the .H file for information on changing the
baud or other settings via the PortInit function.

The TERM.EXE program is very simple and will allow you to communicate
with your modem as a dumb terminal. Modem commands like "ATH" to hangup
and "ATDTxxxxxx" to dial are required. Make sure your modem is on and
connected to your computer. If all goes well, characters you type on
the keyboard are sent to the modem, the modem then sends them back via
the COM port, where TERM.EXE will get them back and display them for you.

Mario Giannini
Compuserve ID 76276,1576


 December 6, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)