Class LocoBufferAdapter

    • Method Detail

      • getCommandStationListWithStandaloneLN

        public java.lang.String[] getCommandStationListWithStandaloneLN()
        Create a list of possible command stations and append "Standalone LocoNet" Note: This is not suitable for use by any class which extends this class if the hardware interface is part of a command station.
        Returns:
        String[] containing the array of command stations, plus "Standalone LocoNet"
      • openPort

        public java.lang.String openPort​(java.lang.String portName,
                                         java.lang.String appName)
        Description copied from interface: SerialPortAdapter
        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.
      • reportOpen

        protected void reportOpen​(java.lang.String portName)
        Allow subtypes to change the opening message
        Parameters:
        portName - To appear in message
      • setLocalFlowControl

        protected void setLocalFlowControl()
        Allow subtypes to change the flow control algorithm
      • okToSend

        public boolean okToSend()
        Can the port accept additional characters? The state of CTS determines this, as there seems to be no way to check the number of queued bytes and buffer length. This might go false for short intervals, but it might also stick off if something goes wrong.
        Overrides:
        okToSend in class LnPortController
        Returns:
        an indication of whether the interface is accepting transmit messages.
      • configure

        public void configure()
        Set up all of the other objects to operate with a LocoBuffer connected to this port.
      • getPacketizerOption

        protected java.lang.String getPacketizerOption​(java.lang.String s)
        for a given readable choice return internal value or the default
        Parameters:
        s - string containing ?a packetizer name?
        Returns:
        internal value
      • getPacketizer

        protected LnPacketizer getPacketizer​(java.lang.String s)
        Parameters:
        s - the packetizer to use in its readable form.
        Returns:
        a LnPacketizer