public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Fulghum <paulkf@microgate.com>
To: Thomas Stewart <thomas@stewarts.org.uk>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: belkin usb serial converter (mct_u232), break not working
Date: Wed, 20 Oct 2004 16:22:11 -0500	[thread overview]
Message-ID: <1098307331.2818.15.camel@deimos.microgate.com> (raw)
In-Reply-To: <200410201946.35514.thomas@stewarts.org.uk>

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@microgate.com


  parent reply	other threads:[~2004-10-20 21:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-20 18:46 belkin usb serial converter (mct_u232), break not working Thomas Stewart
2004-10-20 20:48 ` Paul Fulghum
2004-10-20 21:22 ` Paul Fulghum [this message]
2004-10-20 22:08   ` Thomas Stewart
2004-10-20 22:15     ` Paul Fulghum
2004-10-20 22:21     ` Paul Fulghum
2004-10-20 22:27     ` Paul Fulghum
2004-10-20 23:04       ` Thomas Stewart
2004-10-21  2:37         ` Paul Fulghum
2004-10-21 10:06           ` Thomas Stewart
2004-10-21 12:41             ` Paul Fulghum
2004-10-21 19:44               ` Paul Fulghum
2004-11-04 18:20                 ` Thomas Stewart
2004-11-04 19:21                   ` Paul Fulghum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1098307331.2818.15.camel@deimos.microgate.com \
    --to=paulkf@microgate.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@stewarts.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox