Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 May 1999 11:37:56 -0700
From:      Mike Smith <mike@smith.net.au>
To:        Max Gotlib <max@cca.usart.ru>
Cc:        hackers@freebsd.org
Subject:   Re: Serial ports programming 
Message-ID:  <199905271837.LAA01313@dingo.cdrom.com>
In-Reply-To: Your message of "Thu, 27 May 1999 11:57:41 %2B0600." <Pine.LNX.3.95.990527114907.31382B-100000@linux.cca.usart.ru> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Hi!
> 
> Some days ago I've faced with the following problem:
> I need some kind of action (while coding user space
> program actively handling the serial port) to get
> sure all the bytes I've wrote to it are _transmitted_.
> I know about "ioctl(fd, TIOCDRAIN)", but this ioctl
> is accomplished with tty buffers draining to (probably)
> FIFO buffer of the serial port. Is there any (portable
> preferably) way to get an acknolege or to block until
> FIFO buffer is cleared? The situation is that I can't
> simply write additional 64 bytes (I did not see any
> serial ports with FIFO larger than 64 bytes) and
> drain the tty buffers - I have to catch the exact
> moment ...

You could close the device, but that may have an adverse effect on your 
application, as it will drop DTR.

There is no other way, no.

-- 
\\  The mind's the standard       \\  Mike Smith
\\  of the man.                   \\  msmith@freebsd.org
\\    -- Joseph Merrick           \\  msmith@cdrom.com




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905271837.LAA01313>