Re: Interrupt-driven serial comm for Linux ?
- From: jt@xxxxxxxxxxx (Jens Thoms Toerring)
- Date: 31 May 2008 14:23:33 GMT
mpv <nospam@xxxxxxxxxxx> wrote:
"Wolfgang Draxinger" <wdraxinger@xxxxxxxxxxxxxxxx> schreef in bericht
news:kmd5h5-jdd.ln1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Linux does the proper handling of the UART and buffering for you,
once /dev/ttyS... is opened.
No need for extra libraries.
I don't think so. Why do you think these callback functions / event handlers
/ asynchronous transfer (whatever you want to call it) exist ? Just look at
http://cssl.sourceforge.net and you'll see they are sometimes needed, even
with Linux.
libcssl exists for a different reason. It's main purpose is to
make it easy to read asynchronously when data are available on
the serial port. That may be of interest for a certain type of
application and is feasible since you can request to get a
signal when data are available (but a signal isn't an inter-
rupt). I guess it's only needed when you receive huge amounts
of data at high speed on the one hand and, on the other hand,
can't guarantee to read from the serial port device file often
enough. Of course, there is an upper limit on the amount of
buffering the kernel does (in the order of a few kBytes) and
if that gets exceeded then bytes get lost. Under these rather
special circumstances having the data transfered asynchronous-
ly from the kernels buffer into a user buffer is important.
But that's a detail that hasn't have to do much with dealing
with the underlzing serial port itself. That is all done with-
in the driver for the serial port and you simply don't have
to care. See e.g.
http://www.linux.it/~rubini/docs/serial/serial.html
on how a serial port driver is supposed to work under Linux
(and probably very similar in principle under all kinds of
UNIX). All that's done there is done to make the device file
look like a normal file as much as possible and thus to keep
the application writer from having to spend too much thought
on the underlying details.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.
- References:
- Interrupt-driven serial comm for Linux ?
- From: mpv
- Re: Interrupt-driven serial comm for Linux ?
- From: Wolfgang Draxinger
- Re: Interrupt-driven serial comm for Linux ?
- From: mpv
- 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
|
|