Class TrcSerialBusDevice.Request

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

public static class TrcSerialBusDevice.Request extends Object
This class implements a request. Typically, a request will be put into a FIFO request queue so that each request will be processed in the order they came in.
  • Field Details

    • requestId

      public Object requestId
    • readRequest

      public boolean readRequest
    • address

      public int address
    • buffer

      public byte[] buffer
    • length

      public int length
    • completionEvent

      public TrcEvent completionEvent
    • canceled

      public boolean canceled
  • Constructor Details

    • Request

      public Request(Object requestId, boolean readRequest, int address, byte[] buffer, int length, TrcEvent completionEvent)
      Constructor: Create an instance of the object.
      Parameters:
      requestId - specifies the request ID and is not interpreted by the TrcSerialBusDevice class. it is just passed back to the requester's notification handler.
      readRequest - specifies true for a read request, false for a write request.
      address - specifies the data address if any, can be -1 if no address is required.
      buffer - specifies the buffer that contains data for a write request, ignored for read request.
      length - specifies the number of bytes to read or write.
      completionEvent - specifies the event to signal when the request is completed.
  • Method Details

    • toString

      public String toString()
      This method returns the request info as a string.
      Overrides:
      toString in class Object
      Returns:
      request info string.