Sets up the interface parameters.

Description

This is the constructor of the serial interface connection.

Usage

1
2
3
serialConnection(name, port = "com1", mode = "115200,n,8,1",
  buffering = "none", newline = 0, eof = "", translation = "lf",
  handshake = "none")

Arguments

name

optional name for the connection

port

comport name; also virtual com's are supported; maybe USB schould work too

mode

communication mode "<BAUD>, <PARITY>, <DATABITS>, <STOPBITS>"

BAUD

sets the baud rate (bits per second)

PARITY

n, o, e, m, s stands for "none", "odd", "even", "mark" and "space"

DATABITS

integer number of data bits. The value can range from 5 to 8

STOPBITS

integer number of stop bits. This can be "1" or "2"

buffering

"none", for RS232 serial interface, other modes don't work in this case

newline

<BOOL>, whether a new transmission starts with a newline or not.

TRUE or 1

send newline-char according to <translation> befor transmitting

FALSE or 0

no newline

eof

<CHAR>, termination char of the datastream. It only makes sense if <translation> is 'binary' and the stream is a file

translation

each transmitted string is terminated by the transmission character. This could be 'lf', 'cr', 'crlf', 'binary'

handshake

determines the type of handshaking the communication

"none"

no handshake is done

"rtscts"

hardware handshake is enabled

"xonxoff"

software handshake via extra characters is enabled

Details

Linux and Windows behave a little bit different, when utilizing serial com ports. Still, by providing the name (like "COM1" or "ttyS1") and the appropriate settings, the serial interface can be used. Even virtual com ports, like the FTDI usb uart chips will work, as long they map to a standard serial interface in the system.

Value

An object of the class "serialConnection" is returned