Re: TTY programming
On Tue, Dec 2, 2008 at 9:34 AM, David Baron <firstname.lastname@example.org> wrote:
> I have seen loads of postings but no real answer to this:
> I write() a command to the modem
> I read() to try to get a response, i.e. OK or if the command is a dial, BUSY
> or such.
> I do not get anything.
> The commands, dialing, all seem successful and the application works. I simply
> cannot report any status.
> Any ideas?
You're asking people to debug a program that they have never seen.
That's a tough thing to do.
I have three suggestions:
1. Use strace(1) to trace the system calls your program makes. Then
run minicom under strace(1) and issue the same commands to the modem
manually. Compare the system call traces.
2. Go read the source code for a program (or ideally several) that
does something similar to what you need.
3. Buy the first edition of W. Richard Stevens' book "Advanced
Programming in the Unix Environment". It contains a chapter on tty
programming (featuring a program that does bidirectional communication
with a PostScript printer). Later editions of this book omit that
chapter; TTY programming is hardly mainstream.