jmri.jmrix.lenz.liusbserver
Class LIUSBServerAdapter

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

public class LIUSBServerAdapter
extends XNetNetworkPortController

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-2010

Field Summary
 
Fields inherited from class jmri.jmrix.lenz.XNetNetworkPortController
adaptermemo, checkBuffer, validOption2
 
Fields inherited from class jmri.jmrix.AbstractNetworkPortController
m_HostName, m_port, socketConn
 
Fields inherited from class jmri.jmrix.AbstractPortController
mDisabled, mManufacturer, mOpt1, mOpt2, opened
 
Constructor Summary
LIUSBServerAdapter()
           
 
Method Summary
 void configure()
          set up all of the other objects to operate with a LIUSB Server interface
 DataInputStream getInputStream()
           
 String getManufacturer()
          Get and set of the Manufacturer for network (TCP/IP) based connections is handled by the ConnectionConfig code in each connector.
 DataOutputStream getOutputStream()
           
static LIUSBServerAdapter instance()
          Deprecated. 
 boolean okToSend()
          Can the port accept additional characters?
 String openPort(String portName, String appName)
           
 String option1Name()
          Get a String that says what Option 1 represents May be an empty string, but will not be null
 void setManufacturer(String manu)
          Set the System Manufacturers Name
 boolean status()
          Check that this object is ready to operate.
 String[] validOption1()
          Get an array of valid values for "option 1"; used to display valid options.
 
Methods inherited from class jmri.jmrix.lenz.XNetNetworkPortController
dispose, getCurrentOption2Setting, getSystemConnectionMemo, setOutputBufferEmpty
 
Methods inherited from class jmri.jmrix.AbstractNetworkPortController
connect, connect, getCurrentPortName, getHostName, getPort, setDisabled, setHostName, setPort, setPort
 
Methods inherited from class jmri.jmrix.AbstractPortController
configureOption1, configureOption2, getCurrentOption1Setting, getDisabled, option2Name, 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, getCurrentPortName, getDisabled, option2Name, setDisabled, validOption2
 
Methods inherited from interface jmri.jmrix.NetworkPortAdapter
configureOption1, configureOption2, getCurrentOption1Setting, option2Name, validOption2
 

Constructor Detail

LIUSBServerAdapter

public LIUSBServerAdapter()
Method Detail

openPort

public String openPort(String portName,
                       String appName)

okToSend

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

Specified by:
okToSend in interface XNetPortController
Specified by:
okToSend in class XNetNetworkPortController

getInputStream

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

getOutputStream

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

status

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

Specified by:
status in interface XNetPortController
Specified by:
status in interface NetworkPortAdapter
Specified by:
status in interface PortAdapter
Specified by:
status in class XNetNetworkPortController

validOption1

public String[] validOption1()
Get an array of valid values for "option 1"; used to display valid options. May not be null, but may have zero entries

Specified by:
validOption1 in interface NetworkPortAdapter
Specified by:
validOption1 in interface PortAdapter
Overrides:
validOption1 in class AbstractPortController

option1Name

public String option1Name()
Get a String that says what Option 1 represents May be an empty string, but will not be null

Specified by:
option1Name in interface NetworkPortAdapter
Specified by:
option1Name in interface PortAdapter
Overrides:
option1Name in class AbstractPortController

configure

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


instance

@Deprecated
public static LIUSBServerAdapter instance()
Deprecated. 

Local method to do specific configuration


getManufacturer

public String getManufacturer()
Description copied from class: AbstractPortController
Get and set of the Manufacturer for network (TCP/IP) based connections is handled by the ConnectionConfig code in each connector. this is here as we implement the serialdriveradpter.

Specified by:
getManufacturer in interface PortAdapter
Overrides:
getManufacturer in class AbstractPortController

setManufacturer

public void setManufacturer(String manu)
Description copied from interface: PortAdapter
Set the System Manufacturers Name

Specified by:
setManufacturer in interface PortAdapter
Overrides:
setManufacturer in class AbstractPortController


Copyright © 1997 - 2011 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