views:

24

answers:

2

Hello everyone!

I have a serial device connected to a linux host. The host will be need to be able to process standard AT commands.

I need to include the standard AT '+++' escape sequence for a serial device..

I haven't had much luck finding code. Anyone know of any open source libraries or code I can take a look at for the actual implementation?

A: 

Have a look at the linux mppp library. It is a modem dialer for Point to Point Protocol and uses the Hayes AT command set. The source code should give you an idea how the commands are handled and implemented.

In fact you might be able to customize mppp to meet your application needs.

http://www.muquit.com/muquit/software/mppp/mppp.html

Amardeep
A: 

There should be an item in /dev for the modem's port (it's been I while since I did unix so forgive me for lacking details). You can just open it like a file. Write to it. Trick with the +++, if you are connected, is that there must be a pause of 1+ sec before and after it - that is how the modem knows you didn't just want to send +++ to the remote end. It will kick you from 'sending data mode' into 'AT command mode'.

But the modem starts out in command mode while you dial.

http://en.wikipedia.org/wiki/Hayes_command_set

there may be libraries of predefined functions to handle dialing, redialing on fail, etc. if you find this too low-level. But this is all I had to work with - eons ago when I last programmed for modem!

FastAl
Yeah thanks for the page. I was looking for some reference code for the whole +++ detection sequence. Would prefer to not have to reinvent the wheel. :)
Tommy