Class GcSerialDriverAdapter
java.lang.Object
jmri.jmrix.AbstractPortController
jmri.jmrix.AbstractSerialPortController
jmri.jmrix.can.adapters.gridconnect.GcPortController
jmri.jmrix.can.adapters.gridconnect.GcSerialDriverAdapter
- All Implemented Interfaces:
PortAdapter,SerialPortAdapter
- Direct Known Subclasses:
CanisbSerialDriverAdapter,PiLccSerialDriverAdapter,PiSprog3SerialDriverAdapter,SerialDriverAdapter,SerialDriverAdapter,SerialDriverAdapter,SerialDriverAdapter,SerialDriverAdapter,Sprog3PlusSerialDriverAdapter
Implements SerialPortAdapter for the GridConnect protocol.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractSerialPortController
AbstractSerialPortController.Blocking, AbstractSerialPortController.FlowControlNested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractSerialPortController.FlowControl(package private) InputStreamFields inherited from class jmri.jmrix.AbstractSerialPortController
currentSerialPort, mBaudRate, mPortFields inherited from class jmri.jmrix.AbstractPortController
allowConnectionRecovery, manufacturerName, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, reconnectMaxAttempts, reconnectMaxInterval -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new CAN GridConnect Network Driver Adapter.GcSerialDriverAdapter(String prefix) Creates a new CAN GridConnect Network Driver Adapter.Creates a new CAN GridConnect Network Driver Adapter. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAbstract class for controllers to close the connection.voidSet up all of the other objects to operate with a CAN RS adapter connected to this port.intGet the index of the default port speed for this adapter from the validSpeeds and validRates arrays.Base class methods for the PortController interface.protected voidLocal set up the flow contro, here to allow overrideprotected GcTrafficControllerMake a new GC Traffic Controller.Open a specified port.protected voidRe-setup the connection.int[]Get an array of valid baud rates.String[]Get an array of valid baud rate strings; used to display valid options in Connections Preferences.Methods inherited from class jmri.jmrix.can.adapters.gridconnect.GcPortController
getSystemConnectionMemoMethods inherited from class jmri.jmrix.AbstractSerialPortController
activatePort, activatePort, activatePort, closeSerialPort, configureBaudRate, configureBaudRateFromIndex, configureBaudRateFromNumber, configureLeads, configureLeadsAndFlowControl, configureLeadsAndFlowControl, connect, currentBaudNumber, getActualPortNames, getCurrentBaudIndex, getCurrentBaudNumber, getCurrentBaudRate, getCurrentPortName, getFlowControl, getOutputStream, getPortSettingsString, handlePortBusy, handlePortNotFound, handlePortNotFound, isPortOpen, replacePortWithFakePort, reportPortStatus, setBaudRate, setComPortTimeouts, setDataListener, setFlowControl, setPortMethods inherited from class jmri.jmrix.AbstractPortController
configureOption1, configureOption2, configureOption3, configureOption4, dispose, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, purgeStream, reconnect, reconnectFromLoop, recover, safeSleep, setClosed, setDisabled, setManufacturer, setOpened, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName, statusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrix.PortAdapter
dispose, getDisabled, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, recover, setDisabled, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserNameMethods inherited from interface jmri.jmrix.SerialPortAdapter
configureOption1, configureOption2, configureOption3, configureOption4, getManufacturer, getPortNames, setManufacturer, status
-
Field Details
-
flowControl
-
serialStream
-
-
Constructor Details
-
GcSerialDriverAdapter
public GcSerialDriverAdapter()Creates a new CAN GridConnect Network Driver Adapter. -
GcSerialDriverAdapter
Creates a new CAN GridConnect Network Driver Adapter.Allows for default systemPrefix other than "M".
- Parameters:
prefix- System Prefix.
-
GcSerialDriverAdapter
Creates a new CAN GridConnect Network Driver Adapter.Allows for default systemPrefix other than "M".
- Parameters:
prefix- System Prefix.flow- flow control, true for RTS/CTS
-
-
Method Details
-
openPort
Open a specified port.- Parameters:
portName- name tu use for this portappName- provided to the underlying OS during startup so that it can show on status displays, etc.- Returns:
- null indicates OK return, else error message.
-
localSetFlowControl
Local set up the flow contro, here to allow override -
configure
Set up all of the other objects to operate with a CAN RS adapter connected to this port. Configure all of the other jmrix widgets needed to work with this adapter. -
resetupConnection
Re-setup the connection. Called when the physical connection has reconnected and can be linked to this connection. Each port adapter should handle this and it should be abstract. Reconnects to Traffic Controller. Updates connection status.- Overrides:
resetupConnectionin classAbstractSerialPortController
-
closeConnection
Abstract class for controllers to close the connection. Called prior to any re-connection attempts. Each serial port adapter should handle this and it should be abstract. Closes serial streams.- Overrides:
closeConnectionin classAbstractSerialPortController
-
makeGcTrafficController
Make a new GC Traffic Controller.- Returns:
- new GridConnect Traffic Controller.
-
getInputStream
Base class methods for the PortController interface. Get the InputStream from the port.- Specified by:
getInputStreamin interfacePortAdapter- Overrides:
getInputStreamin classAbstractSerialPortController- Returns:
- the InputStream from the port
-
validBaudRates
Get an array of valid baud rate strings; used to display valid options in Connections Preferences.- Specified by:
validBaudRatesin interfaceSerialPortAdapter- Overrides:
validBaudRatesin classAbstractSerialPortController- Returns:
- array of localized valid baud rates
-
validBaudNumbers
Get an array of valid baud rates.- Specified by:
validBaudNumbersin interfaceSerialPortAdapter- Overrides:
validBaudNumbersin classAbstractSerialPortController- Returns:
- valid baud rates
-
defaultBaudIndex
Get the index of the default port speed for this adapter from the validSpeeds and validRates arrays.- Specified by:
defaultBaudIndexin interfaceSerialPortAdapter- Overrides:
defaultBaudIndexin classAbstractSerialPortController- Returns:
- -1 to indicate not supported, unless overridden in adapter
-