LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2003, 09:01 PM   #1
ruchika
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Rep: Reputation: 0
Question RING event on the serial port


Hi,

I have a modem that is conencted to serial port of my RedHat Linux machine and I want to listen for RING events on this port. For this, I open the COM port, select the file descriptor and wait for an event to occur. I get the interrupt when I dial my modem, but how can I make sure that select returned because of RING event and not because of some other activity on the serial port?

Thanks,
Ruchika
 
Old 08-25-2003, 09:50 PM   #2
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
configure your modem to report events ("RING" , "NO DIALTONE", etc)
X0

Report basic call progress result codes, i.e., OK, CONNECT, RING, NO CARRIER (also, for busy, if enabled, and dial tone not detected), NO ANSWER and ERROR.

X1 Report basic call progress result codes and connections speeds (OK, CONNECT, RING, NO CARRIER (also, for busy, if enabled, and dial tone not detected), NO ANSWER, CONNECT XXXX, and ERROR.
X2 Report basic call progress result codes and connections speeds, i.e., OK, CONNECT, RING, NO CARRIER (also, for busy, if enabled, and dial tone not detected), NO ANSWER, CONNECT XXXX, and ERROR.
X3 Report basic call progress result codes and connection rate, i.e., OK, CONNECT, RING, NO CARRIER, NO ANSWER, CONNECT XXXX, BUSY, and ERROR.
X4 Report all call progress result codes and connection rate, i.e., OK, CONNECT, RING, NO CARRIER, NO ANSWER, CONNECT XXXX, BUSY, NO DIAL TONE and ERROR.

read strings from the modem until the string "RING" is matched
 
Old 08-26-2003, 04:05 PM   #3
ruchika
LQ Newbie
 
Registered: Aug 2003
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for the reply AltF4.

After select returns, I now read the RX queue, it cotain "RING" and hence I know that select returned because of RING and handle it.

But now I have another question .. I want to dial into a remote PPP server via a Hayes compatible 1X modem when the device connected to the modem gets a ring interrupt. The modem is connected to the serial port of the Linux box. Heres what I do - I open the COM port, select the port and wait for an event to occur. If I get RING event, I close the COM port and run a script that establishes a PPP connection (runs pppd and chat). Whats happening now is that the I am not able to talk to my modem. The chat script sends AT command to the modem but does not get response from the modem. After a few secs, I see alarm FAILED in /etc/ppp/connect-errors file. I think that somehow the COM port is not getting released and so PPP script is not able to talk to the modem. But I may be wrong. Any clues on what might be happening?

I used minicom to talk to the modem and that works fine. The same chat script used to work until I added the "listen on Ring interrupt" feature before starting the PPP script. Thats why I suspect that the problem has to do with the COM port.

BTW, I am running RedHat Linux 9.0 and am using C++ for port handling and a shell script to establish PPP connection.

Thanks for your help.
 
Old 08-28-2003, 02:43 AM   #4
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
try sending a "reset to factory defaults" string (AT&F) or a reset (ATZ) to your modem after you are done waiting for ring
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux serial port to router console port connection? frankie_fix Linux - General 3 02-26-2007 09:32 PM
Using serial port card(PCMCIA) with IPAQ running Linux, can't find ttyS0 port d2army Linux - Laptop and Netbook 0 11-12-2005 08:07 PM
Using an USB port as a standard DB9 Serial Port Lsteele Linux - Newbie 1 10-22-2005 09:48 AM
serial port vasanthraghavan Linux - Hardware 2 02-05-2005 11:55 AM
Serial Port Help puma Linux - Hardware 9 09-04-2003 07:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration