|
|||||||||
| Home >> All >> plp >> [ rs232 overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
plp.rs232
Class RS232

java.lang.Objectplp.rs232.AbstractCommunicationDevice
plp.rs232.RS232
- All Implemented Interfaces:
- CommunicationDevice, java.lang.Runnable
- public class RS232
- extends AbstractCommunicationDevice
- implements java.lang.Runnable
- extends AbstractCommunicationDevice
Implementation of a Communication device. This CommunicationDevice is a serial device, according to the RS232 standard. This class is implemented as a wrapper around the Java COMM API.
| Field Summary | |
(package private) java.io.InputStream |
inputStream
|
private boolean |
isOpened
|
static boolean |
LOG_TO_STDOUT
|
(package private) int |
numberOfBytesSend
|
(package private) java.io.OutputStream |
outputStream
|
(package private) SerialPort |
serialPort
|
| Constructor Summary | |
RS232(java.lang.String serialPort)
Constructor for the RS232 object |
|
| Method Summary | |
void |
addDataListener(DataListener listener)
accessor method for DataListeners, implementation of CommunicationDevice |
protected void |
addNumberOfBytesSend(int numberOfNewBytesSend)
accessor method for numberOfBytesSend |
void |
close()
Releases serialport |
protected void |
fireReceiveDataEvent(byte[] data)
fires data event |
protected DataListener |
getListenerAt(int index)
accessor method for DataListeners |
int |
getNumberOfBytesSend()
gets the number of bytes send by this instance. |
protected int |
getNumberOfListeners()
accessor method for DataListeners |
static java.util.Collection |
getPorts()
Tells which ports are available |
boolean |
isOpened()
check to see if this is opened |
private void |
openPort(CommPortIdentifier comm)
Opens a CommPortIdentifier, configures the port and gets the input and outputstream from the port |
protected void |
read()
Reads the input stream and sends the data to the listeners |
void |
removeDataListener(DataListener listener)
accessor method for DataListeners, implementation of CommunicationDevice |
void |
run()
This methods keeps the port running |
void |
sendData(byte[] data)
sends your data |
void |
serialEvent(SerialPortEvent event)
Implementation of the SerialPortEventListener, part of the java comm API. |
protected void |
setNumberOfBytesSend(int numberOfBytes)
accessor method for numberOfBytesSend |
protected void |
setOpened(boolean isOpened)
accessor method for isOpenend |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
inputStream
java.io.InputStream inputStream
outputStream
java.io.OutputStream outputStream
serialPort
SerialPort serialPort
numberOfBytesSend
int numberOfBytesSend
LOG_TO_STDOUT
public static boolean LOG_TO_STDOUT
isOpened
private boolean isOpened
| Constructor Detail |
RS232
public RS232(java.lang.String serialPort)
- Constructor for the RS232 object
| Method Detail |
getPorts
public static java.util.Collection getPorts()
- Tells which ports are available
openPort
private void openPort(CommPortIdentifier comm)
- Opens a CommPortIdentifier, configures the port and
gets the input and outputstream from the port
sendData
public void sendData(byte[] data)
- Description copied from interface:
CommunicationDevice - sends your data
- Specified by:
sendDatain interfaceCommunicationDevice
run
public void run()
- This methods keeps the port running
- Specified by:
runin interfacejava.lang.Runnable
serialEvent
public void serialEvent(SerialPortEvent event)
- Implementation of the SerialPortEventListener, part
of the java comm API.
getNumberOfBytesSend
public int getNumberOfBytesSend()
- gets the number of bytes send by this instance.
addNumberOfBytesSend
protected void addNumberOfBytesSend(int numberOfNewBytesSend)
- accessor method for numberOfBytesSend
setNumberOfBytesSend
protected void setNumberOfBytesSend(int numberOfBytes)
- accessor method for numberOfBytesSend
read
protected void read()
- Reads the input stream and sends the data to the listeners
close
public void close()
- Releases serialport
- Specified by:
closein interfaceCommunicationDevice
setOpened
protected void setOpened(boolean isOpened)
- accessor method for isOpenend
isOpened
public boolean isOpened()
- check to see if this is opened
getNumberOfListeners
protected int getNumberOfListeners()
- accessor method for DataListeners
getListenerAt
protected DataListener getListenerAt(int index)
- accessor method for DataListeners
addDataListener
public void addDataListener(DataListener listener)
- accessor method for DataListeners, implementation of
CommunicationDevice
- Specified by:
addDataListenerin interfaceCommunicationDevice
removeDataListener
public void removeDataListener(DataListener listener)
- accessor method for DataListeners, implementation of
CommunicationDevice
- Specified by:
removeDataListenerin interfaceCommunicationDevice
fireReceiveDataEvent
protected void fireReceiveDataEvent(byte[] data)
- fires data event
|
|||||||||
| Home >> All >> plp >> [ rs232 overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC