Re: modem programming - need help immediately

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

 



On 09:12 16 Nov 2003, srinath c <sri_nathc@xxxxxxxxx> wrote:
| After writing a modem command to the modem, the reply is not just OK.  It has 2 '\n' following it and 2-3 '\n' preceeding it.  Why is this??? Ex:
|   write:   "ATZ\rATX3\r"
|   read: "ATZ\n\nOK\n\nATX3\n\n\nOK\n\n"

The modem is actually ending its lines with CR then NL (\r and then \n).
You have not put the tty in raw mode, and so the OS's tty layer is
translating CR into NL, thus the apparent double NL.  The preceeding
double NL comes from the "ATZ\r\n" with is the modem echoing your typing
(well, your write) for you. You want to turn off the crnl translation
(see stty and termios manual entries) and probably turn of the modem's
echo with an ATE0 command.

Cheers,
--
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

>From a programmer's point of view, the user is a peripheral that types
when you issue a read request.  - Peter Williams


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux