Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, everybody. I'm traying to make a program to send AT commands to my PCI internal modem.
I tried with the following command:

ECHO ATDT0445534567898 > COM3

but nothing happened (COM3 is the serial port which is shown when I look for modem properties)

So I developed this program on the old Borland TurboC 3.0 compiler:

#include<bios.h>
#include<stdio.h>
#include<dos.h>


#define COM1 0
#define COM2 1
#define COM3 2


#define READY 0x100
#define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00)
/*baud 1200
7 data bits
no parity
1 stop bit*/



void main()
{

int status,i,x=17;
char *atcommand="ATDT0445534567898";


bioscom(0, SETTINGS, COM3);


status = bioscom(3, 0, COM3);

if (status & READY)
{
for(i=0;i<x;i++)>
{
bioscom(1, atcommand[i], COM3);
}
}
}


Again, nothing happened. Debuging the program, seems like it is really sending characters one by one to that port but
none dialing action is done. I tried with "ATDT0445534567898;" (I mean, an ending ";" of the AT command), but
it did not work.

I want to make it the simplest it can be. I run it on a DOS environment, but it didn´t work.
Dos environment comes from the "cmd" DOS emulation program which comes along with Windos Xp.
However I've run the same program in an old MS-DOS OS computer too, with same results.

Actually, as far as I know, AT commands are interpreted entirely by modem, so none software module (of Windos XP Os or
modem driver) should be involved. Therfore, I think that sendig directly the corresponding AT commands to the modem
should be enough.

The modem is working fine since the same AT command works perfectly using Hyperteminal.

So I'd like to know what´s going on.

Thanks on advance
Posted

1 solution

Bioscom is truly a time warp.
You are not sending carriage return.

Try:

C++
int status,i,x=18;
 char *atcommand="ATDT0445534567898\r";


See here:
http://www.abecedarical.com/timewarp/timewarp_dos_08.html[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900