Package org.yamcs.tse

Class InstrumentDriver

java.lang.Object
org.yamcs.tse.InstrumentDriver
Direct Known Subclasses:
SerialPortDriver, TcpIpDriver, UdpDriver

public abstract class InstrumentDriver extends Object
  • Field Details

    • instrument

      protected String instrument
    • commandSeparation

      protected String commandSeparation
    • responseTermination

      protected String responseTermination
    • responseTimeout

      protected int responseTimeout
    • interceptors

      protected List<Interceptor> interceptors
    • encoding

      protected Charset encoding
  • Constructor Details

    • InstrumentDriver

      public InstrumentDriver()
  • Method Details

    • init

      public void init(String name, YConfiguration config)
    • getName

      public String getName()
    • getCommandSeparation

      public String getCommandSeparation()
    • getResponseTermination

      public String getResponseTermination()
    • getResponseTimeout

      public int getResponseTimeout()
    • command

      public List<String> command(String command, TseCommand metadata, boolean expectResponse) throws IOException, TimeoutException
      Throws:
      IOException
      TimeoutException
    • connect

      public abstract void connect() throws IOException
      Throws:
      IOException
    • disconnect

      public abstract void disconnect() throws IOException
      Throws:
      IOException
    • write

      public abstract void write(byte[] cmd) throws IOException
      Throws:
      IOException
    • readAvailable

      public abstract void readAvailable(ResponseBuffer buffer, int timeout) throws IOException
      Throws:
      IOException
    • isFragmented

      public abstract boolean isFragmented()
      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.

    • getDefaultRequestTermination

      public abstract String getDefaultRequestTermination()
      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.