On 25/09/2006, at 9:55 AM, Michael Chesterton wrote:

James Gray <[EMAIL PROTECTED]> writes:

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 :)

chat can send breaks. Don't know how to drive chat, but at a guess

chat '' BREAK </dev/ttyS0
or
chat '' -BREAK- </dev/ttyS0

I think what's really happening is when you unplug the cable, you
lower DTR (not sure if a break does that), so lowering DTR (and I
guess RTS, if it's high) will probably do what you want.

If you have trouble working out how to lower DTR, I can have a go at a
little C program.

The hard-core geek within wants a C/C++ program for this, but then reality kicks in and if there's something off the shelf that will do what's necessary I'll go with that :) I can't test any of the suggestions yet as I need to wait for the unit to go awry and then start poking around.

Cheers,

James


--
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