jmri.jmrix.lenz.liusbserver
Class LIUSBServerAdapter

java.lang.Object
  extended by jmri.jmrix.AbstractPortController
      extended by jmri.jmrix.lenz.XNetPortController
          extended by jmri.jmrix.lenz.liusbserver.LIUSBServerAdapter
All Implemented Interfaces:
PortAdapter, SerialPortAdapter

public class LIUSBServerAdapter
extends XNetPortController

Provide access to XPressNet via a the Lenz LIUSB Server. NOTES: The LIUSB server binds only to localhost (127.0.0.1) on TCP ports 5550 and 5551. Port 5550 is used for general communication. Port 5551 is used for broadcast messages only. The LIUSB Server disconnects both ports if there is 60 seconds of inactivity on the port. The LIUSB Server disconnects port 5550 if another device puts the system into service mode.

Author:
Paul Bender (C) 2009

Field Summary
 
Fields inherited from class jmri.jmrix.lenz.XNetPortController
validOption2
 
Fields inherited from class jmri.jmrix.AbstractPortController
mBaudRate, mOpt1, mOpt2, mPort
 
Constructor Summary
LIUSBServerAdapter()
           
 
Method Summary
 void configure()
          set up all of the other objects to operate with a LIUSB Server interface
 DataInputStream getInputStream()
           
 DataOutputStream getOutputStream()
           
static LIUSBServerAdapter instance()
          Local method to do specific configuration
 boolean okToSend()
          Can the port accept additional characters?
 String openPort(String portName, String appName)
          Open a specified port.
 void setOutputBufferEmpty(boolean s)
          We need a way to say if the output buffer is empty or not
 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

LIUSBServerAdapter

public LIUSBServerAdapter()
Method Detail

openPort

public String openPort(String portName,
                       String appName)
Description copied from interface: SerialPortAdapter
Open a specified port. The appname argument is to be provided to the underlying OS during startup so that it can show on status displays, etc


setOutputBufferEmpty

public void setOutputBufferEmpty(boolean s)
Description copied from class: XNetPortController
We need a way to say if the output buffer is empty or not

Specified by:
setOutputBufferEmpty in class XNetPortController

okToSend

public boolean okToSend()
Can the port accept additional characters? return true if the port is opened.

Specified by:
okToSend in class XNetPortController

getInputStream

public DataInputStream getInputStream()
Specified by:
getInputStream in interface PortAdapter
Specified by:
getInputStream in class XNetPortController

getOutputStream

public DataOutputStream getOutputStream()
Specified by:
getOutputStream in interface PortAdapter
Specified by:
getOutputStream in class XNetPortController

status

public boolean status()
Description copied from class: XNetPortController
Check that this object is ready to operate. This is a question of configuration, not transient hardware status.

Specified by:
status in interface PortAdapter
Specified by:
status in interface SerialPortAdapter
Specified by:
status in class XNetPortController

validBaudRates

public String[] validBaudRates()
Get an array of valid baud rates. This is currently just a message saying its fixed


configure

public void configure()
set up all of the other objects to operate with a LIUSB Server interface


instance

public static LIUSBServerAdapter instance()
Local method to do specific configuration



Copyright © 1997 - 2009 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads