TTY programming

2008-12-02 Thread David Baron
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?


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: TTY programming

2008-12-02 Thread Nelson Castillo
On Tue, Dec 2, 2008 at 4:34 AM, David Baron [EMAIL PROTECTED] 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?

This code should work:

http://wiki.emqbit.com/how-to-query-a-modem

Regards.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: TTY programming

2008-12-02 Thread James Youngman
On Tue, Dec 2, 2008 at 9:34 AM, David Baron [EMAIL PROTECTED] 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.


James.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: TTY programming

2008-12-02 Thread Ken Irving
On Tue, Dec 02, 2008 at 11:34:05AM +0200, David Baron 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?

Many modems have a quiet or echo mode that can turn on/off output of
status messages, e.g., ATe0 or similar.

Ken

-- 
Ken Irving


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]