On 25 Sep 2006, James Gray <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I have a serial-based weather station (LaCrosse 2300) and  
> occasionally it spits the dummy.  Probably more to do with the USB- 
> >RS232 adapter than the weather station, but I've found if I unplug  
> the serial cable from the weather station and plug it back in,  
> everything magically springs back to life.
> 
> So I'm trying to see if sending a break to the serial port will reset  
> the line like my manual cable pulling exercise (after all, unplugging  
> a serial cable by definition is a "BREAK" right?).  So how about it  
> folks?  Anyone know a neat way to send a serial "BREAK" to a serial  
> device in bash/c/c++/perl (no python on the system I'm working  
> with).  I've tried:
> 
> echo "?BREAK?" > /dev/cua.Serial0  [1]
> 
> as root, but no joy.  Any pointers gladly accepted :)

In C:

  tcsendbreak(tty_fd, 0);

should do it.

The manual says

  When /arg/ is non-zero, nobody knows what will happen.

I \heart unix.

-- 
Martin
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to