|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractPortController
jmri.jmrix.AbstractSerialPortController
jmri.jmrix.lenz.XNetSimulatorPortController
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.XNetSimulatorPortController |
|---|
adaptermemo |
| Fields inherited from class jmri.jmrix.AbstractSerialPortController |
|---|
mBaudRate, mPort |
| Fields inherited from class jmri.jmrix.AbstractPortController |
|---|
mDisabled, mManufacturer, mOpt1, mOpt2, opened |
| 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()
Deprecated. |
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.XNetSimulatorPortController |
|---|
dispose, getSystemConnectionMemo |
| Methods inherited from class jmri.jmrix.AbstractSerialPortController |
|---|
configureBaudRate, currentBaudNumber, getCurrentBaudRate, getCurrentPortName, getPortNames, handlePortBusy, handlePortNotFound, setDisabled, setPort, validBaudNumber |
| Methods inherited from class jmri.jmrix.AbstractPortController |
|---|
configureOption1, configureOption2, getCurrentOption1Setting, getCurrentOption2Setting, getDisabled, getManufacturer, option1Name, option2Name, setManufacturer, validOption1, validOption2 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.jmrix.PortAdapter |
|---|
configureOption1, configureOption2, getCurrentOption1Setting, getCurrentOption2Setting, getCurrentPortName, getDisabled, getManufacturer, option1Name, option2Name, setDisabled, setManufacturer, validOption1, validOption2 |
| Methods inherited from interface jmri.jmrix.SerialPortAdapter |
|---|
configureOption1, configureOption2, getCurrentOption1Setting, getCurrentOption2Setting, getManufacturer, option1Name, option2Name, setManufacturer, validOption1, validOption2 |
| Constructor Detail |
|---|
public XNetSimulatorAdapter()
| Method Detail |
|---|
public String openPort(String portName,
String appName)
SerialPortAdapter
openPort in interface SerialPortAdapterpublic void setOutputBufferEmpty(boolean s)
setOutputBufferEmpty in interface XNetPortControllersetOutputBufferEmpty in class XNetSimulatorPortControllerpublic boolean okToSend()
okToSend in interface XNetPortControllerokToSend in class XNetSimulatorPortControllerpublic void configure()
configure in interface PortAdapterconfigure in interface SerialPortAdapterpublic DataInputStream getInputStream()
getInputStream in interface PortAdaptergetInputStream in class XNetSimulatorPortControllerpublic DataOutputStream getOutputStream()
getOutputStream in interface PortAdaptergetOutputStream in class XNetSimulatorPortControllerpublic boolean status()
XNetSimulatorPortController
status in interface XNetPortControllerstatus in interface PortAdapterstatus in interface SerialPortAdapterstatus in class XNetSimulatorPortControllerpublic String[] validBaudRates()
validBaudRates in interface SerialPortAdapter@Deprecated public static XNetSimulatorAdapter instance()
public void run()
run in interface Runnable
protected byte readByteProtected(DataInputStream istream)
throws IOException
When a gnu.io 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 | |||||||||