|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractPortController
jmri.jmrix.lenz.XNetPortController
jmri.jmrix.lenz.xnetsimulator.XNetSimulatorAdapter
public class XNetSimulatorAdapter
Provide access to a simulated XPressNet system. Currently, the XNetSimulator reacts to commands sent from the user interface with messages an appropriate reply message. NOTE: Most XPressNet commands are still unsupported in this implementation. Normally controlled by the lenz.XNetSimulator.XNetSimulatorFrame class. NOTE: Some material in this file was modified from other portions of the support infrastructure.
| Field Summary |
|---|
| Fields inherited from class jmri.jmrix.lenz.XNetPortController |
|---|
validOption2 |
| Fields inherited from class jmri.jmrix.AbstractPortController |
|---|
mBaudRate, mOpt1, mOpt2, mPort |
| Constructor Summary | |
|---|---|
XNetSimulatorAdapter()
|
|
| Method Summary | |
|---|---|
void |
configure()
set up all of the other objects to operate with a XNetSimulator connected to this port |
DataInputStream |
getInputStream()
|
DataOutputStream |
getOutputStream()
|
static XNetSimulatorAdapter |
instance()
|
boolean |
okToSend()
Can the port accept additional characters? |
String |
openPort(String portName,
String appName)
Open a specified port. |
protected byte |
readByteProtected(DataInputStream istream)
Read a single byte, protecting against various timeouts, etc. |
void |
run()
|
void |
setOutputBufferEmpty(boolean s)
we need a way to say if the output buffer is empty or full this should only be set to false by external processes |
boolean |
status()
Check that this object is ready to operate. |
String[] |
validBaudRates()
Get an array of valid baud rates. |
| Methods inherited from class jmri.jmrix.lenz.XNetPortController |
|---|
option2Name, validOption2 |
| Methods inherited from class jmri.jmrix.AbstractPortController |
|---|
configureBaudRate, configureOption1, configureOption2, currentBaudNumber, getCurrentBaudRate, getCurrentOption1Setting, getCurrentOption2Setting, getCurrentPortName, getPortNames, handlePortBusy, handlePortNotFound, option1Name, reloadDriver, setPort, validBaudNumber, validOption1 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XNetSimulatorAdapter()
| Method Detail |
|---|
public String openPort(String portName,
String appName)
SerialPortAdapter
openPort in interface SerialPortAdapterpublic void setOutputBufferEmpty(boolean s)
setOutputBufferEmpty in class XNetPortControllerpublic boolean okToSend()
okToSend in class XNetPortControllerpublic void configure()
configure in interface PortAdapterconfigure in interface SerialPortAdapterpublic DataInputStream getInputStream()
getInputStream in interface PortAdaptergetInputStream in class XNetPortControllerpublic DataOutputStream getOutputStream()
getOutputStream in interface PortAdaptergetOutputStream in class XNetPortControllerpublic boolean status()
XNetPortController
status in interface PortAdapterstatus in interface SerialPortAdapterstatus in class XNetPortControllerpublic String[] validBaudRates()
validBaudRates in interface SerialPortAdapterpublic static XNetSimulatorAdapter instance()
public void run()
run in interface Runnable
protected byte readByteProtected(DataInputStream istream)
throws IOException
When a javax.comm port is set to have a receive timeout (via the enableReceiveTimeout() method), some will return zero bytes or an EOFException at the end of the timeout. In that case, the read should be repeated to get the next real character.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||