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

Re: modem control

James wrote:

>               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....

Dunno what minicom is doing - but it shouldn't be *much* harder
than opening /dev/modem and writing to it.

Here are some other things that might be going on:

1) Setting up the ioctl to get the desired baud rate, getting
   raw character I/O mode rather than 'cooked', that kind of

2) There are some conventions for creating and testing lock
   files to prevent multiple applications from accessing the
   modem at the same time.

3) Maybe some permissions issues.

4) Minicom mught set up a second thread to talk to the modem
   while the main program does something else.

I'd expect you to need to do some ioctl stuff - the other things
are irrelevent for a quick hack.  Check out 'man termios'.

Steve Baker                  http://web2.airmail.net/sjbaker1
sjbaker1@airmail.net (home)  http://www.woodsoup.org/~sbaker
sjbaker@hti.com      (work)