Class TrcI2cDevice.Request

java.lang.Object
trclib.robotcore.TrcI2cDevice.Request
Enclosing class:
TrcI2cDevice

private static class TrcI2cDevice.Request extends Object
This class implements an I2C device request. It can be a read or write request. This is implicitly indicated by the writeBuffer field. The presence of a writeBuffer indicates it is a write request. It is a read request otherwise.
  • Field Details

    • regAddress

      private final int regAddress
    • length

      private final int length
    • writeBuffer

      private final byte[] writeBuffer
    • handler

      private final TrcI2cDevice.CompletionHandler handler
    • timeout

      private final double timeout
    • expired

      private boolean expired
  • Constructor Details

    • Request

      public Request(int regAddress, int length, byte[] writeBuffer, TrcI2cDevice.CompletionHandler handler, double timeout)
      Constructor: Create an instance of the object.
      Parameters:
      regAddress - specifies the register address.
      length - specifies the number of bytes to read or write.
      writeBuffer - specifies the write buffer, null if read operation.
      handler - specifies the completion handler to call when done. Can be null if none needed.
      timeout - specifies the timeout time. It can be set to 0 if there is no timeout.