1

Possible Duplicate:
End of response to an AT command

I'm trying to work with a CDMA modem and I'm having issues with knowing when a response is over. Currently I'm simply setting a timeout for each command. However, I just switched to a new modem (same model) and everything is taking a different amount of time. There has to be a better way to handle this.

The manual says it has 'Hardware Handshaking' and lists the following pins for the UART: RXD, DSR, CTS, RING, DCD, TXD, DTR, and RTS. TXD and RXD are obvious. I assume that RTS and CTS have more to do with the available serial buffer than they do with command execution and DCD (Data carrier detect) and RING have to do with the cell connection itself. Would DTR be an indicator that the modem is sitting idle?

Is there some other in-band way of knowing that the modem has sent all that it is going to?

For the really brave/helpful, here's a link to the manual: http://www.janus-rc.com/Documentation/terminus_cf_user_guide.pdf

Community
  • 1
  • 1
azdle
  • 2,139
  • 4
  • 17
  • 23
  • Also you might have a look at this answer: http://stackoverflow.com/a/13286581/694576 – alk Dec 04 '12 at 13:10

1 Answers1

1

It's been a long time, but as far as I remember, the modem should confirm every AT command by sending an "OK" as response when the command was processed. So your best bet would be to listen for this. Of course you should as well define a timeout when waiting for the response, but you do not depend on exact timing then.

mbelow
  • 1,093
  • 6
  • 11
  • The issue there is that, while some do respond with an 'OK', some commands respond with /something/ else and I need to wait for all of it. – azdle Dec 03 '12 at 23:14
  • OK, I see. But isn't there some kind of pattern that you could look out for on these responses? – mbelow Dec 03 '12 at 23:42