modem communication

Polytropon freebsd at edvax.de
Sat Dec 15 11:38:27 UTC 2012


On Sat, 15 Dec 2012 04:06:54 -0600 (CST), Robert Bonomi wrote:
> > From owner-freebsd-questions at freebsd.org  Sat Dec 15 03:27:08 2012
> > Date: Sat, 15 Dec 2012 12:54:44 +0330
> > Subject: modem communication
> > From: s m <sam.gh1986 at gmail.com>
> > To: freebsd-questions at freebsd.org
> >
> > my program should work with all modems not a specific one.
> >
> > any hints or comments are really appreciated.
> 
> Open the serial port at the beginning of the 'session', keep it open while
> you do everything needed, then (and only then!) close the serial port.

In addition, depending on how you access the modem, e. g.
via open() or fopen(), you could use the corresponding
flush operation - fsync() - to make sure the commands are
written to the modem port _right now_. There should be no
need to re-open the modem for every AT command you send.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list