Package jmri.jmrix
Interface SerialPortAdapter
- 
- All Superinterfaces:
- PortAdapter
 - All Known Implementing Classes:
- AbstractSerialPortController,- AcelaPortController,- BiDiBSerialPortController,- BiDiBSimulatorAdapter,- CanisbSerialDriverAdapter,- CanUsbDriverAdapter,- CdBPortController,- Dcc4PcPortController,- DCCppAdapter,- DCCppSerialPortController,- DCCppSimulatorAdapter,- DCCppSimulatorPortController,- DemoSerialPort,- EasyDccPortController,- EliteAdapter,- GcPortController,- GcSerialDriverAdapter,- IEEE802154PortController,- IntelliboxAdapter,- InternalAdapter,- LI100Adapter,- LI100fAdapter,- LI101Adapter,- LIUSBAdapter,- LnHexFilePort,- LnPortController,- LocoBufferAdapter,- LocoBufferIIAdapter,- LocoBufferNGAdapter,- LocoBufferUsbAdapter,- LocoNetBluetoothAdapter,- LZV200Adapter,- MrcPortController,- MS100Adapter,- Mx1Adapter,- Mx1PortController,- NcePortController,- Ph5DriverAdapter,- PiLccSerialDriverAdapter,- PiSprog3SerialDriverAdapter,- PiSprog3v2SerialDriverAdapter,- PiSprogNanoSerialDriverAdapter,- PiSprogOneCSSerialDriverAdapter,- PiSprogOneSerialDriverAdapter,- Port,- PortController,- PortController,- PR2Adapter,- PR3Adapter,- PR4Adapter,- QsiPortController,- RfidPortController,- SerialAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialDriverAdapter,- SerialPortAdapter,- SerialPortController,- SerialPortController,- SerialPortController,- SerialPortController,- SerialPortController,- SerialPortController,- SimDriverAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SimulatorAdapter,- SpecificDriverAdapter,- SpecificDriverAdapter,- SpecificDriverAdapter,- SpecificDriverAdapter,- SpeedoPortController,- Sprog3PlusSerialDriverAdapter,- SprogCSSerialDriverAdapter,- SprogNanoSerialDriverAdapter,- SprogPortController,- TamsPortController,- UhlenbrockAdapter,- UsbDcs210PlusAdapter,- UsbDcs240Adapter,- UsbDcs240PlusAdapter,- UsbDcs52Adapter,- UsbDriverAdapter,- UsbUhlenbrock63120Adapter,- XBeeAdapter,- XNetSerialPortController,- XNetSimulatorAdapter,- XNetSimulatorPortController,- XpaPortController,- ZTC611Adapter,- ZTC640Adapter
 
 public interface SerialPortAdapter extends PortAdapter Enable basic setup of a serial interface for a jmrix implementation.- See Also:
- SerialConfigException
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidconfigure()Configure all of the other jmrix widgets needed to work with this adapter.voidconfigureBaudRate(java.lang.String rate)Set the baud rate description by port speed description.voidconfigureBaudRateFromIndex(int index)Set the baud rate description by index (integer) from validBaudRates[].voidconfigureBaudRateFromNumber(java.lang.String index)Set the baud rate description by port speed number (as a string) from validBaudRates[].voidconfigureOption1(java.lang.String value)Set the first port option.voidconfigureOption2(java.lang.String value)Set the second port option.voidconfigureOption3(java.lang.String value)Set the third port option.voidconfigureOption4(java.lang.String value)Set the fourth port option.intdefaultBaudIndex()Get the index of the default port speed for this adapter from the validSpeeds and validRates arrays.intgetCurrentBaudIndex()java.lang.StringgetCurrentBaudNumber()To store as XML attribute, get a string to represent current port speed.java.lang.StringgetCurrentBaudRate()java.lang.StringgetCurrentPortName()java.lang.StringgetManufacturer()Get the System Manufacturers Name.default java.util.Vector<java.lang.String>getPortNames()Provide a vector of valid port names, each a String.java.lang.StringopenPort(java.lang.String portName, java.lang.String appName)Open a specified port.voidsetManufacturer(java.lang.String Manufacturer)Set the System Manufacturers Name.voidsetPort(java.lang.String s)Remember the associated port name.booleanstatus()Query the status of this connection.int[]validBaudNumbers()Get an array of valid baud rate numbers; used to store/load adapter speed option.java.lang.String[]validBaudRates()Get an array of valid baud rate strings; used to display valid options in Connections Preferences.- 
Methods inherited from interface jmri.jmrix.PortAdapterconnect, dispose, getDisabled, getInputStream, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getOutputStream, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemConnectionMemo, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, recover, setDisabled, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName
 
- 
 
- 
- 
- 
Method Detail- 
getPortNamesdefault java.util.Vector<java.lang.String> getPortNames() Provide a vector of valid port names, each a String. This may be implemented differently in subclasses that e.g. do loopkac or use a custom port-access library.- Returns:
- Valid port names in the form used to select them later.
 
 - 
openPortjava.lang.String openPort(java.lang.String portName, java.lang.String appName) Open a specified port.- Parameters:
- portName- name tu use for this port
- appName- provided to the underlying OS during startup so that it can show on status displays, etc.
- Returns:
- null indicates OK return, else error message.
 
 - 
configurevoid configure() Configure all of the other jmrix widgets needed to work with this adapter.- Specified by:
- configurein interface- PortAdapter
 
 - 
statusboolean status() Query the status of this connection. This is a question of configuration, not transient hardware status.- Specified by:
- statusin interface- PortAdapter
- Returns:
- true if OK, at least as far as known
 
 - 
setPortvoid setPort(java.lang.String s) Remember the associated port name.- Parameters:
- s- name of the port
 
 - 
getCurrentPortNamejava.lang.String getCurrentPortName() - Specified by:
- getCurrentPortNamein interface- PortAdapter
 
 - 
validBaudRatesjava.lang.String[] validBaudRates() Get an array of valid baud rate strings; used to display valid options in Connections Preferences.- Returns:
- array of I18N display strings of port speed settings valid for this serial adapter,
 must match order and values from validBaudNumbers()
 
 - 
validBaudNumbersint[] validBaudNumbers() Get an array of valid baud rate numbers; used to store/load adapter speed option.- Returns:
- integer array of speeds, must match order and values from validBaudRates()
 
 - 
defaultBaudIndexint defaultBaudIndex() Get the index of the default port speed for this adapter from the validSpeeds and validRates arrays.- Returns:
- -1 to indicate not supported, unless overridden in adapter
 
 - 
configureBaudRatevoid configureBaudRate(java.lang.String rate) Set the baud rate description by port speed description.Only to be used after construction, but before the openPort call. - Parameters:
- rate- the baud rate as I18N description, eg. "28,800 baud"
 
 - 
configureBaudRateFromNumbervoid configureBaudRateFromNumber(java.lang.String index) Set the baud rate description by port speed number (as a string) from validBaudRates[].Only to be used after construction, but before the openPort call. - Parameters:
- index- the port speed as unformatted number string, eg. "28800"
 
 - 
configureBaudRateFromIndexvoid configureBaudRateFromIndex(int index) Set the baud rate description by index (integer) from validBaudRates[].- Parameters:
- index- the index to select from speeds[] array
 
 - 
getCurrentBaudRatejava.lang.String getCurrentBaudRate() 
 - 
getCurrentBaudNumberjava.lang.String getCurrentBaudNumber() To store as XML attribute, get a string to represent current port speed.- Returns:
- speed as number string
 
 - 
getCurrentBaudIndexint getCurrentBaudIndex() 
 - 
configureOption1void configureOption1(java.lang.String value) Set the first port option. Only to be used after construction, but before the openPort call.- Specified by:
- configureOption1in interface- PortAdapter
- Parameters:
- value- to set the option to
 
 - 
configureOption2void configureOption2(java.lang.String value) Set the second port option. Only to be used after construction, but before the openPort call.- Specified by:
- configureOption2in interface- PortAdapter
- Parameters:
- value- to set the option to
 
 - 
configureOption3void configureOption3(java.lang.String value) Set the third port option. Only to be used after construction, but before the openPort call.- Specified by:
- configureOption3in interface- PortAdapter
- Parameters:
- value- to set the option to
 
 - 
configureOption4void configureOption4(java.lang.String value) Set the fourth port option. Only to be used after construction, but before the openPort call.- Specified by:
- configureOption4in interface- PortAdapter
- Parameters:
- value- to set the option to
 
 - 
getManufacturerjava.lang.String getManufacturer() Get the System Manufacturers Name.- Specified by:
- getManufacturerin interface- PortAdapter
- Returns:
- manufacturer's name
 
 - 
setManufacturervoid setManufacturer(java.lang.String Manufacturer) Set the System Manufacturers Name.- Specified by:
- setManufacturerin interface- PortAdapter
- Parameters:
- Manufacturer- the manufacturer's name
 
 
- 
 
-