Question: Turbo C and communication
Thomas Lapp
thomas at mvac23.UUCP
Thu Aug 31 11:03:14 AEST 1989
> Nf-From: s.cs.uiuc.edu!mccaugh Aug 25 02:17:00 1989
> Responding to: thomas at mvac23.UUCP re: Turbo-C and comm
> >However, when the program exits, it lowers DTR as part of it's cleanup (I'm
> >talking previously hacking in BASIC). This is no good, since the dial command
> >goes out and before anything happens, DTR goes low killing the modem.
>
> >Background: I am using a terminal emulator which operates in block mode.
> >However the modem can't handle a string which ends in an XOFF rather than
> >a carriage return. So.... I though I would write a 'dialer' program which
> >would dial the modem, then exit and start the emulation program so that it
> >is ready by the time the modem connects. So while going from the dialer
> >program to the emulator, DTR has to stay high (so that the modem doesn't
> >hang up).
>
> > The question: Can I do this with Turbo C? Do I have control over those
> > bits in the 'modem port' of the PC?
>
> The answer is definitely yes, you can do this in Turbo-C, but first, what
> confuses me is that you say: "I thought I would write a 'dialer' program
> which would ... then exit and start the (terminal) emulation program...";
> then later on: "so while going from the dialer ..., DTR has to stay high",
> but initially, you reported: "when the program exits, it lowers DTR". It
> sounds like your own 'dialer' program is lowering the DTR upon exit to the
> emulator...what are you doing to make this happen?
Sorry for the confusion. The program which lowers DTR when it exits is the
BASIC hack I put together. The BASIC interpreter lowers DTR when it exits
to the system.
My interest is to try the same thing in Turbo C with the hope that I could
leave DTR high when I exited back to the Operating system. So the (not-yet-
written) C program would raise DTR, send dial command to the modem, and
exit. In a batch 'shell' I call the Turbo-C 'dialer' program, then
immediately call the terminal emulater so that it is in place before the
remote modem answers :-).
>From what I've been hearing, I think it can be done. But since I am new
at C programming, I think this may not be an exercise for the novice
student. Maybe I'll try something simpler first and work up to it :-)
- tom
internet: mvac23!thomas at udel.edu or thomas%mvac23 at udel.edu
uucp : {ucbvax,mcvax,psuvax1,uunet}!udel!mvac23!thomas
Location: Newark, DE, USA
Quote : NOTICE: System will have a scheduled disk crash at 4:45pm today.
More information about the Comp.lang.c
mailing list