com.qualcomm.robotcore.eventloop

## Interface SyncdDevice

-     public interface SyncdDevice

  `SyncdDevice` is for a device that wants to be in sync with the event loop. If there is sync'd device registered with the event loop manager then the event loop manager will run the event loop in this manner:
  1. wait until all sync'd device have returned from blockUtilReady()
  2. run EventLoop.loop()
  3. call startBlockingWork() on all sync'd device
  Sync'd devices need to register themselves with the event loop manager Note: the original actual need for `SyncdDevice` per se now lies in the dustbin of time. However, this self-same object and its associated registration mechanism is also used as part of logic used to deal with abnormal device shutdown (e.g.: USB disconnects) and the processing thereof. The interface thus probably now deserves a better name.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `SyncdDevice.Manager`
    `static class` | `SyncdDevice.ShutdownReason` `SyncdDevice.ShutdownReason` indicates the health of the shutdown of the device.
    `static interface` | `SyncdDevice.Syncable`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `msAbnormalReopenInterval` When a device shuts down with `SyncdDevice.ShutdownReason.ABNORMAL_ATTEMPT_REOPEN`, this is the recommended duration of time to wait before attempting reopen.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `RobotUsbModule` | `getOwner()` Retrieves the owning module of this sync'd device.
    `SyncdDevice.ShutdownReason` | `getShutdownReason()` Has this device shutdown abnormally? Note that even if this method returns true that a close() will still be necessary to fully clean up associated resources.
    `void` | `setOwner(RobotUsbModule owner)` Records the owning module of this sync'd device.

- - ### Field Detail

    - #### msAbnormalReopenInterval

          static final int msAbnormalReopenInterval

      When a device shuts down with `SyncdDevice.ShutdownReason.ABNORMAL_ATTEMPT_REOPEN`, this is the recommended duration of time to wait before attempting reopen. It was only heuristically determined, and might thus perhaps be shortened
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getShutdownReason

          SyncdDevice.ShutdownReason getShutdownReason()

      Has this device shutdown abnormally? Note that even if this method returns true that a close() will still be necessary to fully clean up associated resources.
      Returns:
        whether the device has experienced an abnormal shutdown

    - #### setOwner

          void setOwner(RobotUsbModule owner)

      Records the owning module of this sync'd device. The owner of the device is the party that is responsible for the device's lifetime management, and thus who should be involved if the device experiences problems and needs to be shutdown or restarted.
      See Also:
        `getOwner()`

    - #### getOwner

          RobotUsbModule getOwner()

      Retrieves the owning module of this sync'd device.
      Returns:
        the `RobotUsbModule` which is the owner of this device
      See Also:
        `setOwner(RobotUsbModule)`