java.lang.Object
org.mbari.vcr4j.rs422.RS422ResponseParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic bytecalculateChecksum(byte[] command) The last byte in a command block is the checksum, i.e.io.reactivex.rxjava3.subjects.Subject<RS422Error>io.reactivex.rxjava3.subjects.Subject<RS422State>io.reactivex.rxjava3.subjects.Subject<RS422Timecode>io.reactivex.rxjava3.subjects.Subject<RS422Userbits>static booleanisAck(byte[] cmd) Checks to see if the reply is an ack (acknowledgement)static booleanisNack(byte[] cmd) Checks to see if the reply is a nack (i.e error)voidupdate(byte[] command, byte[] cmd, byte[] data, byte[] checksum) voidupdate(byte[] command, byte[] cmd, byte[] data, byte[] checksum, VideoCommand videoCommand) Update the state objects associated with the VCR's response
-
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 VCRcmd- The command portion of the VCR's replydata- The data portion of the VCR's replychecksum- The checksum of the VCR's replyvideoCommand- 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
-
getStatusObservable
-
getTimecodeObservable
-
getUserbitsObservable
-