[comp.sys.apple2] Dialing through Modem

STEIN@UCONNVM.BITNET (Alan Stein) (02/13/91)

The following program, written in Orca/C, was supposed to dial a phone
through my modem, but just printed "+++atdp18009991234" on my screen.

What do I need to do to dial through my modem?

#pragma keep "test"
#include <stdio.h>
#include <orca.h>
#include <stddef.h>
#include <stdlib.h>
#include <texttool.h>
main ()
{
DeviceRec       olddevicerec;
long modemslot=2;
olddevicerec = GetOutputDevice ();
SetOutputDevice (basicType,modemslot);
WriteCString ("+++atdp18009991234");
SetOutputDevice (olddevicerec);
}

 __________________________________________________________
|                                                          |
| Alan H. Stein              | stein@uconnvm.bitnet        |
| Department of Mathematics  |                             |
| University of Connecticut  | Compu$erve  71545,1500      |
| 32 Hillside Avenue         | GEnie       ah.stein        |
| Waterbury, CT 06710        | SNET        (203) 757-1231  |
|__________________________________________________________|

sysadmin@pnet91.cts.com (Matthew Montano) (02/13/91)

STEIN@UCONNVM.BITNET (Alan Stein) writes:
>main ()
>{
>DeviceRec       olddevicerec;
>long modemslot=2;
>olddevicerec = GetOutputDevice ();
>SetOutputDevice (basicType,modemslot);
>WriteCString ("+++atdp18009991234");
>SetOutputDevice (olddevicerec);
>}

Seems ok. Remember several things though.

1) You'll need a carriage return after the command for it to be sent to the 
modem.
2) The default speed on the port might be higher than the speed of your modem.
(Printing to a modem at 9600bps with a 2400bps modem doesn't work).
3) You might want to have the serial port firmware do a reset. This could
bring the DTR up (if it was down), reset the parity, bits, speed to the
settings in the control panel etc.
4) You might be printing to the modem too fast. Some "Hayes Compatibles" can't
accept commands at the full rate their typed. (2400bps modems rarely accept
commands typed at 2400bps!.. they expect some slow-ass typer to type the
commands)... a pause between characters is sometimes helpful.
5) Remember that there needs to be a pause before and after the +'s, and a
pause inbetween for the modem to work.
6) Download John Snow's (John?) SERINT and CSERINT routines. It provides a
very nice, powerful, small "C" interface to the firmware.

I speak from experience with GenericComm v1.0, v2.0 and now v3.0.

Matthew
---
ventureTech Intelligence - We're trying to make computer easy, SOME HOW!
Email: sysadmin@pnet91.cts.com (most mailers won't barf on that..)
My comments aren't even worth a disclaimer...
pnet91 - 416-237-{1204|0308}. 2400bps only. 1200bps if you do hard breaks.
And the further I get from the things that I care about...
The less I care about how much further away I get   -   Robert Smith, 1989