Detecting line break condition

Detecting line break condition

Post by Jon C. Say » Wed, 24 Mar 1999 04:00:00



I am programming an RS232 interface on Solaris x86.  The first problem was
that tcsendbreak() only allows you to send a break for one duration,
between 0.25 and 0.5 seconds.  My interface spec specifically says to send
it for 1.5 seconds.  No can do, why the heck did they place this weird
restriction?  I have programmed an embedded UART on an inhouse PCI board
in Solaris x86 and it was trivial to add a user defined timeout.  So, I
guess I have to live with it.

My next problem is that the receiving device is supposed to return a line
break.  I have this running on OS/2 and it sends and detects line breaks just
fine.  However, I do not see the returned line break on Solaris x86, just
the character that comes next.  I have IGNBREAK and BRKINT both cleared so
I should see the break as a 0x0 NULL character, but I don't.  Is there
anything else that I need to do to see the break character, or is there
another method I can use (ioctl?) to check for it?

Thanks,
Jon

 
 
 

Detecting line break condition

Post by Tony O'Brya » Wed, 24 Mar 1999 04:00:00



> I am programming an RS232 interface on Solaris x86.  The first problem was
> that tcsendbreak() only allows you to send a break for one duration,
> between 0.25 and 0.5 seconds.  My interface spec specifically says to send
> it for 1.5 seconds.  No can do, why the heck did they place this weird
> restriction?  I have programmed an embedded UART on an inhouse PCI board
> in Solaris x86 and it was trivial to add a user defined timeout.  So, I
> guess I have to live with it.

The man page on my Linux system says that tcsendbreak() sends a break
signal for (N * duration) seconds, where 0.25 <= N <= 0.50.  This means
you can set the approximate duration of the break signal in the
parameter list.  You're not guaranteed exact timing, but it will be
close enough to not matter under most circumstances.

I don't know how to detect an incoming line break.

 
 
 

1. Any way to fully control BREAK condition on an RS232 line?

Hi;

In porting some software to Linux which makes "strange" use of the RS-232 TX
line (to achieve in-place flashing of a PIC controller on the device
connected to the serial port), it is necessary for me to fully control the
BREAK condition of an RS-232 serial line. Due to the nature of this device,
it is not enough to be able to send a break for specified period of time (as
the posix function tcsendbreak() should achieve), I need to be able to turn
the BREAK condition ON when I want to, and OFF again explicitly when I want
to.

Is this possible on Linux (perhaps via ioctls to the serial driver?) - or is
there maybe even a posix way to do it? It can be done on both OS/2 and
Windows (the other target platforms of the software being ported), and I
hope you can enlighten me on my options on Linux (I am fairly new to
development on this platform).

Thanks in advance,
   /\/\\ads Orbesen Troest

2. formatting a tape

3. A way to fully control BREAK condition on an RS232 line?

4. X config

5. Where to find text on special Bash conditions : detecting cdrom information

6. Avoid deadlocks when communicating over two pipes

7. Panic on Solaris: Deadlock condition detected: cycle in blocking chain

8. How to install a PC with only SCSI/floppy/CD-ROM but no IDE ?!

9. Using SNMP to detect a HACMP failover condition

10. Standard Method of Handling/Detecting Out of Virtual Memory condition

11. cannot detect too many processes condition

12. How To Detect A 'Out Of Paper' Condition

13. Telnets/rlogins breaks under certain conditions