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

Re: modem control - some source

Erik wrote:
> On 10-Sep-99 James wrote:
> > hello there,
> >
> >               ok, all i want to do is send stuff to the modem.. for
> > example ATZ and ATDT, then send some chars and recieve some chars.....
> > nothing fancy just simple stuff.....  however it doesn`t seem as easy as
> > just opening /dev/modem and "write"ing to it..... i looked at the
> > minicom code and it is way too complicated for my needs.
> >
> > some example code on how to open and just send some commandes to the
> > modem to get it to dial would be nice....
> >
> I know you can do something like this in bash
> echo ATH2 >> /dev/modem
> and it works. You might also look at chat (which I'd think would be MUCH
> simpler than minicom) or dip.

You can't anymore. I think the change is tied to kernel 2.2.x (and
probably >
2.1.y). Now you must open the device in nonblocking mode and do some
ioctls upon it. I was not happy when I have found it :-(

At http://www.pvtnet.cz/www/pvt.benkovsk/unix/ you can find sources for
program for dialing numbers. It has some code stolen from minicom and
seems to work for me - but beware - it's for dialing only. If you want
more, you should definitely read minicom sources - it is not so hard.

BTW: My program does not lock device - and it should be. It's a bug.

You can also use strace and ltrace when starting minicom to better see
the sequence of steps which it does.