org.apache.mina.transport.serial
Class SerialAddress

java.lang.Object
  extended by java.net.SocketAddress
      extended by 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
static class SerialAddress.DataBits
           
static class SerialAddress.FlowControl
           
static class SerialAddress.Parity
           
static class SerialAddress.StopBits
           
 
Constructor Summary
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
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 Unix
bauds - baud rate for the communication
dataBits - number of data bits per bytes
stopBits - number of stop bits
parity - parity used
flowControl - 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

toString

public String toString()
Convert this serial address to a human readable string.

Overrides:
toString in class Object


Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.