Re: Interrupt-driven serial comm for Linux ?
- From: "mpv" <nospam@xxxxxxxxxxx>
- Date: Fri, 30 May 2008 16:59:06 +0200
Hi,
Thank you for your response!
"Jens Thoms Toerring" <jt@xxxxxxxxxxx> schreef in bericht
news:6aafsvF35lebrU1@xxxxxxxxxxxxxxxxxxxx
mpv <nospam@xxxxxxxxxxx> wrote:
I have actually tried this (of course), and I am consistently only readingAll Linux libraries and tutorials / How To's that I have seen (and that
is
dozens by now!) use unbuffered communication. That means that at this
baudrate and without handshaking, all incoming data beyond the UART's
FIFO
is lost!
How that? I have read lots of data (definitely more that the
FIFOs buffer size) from the serial port without losing bits.
The existing driver for the serial port should take care of
buffering the data coming in until you read them. So did you
actually try to read from the device file for the serial port
or is this only a theoretical conclusion?
15 bytes of data. This seems very close to the 16 bytes that is the size of
the FIFO. There is linux serial port support for an earlier device that we
sell, but that device uses hardware handshaking. The serial port driver will
then signal the device to wait before sending the next bytes. I do not
believe I am doing anything wrong, as the 15 first bytes that I get are the
correct ones.
Please note that some of the howto's you will find on the
net seem to be of dubious quality. If I remember correctly,
the "Serial Programming Guide for POSIX Operating Systems"
was the one one had to look out for, it's at
http://www.easysw.com/~mike/serial/serial.html
I had found this one, and also thought it was the best one. Nothing on event
driven stuff, however.
The only thing I guess you will be mising is some
kind of callback mechanism. But that shouldn't be a problem if
your GUI framework allows you to e.g. install a handler that
always gets called when there's nothing to do and in which you
can check if there's something to read from the serial port
(use the select(2) function) and read the available data with
read(2) if there are.
I will look into this, I have worked with idle handlers before (with Delphi)
regards, Matt
.
- Follow-Ups:
- Re: Interrupt-driven serial comm for Linux ?
- From: Jens Thoms Toerring
- Re: Interrupt-driven serial comm for Linux ?
- From: Grant Edwards
- Re: Interrupt-driven serial comm for Linux ?
- References:
- Interrupt-driven serial comm for Linux ?
- From: mpv
- Re: Interrupt-driven serial comm for Linux ?
- From: Jens Thoms Toerring
- Interrupt-driven serial comm for Linux ?
- Prev by Date: Re: Interrupt-driven serial comm for Linux ?
- Next by Date: Re: Interrupt-driven serial comm for Linux ?
- Previous by thread: Re: Interrupt-driven serial comm for Linux ?
- Next by thread: Re: Interrupt-driven serial comm for Linux ?
- Index(es):
Relevant Pages
|
|