[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question: My dial program and HSMODEM



I'm resending this mail to the list,
it seems like the first try did'nt
make it. My apologies if it did.

Ciao!

....

Hej!

To connect my modem to my internetprovider 
I have written a small program that will
call, login ... etc...

I use Bconout(1,value) to send
a char to my modem.
The basic routines is added last in this
mail.
The programs works fine without HSMODEM
and at 19200 baud-rate.

When I run HSMODEM in my autofolder
I'm able to communicate with my modem
if I do:

echo atdtphone-number > /dev/modem2

but not if I use my dial-program.

Question nr 1: What shall I do to make
it work?

If I use a terminal program I'm able
to connect and log in at 115200 baud?
and MintNet works fine at that speed.

Question nr 2: What can I do to change 
the speed from my program or from a
mint-shell-script or from my dial-program?

I use a Falcon 030 with processor running
at 36 mHz, busses at 18 mHz.

TIA,

Reine Jonsson - ljord@connectum.skurup.se
Tel: + 46 (0)414 201 70 Fax: + 46 (0)414 202 81
Homepage: http://www.skurup.se/~ljord


void SendNumber(char nr)
{
	Bconout(1,nr);
	WaitSec();
}

void WaitSec()
{
	long time=clock();

	while ((clock()-time)<10);
}


void WaitCall()
{
	long time=clock();

	while ((clock()-time)<200*15);
}

void SendReturn()
{
	SendNumber('\r');
}


void Dial()
{
	SendString("ATDTplus-phone-number");
}

void SendString(char *s)
{
	short i;
	short len=strlen(s);

	for (i=0;i<len;i++) {
		SendNumber(s[i]);
	}
	SendNumber('\r');
}

void GetAnswer()
{
	long time=clock();
	short tal;

	while (!Bconstat(1) && (clock()-time<100));

	while (Bconstat(1)) {
		tal=Bconin(1);
		printf(".%3c   %5d\n",tal,tal);
	}
}


.............. The End ..........