Re: belkin usb serial converter (mct_u232), break not working

From: Paul Fulghum
Date: Wed Oct 20 2004 - 16:38:04 EST


On Wed, 2004-10-20 at 13:46, Thomas Stewart wrote:
> I'm having trouble with a Belkin USB serial adapter, I can't get it to send a
> break down the serial cable to a console.
>
> I made a quick program to send a break to a port (mostly ripped off from
> minicom).
>
> porttest.c:
> #include <sys/fcntl.h>
> #include <sys/ioctl.h>
> main () {
> int fd = open("/dev/ttyS0", O_RDWR|O_NOCTTY);
> ioctl(fd, TCSBRK, 0);
> close(fd);
> }
>
> Both minicom and my program send a break fine to a regular pc serial port (eg
> ttyS0). In this case it drops my sun box to an "ok" prompt.
>
> However if I use the usb serial adapter both minicom and my program are unable
> to send breaks, they just seem to get ignored.

I was too quick (and wrong!) on my previous response.
I was thinking of TIOCSBRK (turn on break and leave on),
not TCSBRK (turn on break for ~250ms).

My suggestion about timing may still be valid.

Try replacing ioctl(fd, TCSBRK, 0) with
ioctl(fd, TCSBRKP, duration)
duration is in 100ms units, so try 10 or 20.

Or you can use tcsendbreak(fd, duration);
I'm not sure of the units for this function on Linux
manpage says 'implementation defined',
a book I have says 250ms units in Linux.

--
Paul Fulghum
paulkf@xxxxxxxxxxxxx

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/