[Rd] tty (serial) patch update
Matt Shotwell
shotwelm at musc.edu
Sun May 2 22:30:51 CEST 2010
All,
Just an update on the tty (formerly serial) connection patch I'm working
on. Simon pointed out that a tty connection needed blocking capability
and flow control. These features are added in this patch, with
additional documentation (?tty). Hardware flow control (CTS/RTS, CD,
etc.) would be much more involved (ioctls!), and for little gain, I
think, to those of us who would use a tty connection to collect data
from / control a device with a simple UART.
I'm not sure how to proceed from here. The features available at present
in the tty connection are highly portable (i.e. to Windows). There are
other API elements that could be exposed from the termios.h header for
Linux/OS X, such as canonical mode (designed for human interaction,
block until '\n' received, recognize <del> character and other control
characters, generate interrupts), and input and output processing (e.g.
mapping '\n' to '\r' etc.), but these are definitely not portable, and
not really relevant to the purpose I had envisioned for a tty connection
(which is binary data collection, device control, and other UART
interfaces). Most of the additional features could be reproduced using
interpreted R code with little effort.
So what do you think? Stay portable and expand to Windows? Exploit the
full POSIX termios functionality? Expose connections API and write a
package instead? Forget about the whole thing?
-Matt
Current patch URLs:
http://biostatmatt.com/R/R-2.11.0-tty.patch
http://biostatmatt.com/R/R-2.11.0-tty+conf.patch
http://biostatmatt.com/archives/112
`diffstat -f0 R-2.11.0-tty.patch` :
configure.ac | 2 1 + 1 -
src/include/Internal.h | 2 2 + 0 -
src/library/base/R/connections.R | 11 11 + 0 -
src/library/base/man/connections.Rd | 112 100 + 12 -
src/main/connections.c | 527 527 + 0 -
src/main/names.c | 2 2 + 0 -
6 files changed, 643 insertions(+), 13 deletions(-)
More information about the R-devel
mailing list