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

java.lang.Objectplp.rs232.AbstractCommunicationDevice
plp.rs232.TestCommunicationDevice
- All Implemented Interfaces:
- CommunicationDevice
- public class TestCommunicationDevice
- extends AbstractCommunicationDevice
- implements CommunicationDevice
- extends AbstractCommunicationDevice
A class to test software that uses a CommunicationDevice interface
| Field Summary | |
private tools.ByteBuffer |
dataReceived
|
private byte[] |
dataToExpect
|
private boolean |
foundData
|
| Constructor Summary | |
TestCommunicationDevice()
|
|
| Method Summary | |
void |
addDataListener(DataListener listener)
accessor method for DataListeners, implementation of CommunicationDevice |
protected void |
addDataReceived(byte[] data)
|
protected void |
checkData()
|
void |
close()
closes and releases the hardwareresources associated with this Device. |
protected boolean |
dataFound()
|
boolean |
expect(byte[] dataToExpect,
int timeOutMillies)
Method used by testing software: returns true if the dataToExpect is send by the software to test within timeOUtMillies milliseconds. |
protected void |
fireReceiveDataEvent(byte[] data)
fires data event |
tools.ByteBuffer |
getDataReceived()
|
protected byte[] |
getDataToExpect()
|
protected DataListener |
getListenerAt(int index)
accessor method for DataListeners |
protected int |
getNumberOfListeners()
accessor method for DataListeners |
protected boolean |
isExpectingData()
|
void |
removeDataListener(DataListener listener)
accessor method for DataListeners, implementation of CommunicationDevice |
void |
sendData(byte[] data)
Method used by software to test |
void |
sendToSoftware(byte[] data)
Method used by testing software |
protected void |
setDataFound(boolean found)
|
protected void |
setDataToExpect(byte[] dataToExpect)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface plp.rs232.CommunicationDevice |
addDataListener, removeDataListener |
| Field Detail |
dataReceived
private tools.ByteBuffer dataReceived
dataToExpect
private byte[] dataToExpect
foundData
private boolean foundData
| Constructor Detail |
TestCommunicationDevice
public TestCommunicationDevice()
| Method Detail |
sendData
public void sendData(byte[] data)
- Method used by software to test
- Specified by:
sendDatain interfaceCommunicationDevice
checkData
protected void checkData()
dataFound
protected boolean dataFound()
setDataFound
protected void setDataFound(boolean found)
sendToSoftware
public void sendToSoftware(byte[] data)
- Method used by testing software
expect
public boolean expect(byte[] dataToExpect,
int timeOutMillies)
- Method used by testing software:
returns true if the dataToExpect is send by the software to test
within timeOUtMillies milliseconds.
setDataToExpect
protected void setDataToExpect(byte[] dataToExpect)
getDataToExpect
protected byte[] getDataToExpect()
isExpectingData
protected boolean isExpectingData()
close
public void close()
- Description copied from interface:
CommunicationDevice - closes and releases the hardwareresources associated with this Device.
- Specified by:
closein interfaceCommunicationDevice
getDataReceived
public tools.ByteBuffer getDataReceived()
addDataReceived
protected void addDataReceived(byte[] data)
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