Using select to detect DCD changes

Using select to detect DCD changes

Post by Mike Wingstro » Thu, 21 Aug 1997 04:00:00



Hi! All,

I am trying to control a serial device that uses DCD to indicate an
internal status independent of the serial trafic through the port. I
also must handle stdin, stdout and multiple sockets so I am using the
select function.  This all works fine. However, now I want to add the
detection of changes in Carrier Detect to the mix and I am having
problems because of the lack of documentation.

I have removed 'CLOCAL' from my setup and added an appropriate bit array
to the 'exception' parameter in the select statement. When DCD changes
the select reports it just fine but then reports it and reports it and
...  

So, How do I tell the system that I am acknowledgeing the change and
have it wait for the next change? I have searched the source of serial.c
and have found where the change is reported but I can't determine why I
am receiving continious exception reports.

Another thing I noticed is that when the DCD exception is reported I
also get a report on the serial input having characters available. When
read they always turn out to be 0x00, 0xef. My device isn't sending
them:-( Where are they coming from?

TIA...Mike Wingstrom
Adaptive Systems, Ltd.

 
 
 

Using select to detect DCD changes

Post by Mike Wingstro » Fri, 22 Aug 1997 04:00:00


Hi! All,

I am trying to control a serial device that uses DCD to indicate an
internal status independent of the serial trafic through the port. I
also must handle stdin, stdout and multiple sockets so I am using the
select function.  This all works fine. However, now I want to add the
detection of changes in Carrier Detect to the mix and I am having
problems because of the lack of documentation.

I have removed 'CLOCAL' from my setup and added an appropriate bit array
to the 'exception' parameter in the select statement. When DCD changes
the select reports it just fine but then reports it and reports it and
..  

So, How do I tell the system that I am acknowledgeing the change and
have it wait for the next change? I have searched the source of serial.c
and have found where the change is reported but I can't determine why I
am receiving continious exception reports.

Another thing I noticed is that when the DCD exception is reported I
also get a report on the serial input having characters available. When
read they always turn out to be 0x00, 0xef. My device isn't sending
them:-( Where are they coming from?

TIA...Mike Wingstrom
Adaptive Systems, Ltd.

 
 
 

1. DCD changed, how to detect?

Is there a way in Linux to check if the DCD (CARRIER) signal has
been changed since the last check. This support is e.g. found in
the OS/2 com drivers and it significantly reduces the CPU time
spent on polling/checking for the DCD signal.

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Compaq-CC On FreeBsd 5.0

3. Select call not able to detect the change in socket fd

4. HELP: invalid shell??

5. select not able detect the change in socket fd

6. tape backup software

7. Help needed to launch ISP service from bedroom

8. Detecting carrier (DCD) loss?

9. How does linux detect hang-up? (DCD?)

10. How to detect DCD on serial port

11. allowing serial port logins when DCD (carrier detect) is not present

12. How does linux detect hang-ups? (DCD?)