jmri.jmrix.loconet.ms100
Class MS100Adapter

java.lang.Object
  extended by jmri.jmrix.AbstractPortController
      extended by jmri.jmrix.loconet.LnPortController
          extended by jmri.jmrix.loconet.ms100.MS100Adapter
All Implemented Interfaces:
PortAdapter, SerialPortAdapter

public class MS100Adapter
extends LnPortController
implements SerialPortAdapter

Provide access to LocoNet via a MS100 attached to a serial comm port. Normally controlled by the MS100Frame class.

By default, this attempts to use 16600 baud. If that fails, it falls back to 16457 baud. Neither the baud rate configuration nor the "option 1" option are used.

Author:
Bob Jacobsen Copyright (C) 2001

Field Summary
 
Fields inherited from class jmri.jmrix.loconet.LnPortController
commandStationName, commandStationNames, mCanRead, mProgPowersOff
 
Fields inherited from class jmri.jmrix.AbstractPortController
mBaudRate, mOpt1, mOpt2, mPort
 
Constructor Summary
MS100Adapter()
           
 
Method Summary
 void configure()
          set up all of the other objects to operate with a MS100 connected to this port
 void configureOption2(String value)
          Set the second port option.
 DataInputStream getInputStream()
           
 DataOutputStream getOutputStream()
           
 Vector<String> getPortNames()
          Provide a vector of valid port names, each a String.
static MS100Adapter instance()
           
 String openPort(String portName, String appName)
          Open a specified port.
 String option1Name()
          Option 1 not used, so return a null string.
 String option2Name()
          Get a String that says what Option 2 represents May be an empty string, but will not be null
 boolean status()
          Check that this object is ready to operate.
 String[] validBaudRates()
          Get an array of valid baud rates.
 String[] validOption1()
          Since option 1 is not used for this, return an array with one empty element
 String[] validOption2()
          Get an array of valid values for "option 2"; used to display valid options.
 
Methods inherited from class jmri.jmrix.loconet.LnPortController
configureCommandStation, configureManagers, okToSend, setCommandStationType
 
Methods inherited from class jmri.jmrix.AbstractPortController
configureBaudRate, configureOption1, currentBaudNumber, getCurrentBaudRate, getCurrentOption1Setting, getCurrentOption2Setting, getCurrentPortName, handlePortBusy, handlePortNotFound, reloadDriver, setPort, validBaudNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.jmrix.SerialPortAdapter
configureBaudRate, configureOption1, getCurrentBaudRate, getCurrentOption1Setting, getCurrentOption2Setting, getCurrentPortName, handlePortBusy, setPort
 

Constructor Detail

MS100Adapter

public MS100Adapter()
Method Detail

getPortNames

public Vector<String> getPortNames()
Description copied from interface: SerialPortAdapter
Provide a vector of valid port names, each a String.

Specified by:
getPortNames in interface SerialPortAdapter
Overrides:
getPortNames in class AbstractPortController

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

Specified by:
openPort in interface SerialPortAdapter

configure

public void configure()
set up all of the other objects to operate with a MS100 connected to this port

Specified by:
configure in interface PortAdapter
Specified by:
configure in interface SerialPortAdapter

getInputStream

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

getOutputStream

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

status

public boolean status()
Description copied from class: LnPortController
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 LnPortController

validBaudRates

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

Specified by:
validBaudRates in interface SerialPortAdapter

validOption1

public String[] validOption1()
Since option 1 is not used for this, return an array with one empty element

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

option1Name

public String option1Name()
Option 1 not used, so return a null string.

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

validOption2

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

Specified by:
validOption2 in interface PortAdapter
Specified by:
validOption2 in interface SerialPortAdapter
Overrides:
validOption2 in class AbstractPortController

option2Name

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

Specified by:
option2Name in interface PortAdapter
Specified by:
option2Name in interface SerialPortAdapter
Overrides:
option2Name in class AbstractPortController

configureOption2

public void configureOption2(String value)
Set the second port option. Only to be used after construction, but before the openPort call

Specified by:
configureOption2 in interface PortAdapter
Specified by:
configureOption2 in interface SerialPortAdapter
Overrides:
configureOption2 in class AbstractPortController

instance

public static MS100Adapter instance()


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