Module vcr4j.rs422

Class RS422ResponseParser

java.lang.Object
org.mbari.vcr4j.rs422.RS422ResponseParser

public class RS422ResponseParser extends Object
  • Field Details

    • ACK

      public static final byte[] ACK
    • NACK

      public static final byte[] NACK
  • Constructor Details

    • RS422ResponseParser

      public RS422ResponseParser()
  • Method Details

    • calculateChecksum

      public static byte calculateChecksum(byte[] command)
      The last byte in a command block is the checksum, i.e. the lower eight bits of the sum of the other bytes in the command block
      Parameters:
      command - The byte array to to calculate a checksum
      Returns:
      The checksum value of the command
    • update

      public void update(byte[] command, byte[] cmd, byte[] data, byte[] checksum)
    • update

      public void update(byte[] command, byte[] cmd, byte[] data, byte[] checksum, VideoCommand videoCommand)
      Update the state objects associated with the VCR's response
      Parameters:
      command - The command that was sent to the VCR
      cmd - The command portion of the VCR's reply
      data - The data portion of the VCR's reply
      checksum - The checksum of the VCR's reply
      videoCommand - The video command
    • isAck

      public static boolean isAck(byte[] cmd)
      Checks to see if the reply is an ack (acknowledgement)
      Parameters:
      cmd - byte array of command.
      Returns:
      True if the reply is ACK
    • isNack

      public static boolean isNack(byte[] cmd)
      Checks to see if the reply is a nack (i.e error)
      Parameters:
      cmd - the cmd we're checking to see if it's a NACK
      Returns:
      True if the reply is NACK
    • getErrorObservable

      public io.reactivex.rxjava3.subjects.Subject<RS422Error> getErrorObservable()
    • getStatusObservable

      public io.reactivex.rxjava3.subjects.Subject<RS422State> getStatusObservable()
    • getTimecodeObservable

      public io.reactivex.rxjava3.subjects.Subject<RS422Timecode> getTimecodeObservable()
    • getUserbitsObservable

      public io.reactivex.rxjava3.subjects.Subject<RS422Userbits> getUserbitsObservable()