jmri.jmrix
Interface SerialPortAdapter

All Superinterfaces:
PortAdapter
All Known Implementing Classes:
AbstractPortController, AcelaPortController, EasyDccPortController, EcosPortController, EliteAdapter, GcPortController, GcSerialDriverAdapter, IntelliboxAdapter, LI100Adapter, LI100Adapter, LI101Adapter, LIUSBAdapter, LIUSBServerAdapter, LnHexFilePort, LnPortController, LnTcpDriverAdapter, LocoBufferAdapter, LocoBufferIIAdapter, LocoBufferUsbAdapter, MrcPortController, MS100Adapter, Mx1Adapter, Mx1PortController, NcePortController, NetworkDriverAdapter, NetworkDriverAdapter, NetworkDriverAdapter, NetworkDriverAdapter, NetworkPortAdapter, Port, PortController, PortController, PR2Adapter, PR3Adapter, QsiPortController, SerialAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialDriverAdapter, SerialPortController, SerialPortController, SerialPortController, SerialPortController, SerialPortController, SerialPortController, SerialPortController, SerialSensorAdapter, SprogPortController, SRCPPortController, UsbDriverAdapter, XNetPortController, XNetSimulatorAdapter, XnTcpAdapter, XpaPortController, ZTC640Adapter

public interface SerialPortAdapter
extends PortAdapter

Enables basic setup of a serial interface for a jmrix implementation.

Author:
Bob Jacobsen Copyright (C) 2001, 2003, 2008
See Also:
SerialConfigException

Method Summary
 void configure()
          Configure all of the other jmrix widgets needed to work with this adapter
 void configureBaudRate(String rate)
          Set the baud rate.
 void configureOption1(String value)
          Set the first port option.
 void configureOption2(String value)
          Set the second port option.
 String getCurrentBaudRate()
           
 String getCurrentOption1Setting()
           
 String getCurrentOption2Setting()
          Get current option 2 value
 String getCurrentPortName()
           
 Vector<String> getPortNames()
          Provide a vector of valid port names, each a String.
 String handlePortBusy(PortInUseException p, String portName, Logger log)
          Error handling for busy port at open.
 String openPort(String portName, String appName)
          Open a specified port.
 String option1Name()
          Get a String that says what Option 1 represents May be an empty string, but will not be null
 String option2Name()
          Get a String that says what Option 2 represents May be an empty string, but will not be null
 void setPort(String s)
          Remember the associated port name
 boolean status()
          Query the status of this connection.
 String[] validBaudRates()
          Get an array of valid baud rates; used to display valid options.
 String[] validOption1()
          Get an array of valid values for "option 1"; used to display valid options.
 String[] validOption2()
          Get an array of valid values for "option 2"; used to display valid options.
 
Methods inherited from interface jmri.jmrix.PortAdapter
getInputStream, getOutputStream
 

Method Detail

getPortNames

Vector<String> getPortNames()
Provide a vector of valid port names, each a String.


openPort

String openPort(String portName,
                String appName)
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


configure

void configure()
Configure all of the other jmrix widgets needed to work with this adapter

Specified by:
configure in interface PortAdapter

status

boolean status()
Query the status of this connection. If all OK, at least as far as is known, return true

Specified by:
status in interface PortAdapter

setPort

void setPort(String s)
Remember the associated port name

Parameters:
s -

getCurrentPortName

String getCurrentPortName()

validBaudRates

String[] validBaudRates()
Get an array of valid baud rates; used to display valid options.


configureBaudRate

void configureBaudRate(String rate)
Set the baud rate. Only to be used after construction, but before the openPort call.


getCurrentBaudRate

String getCurrentBaudRate()

validOption1

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 PortAdapter

option1Name

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 PortAdapter

configureOption1

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

Specified by:
configureOption1 in interface PortAdapter

getCurrentOption1Setting

String getCurrentOption1Setting()
Specified by:
getCurrentOption1Setting in interface PortAdapter

validOption2

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

option2Name

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

configureOption2

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

getCurrentOption2Setting

String getCurrentOption2Setting()
Get current option 2 value

Specified by:
getCurrentOption2Setting in interface PortAdapter

handlePortBusy

String handlePortBusy(PortInUseException p,
                      String portName,
                      Logger log)
Error handling for busy port at open.

See Also:
AbstractPortController


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