Package org.yamcs.tse

Class SerialPortDriver

java.lang.Object
org.yamcs.tse.InstrumentDriver
org.yamcs.tse.SerialPortDriver

public class SerialPortDriver extends InstrumentDriver
Connect and command a device over a serial port. Not thread safe.
  • Constructor Details

    • SerialPortDriver

      public SerialPortDriver()
  • Method Details

    • init

      public void init(String name, YConfiguration config)
      Overrides:
      init in class InstrumentDriver
    • getBaudrate

      public int getBaudrate()
    • getDataBits

      public int getDataBits()
    • getParity

      public String getParity()
    • getPath

      public String getPath()
    • connect

      public void connect()
      Specified by:
      connect in class InstrumentDriver
    • write

      public void write(byte[] bytes)
      Specified by:
      write in class InstrumentDriver
    • readAvailable

      public void readAvailable(ResponseBuffer responseBuffer, int timeout) throws IOException
      Specified by:
      readAvailable in class InstrumentDriver
      Throws:
      IOException
    • disconnect

      public void disconnect()
      Specified by:
      disconnect in class InstrumentDriver
    • getDefaultRequestTermination

      public String getDefaultRequestTermination()
      Description copied from class: InstrumentDriver
      Returns the driver-specific default pattern for terminating requests. This is the termination that gets used if the user does not explicitly configure anything.

      Return null to do no request termination.

      Specified by:
      getDefaultRequestTermination in class InstrumentDriver
    • isFragmented

      public boolean isFragmented()
      Description copied from class: InstrumentDriver
      Returns whether this driver may require reassembly of multiple received fragments in order to obtain a full response.

      Setting this to false, will allow to have a quick response, even if there is no response termination characters. That is, without needing to wait on timeouts.

      Specified by:
      isFragmented in class InstrumentDriver