|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.wimpi.modbus.net.SerialConnection
public class SerialConnection
Class that implements a serial connection which can be used for master and slave implementations.
| Field Summary | |
|---|---|
private boolean |
m_Open
|
private SerialParameters |
m_Parameters
|
private gnu.io.CommPortIdentifier |
m_PortIdentifyer
|
private InputStream |
m_SerialIn
|
private gnu.io.SerialPort |
m_SerialPort
|
private ModbusSerialTransport |
m_Transport
|
| Constructor Summary | |
|---|---|
SerialConnection(SerialParameters parameters)
Creates a SerialConnection object and initilizes variables passed in as params. |
|
| Method Summary | |
|---|---|
void |
close()
Close the port and clean up associated elements. |
ModbusTransport |
getModbusTransport()
Returns the ModbusTransport instance to be used for receiving and sending messages. |
gnu.io.SerialPort |
getSerialPort()
Returns the reference to the SerialPort instance. |
boolean |
isOpen()
Reports the open status of the port. |
void |
open()
Opens the communication port. |
void |
serialEvent(gnu.io.SerialPortEvent e)
|
void |
setConnectionParameters()
Sets the connection parameters to the setting in the parameters object. |
void |
setReceiveTimeout(int ms)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private SerialParameters m_Parameters
private ModbusSerialTransport m_Transport
private gnu.io.CommPortIdentifier m_PortIdentifyer
private gnu.io.SerialPort m_SerialPort
private boolean m_Open
private InputStream m_SerialIn
| Constructor Detail |
|---|
public SerialConnection(SerialParameters parameters)
parameters - A SerialParameters object.| Method Detail |
|---|
public gnu.io.SerialPort getSerialPort()
public ModbusTransport getModbusTransport()
public void open()
throws Exception
Exception - if an error occurs.public void setReceiveTimeout(int ms)
public void setConnectionParameters()
throws Exception
Exception - if the configured parameters cannot be set properly
on the port.public void close()
public boolean isOpen()
public void serialEvent(gnu.io.SerialPortEvent e)
serialEvent in interface gnu.io.SerialPortEventListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||