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:
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.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 |
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. |
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.
|
static final int msAbnormalReopenInterval
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 shortenedSyncdDevice.ShutdownReason getShutdownReason()
void setOwner(RobotUsbModule owner)
getOwner()
RobotUsbModule getOwner()
RobotUsbModule
which is the owner of this devicesetOwner(RobotUsbModule)