Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!umd5!umbc3!dipto
From: dipto@umbc3.UUCP
Newsgroups: comp.lang.c,comp.sys.ibm.pc
Subject: C code for opening a communications file
Message-ID: <621@umbc3.UMD.EDU>
Date: Fri, 4-Dec-87 20:30:29 EST
Article-I.D.: umbc3.621
Posted: Fri Dec  4 20:30:29 1987
Date-Received: Tue, 8-Dec-87 07:04:17 EST
Reply-To: dipto@umbc3.umd.edu (Dipto Chakravarty)
Organization: University of Maryland, Baltimore County
Lines: 37
Xref: utgpu comp.lang.c:5413 comp.sys.ibm.pc:9226


Expertise needed to open a communications file (COM1) on an IBM PC !!!!!!

My fellow C-pals, I need your help to get  an equivalent of the following 
BASICA code. This code in BASICA works fine as an experiment. However, in
real  life, I am required to  implement the following in Microsoft C 4.0,
for a communications program. 

100 OPEN "COM1:9600, N, 8, 1, RS, CS, DS, CD" AS #1

Above given is the line which opens COM1. The IBM BASIC manual will have 
the detailed descriptions of the options used. For my friends who aren't
in touch with the finer details of BASIC syntax here is a short summary 
of the options used in the above statement.

OPEN	opens an asynchronous communications file
COM1	communications port 1
9600	speed; specifying the transmit/receive bit rate in bits/sec (bps)
N	specifies that there is no Xmit parity; no receive parity checks
8	specifies the number of transmit/receive data bits
1 	specifies the number of stop bits
RS	suppreses RTS (Request To Send)
CS	this option allows user to ignore this line
DS	this option allows user to ignore this line
CD	this option allows user to ignore the Carrier Detect checks

I elaborated on the requirements for people out there, who may know the 
technique, but may not be very familiar, or in touch with Basic. The 
description of the options explain the capability of that program line.
I am not sure whether the RS, CS, DS, CD options actually disable the 
lines from the UART level.  But if possible I would want to avoid the 
complicated task of reprogramming the UART chip. 

Thanks to all of you for reading this.-- 
BITNET : dipto@umbc2	      ------\
ARPANET: dipto@umbc3.UMD.EDU  -------> In-real-life: Dipto Chakravarty
USMAIL : CMSC, UMBC,Md 21228  ------/