Package org.apache.mina.transport.serial
Class SerialAddress
- java.lang.Object
-
- java.net.SocketAddress
-
- org.apache.mina.transport.serial.SerialAddress
-
- All Implemented Interfaces:
Serializable
public class SerialAddress extends SocketAddress
An address for a serial port communication.- Author:
- Apache MINA Project
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SerialAddress.DataBits
The number of data bits per bytestatic class
SerialAddress.FlowControl
The Flow control flagsstatic class
SerialAddress.Parity
The error detection parity in usestatic class
SerialAddress.StopBits
Stop bits in use
-
Constructor Summary
Constructors Constructor Description SerialAddress(String name, int bauds, SerialAddress.DataBits dataBits, SerialAddress.StopBits stopBits, SerialAddress.Parity parity, SerialAddress.FlowControl flowControl)
Create an address for a serial communication, associating a serial interface and various serial signal carcteristics.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBauds()
Bauds rate for the communication.SerialAddress.DataBits
getDataBits()
Number of data bits for each communicated bytes.SerialAddress.FlowControl
getFlowControl()
The flow control policie used for this communication.String
getName()
The name of the device.SerialAddress.Parity
getParity()
The parity check for this communication.SerialAddress.StopBits
getStopBits()
Number of stop bits used.String
toString()
Convert this serial address to a human readable string.
-
-
-
Constructor Detail
-
SerialAddress
public SerialAddress(String name, int bauds, SerialAddress.DataBits dataBits, SerialAddress.StopBits stopBits, SerialAddress.Parity parity, SerialAddress.FlowControl flowControl)
Create an address for a serial communication, associating a serial interface and various serial signal carcteristics.- Parameters:
name
- name of the device, COM1 COM2 for Windows, /dev/ttyS0 for Unixbauds
- baud rate for the communicationdataBits
- number of data bits per bytesstopBits
- number of stop bitsparity
- parity usedflowControl
- flow control used
-
-
Method Detail
-
getBauds
public int getBauds()
Bauds rate for the communication.- Returns:
- the bauds (bits per seconds) for this serial link
-
getDataBits
public SerialAddress.DataBits getDataBits()
Number of data bits for each communicated bytes.- Returns:
- the data bits
-
getFlowControl
public SerialAddress.FlowControl getFlowControl()
The flow control policie used for this communication.- Returns:
- the flow control
-
getName
public String getName()
The name of the device. Can be COM1, COM2, /dev/ttyS0, /dev/ttyUSB1, etc..- Returns:
- name
-
getParity
public SerialAddress.Parity getParity()
The parity check for this communication.- Returns:
- parity type
-
getStopBits
public SerialAddress.StopBits getStopBits()
Number of stop bits used.- Returns:
- stop bits number
-
-