public class LynxUsbDeviceDelegate extends java.lang.Object implements LynxUsbDevice, HardwareDeviceCloseOnTearDown
RobotArmingStateNotifier.ARMINGSTATE, RobotArmingStateNotifier.CallbackHardwareDevice.Manufacturer| Modifier and Type | Field and Description |
|---|---|
protected LynxUsbDeviceImpl |
delegate |
protected boolean |
isOpen |
protected boolean |
releaseOnClose |
static java.lang.String |
TAG |
| Constructor and Description |
|---|
LynxUsbDeviceDelegate(LynxUsbDeviceImpl lynxUsbDevice) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquireNetworkTransmissionLock(LynxMessage message) |
void |
addConfiguredModule(LynxModule module) |
void |
arm()
Causes the module to attempt to enter the armed state.
|
void |
armOrPretend()
Causes the module to attempt to enter the armed state, but if that is not possible, to
enter the pretending state.
|
protected void |
assertOpen() |
void |
changeModuleAddress(LynxModule module,
int newAddress,
java.lang.Runnable runnable) |
void |
clearGlobalWarning()
Clears any currently set warning (if permitted) for this source, and zeros
the sources suppression count.
|
void |
close()
Causes the module to attempt to enter the closed state.
|
void |
disarm()
Causes the module to attempt to enter the disarmed state.
|
LynxModuleMetaList |
discoverModules() |
void |
disengage()
Disengage the object from underlying services it uses to render its function.
|
void |
engage()
(Re)enage the object with its underlying services.
|
void |
failSafe() |
RobotArmingStateNotifier.ARMINGSTATE |
getArmingState()
Returns the current arming state of the object.
|
LynxModule |
getConfiguredModule(int moduleAddress) |
java.lang.String |
getConnectionInfo()
Get connection information about this device in a human readable format
|
LynxUsbDeviceImpl |
getDelegationTarget() |
java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of device.
|
java.lang.String |
getGlobalWarning()
Returns the current warning associated with this warning source.
|
HardwareDevice.Manufacturer |
getManufacturer()
Returns an indication of the manufacturer of this device.
|
RobotUsbModule |
getOwner() |
RobotUsbDevice |
getRobotUsbDevice() |
SerialNumber |
getSerialNumber()
Returns the serial number of this USB module
|
ShutdownReason |
getShutdownReason() |
int |
getVersion()
Version
|
boolean |
isEngaged()
Returns whether the object is currently in the engaged state.
|
boolean |
isSystemSynthetic() |
void |
lockNetworkLockAcquisitions() |
void |
noteMissingModule(LynxModule module,
java.lang.String moduleName) |
void |
pretend()
Causes the module to attempt to enter the pretending state.
|
void |
registerCallback(RobotArmingStateNotifier.Callback callback,
boolean doInitialCallback)
Registers a callback for arming state notifications from this module.
|
void |
releaseNetworkTransmissionLock(LynxMessage message) |
void |
removeConfiguredModule(LynxModule module) |
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
boolean |
setControlHubModuleAddressIfNecessary() |
void |
setGlobalWarning(java.lang.String warning)
Sets the current warning associated with this warning source, if permitted to do so
by the source.
|
void |
setOwner(RobotUsbModule owner) |
void |
setSystemSynthetic(boolean systemSynthetic) |
void |
setThrowOnNetworkLockAcquisition(boolean shouldThrow) |
void |
suppressGlobalWarning(boolean suppress)
Suppress or desupress the contributions of warnings by this source.
|
void |
transmit(LynxMessage message) |
void |
unregisterCallback(RobotArmingStateNotifier.Callback callback)
Unregister a callback which has been registered for notifications with this module.
|
public static java.lang.String TAG
protected LynxUsbDeviceImpl delegate
protected boolean releaseOnClose
protected boolean isOpen
public LynxUsbDeviceDelegate(LynxUsbDeviceImpl lynxUsbDevice)
public LynxUsbDeviceImpl getDelegationTarget()
getDelegationTarget in interface LynxUsbDevicepublic void close()
RobotUsbModuleclose in interface HardwareDeviceclose in interface HardwareDeviceCloseOnTearDownclose in interface RobotCoreLynxUsbDeviceclose in interface RobotUsbModuleRobotUsbModuleprotected void assertOpen()
public void disengage()
Engagablepublic void engage()
Engagablepublic boolean isEngaged()
Engagablepublic RobotUsbDevice getRobotUsbDevice()
getRobotUsbDevice in interface LynxUsbDevicepublic boolean isSystemSynthetic()
isSystemSynthetic in interface LynxUsbDevicepublic void setSystemSynthetic(boolean systemSynthetic)
setSystemSynthetic in interface LynxUsbDevicepublic void failSafe()
failSafe in interface LynxUsbDevicefailSafe in interface RobotCoreLynxUsbDevicepublic void lockNetworkLockAcquisitions()
lockNetworkLockAcquisitions in interface RobotCoreLynxUsbDevicepublic void setThrowOnNetworkLockAcquisition(boolean shouldThrow)
setThrowOnNetworkLockAcquisition in interface RobotCoreLynxUsbDevicepublic void changeModuleAddress(LynxModule module, int newAddress, java.lang.Runnable runnable)
changeModuleAddress in interface LynxUsbDevicepublic void noteMissingModule(LynxModule module, java.lang.String moduleName)
noteMissingModule in interface LynxUsbDevicepublic void addConfiguredModule(LynxModule module) throws RobotCoreException, java.lang.InterruptedException, LynxNackException
addConfiguredModule in interface LynxUsbDeviceRobotCoreExceptionjava.lang.InterruptedExceptionLynxNackExceptionpublic LynxModule getConfiguredModule(int moduleAddress)
getConfiguredModule in interface LynxUsbDevicepublic void removeConfiguredModule(LynxModule module)
removeConfiguredModule in interface LynxUsbDevicepublic LynxModuleMetaList discoverModules() throws RobotCoreException, java.lang.InterruptedException
discoverModules in interface LynxUsbDevicediscoverModules in interface RobotCoreLynxUsbDeviceRobotCoreExceptionjava.lang.InterruptedExceptionpublic void acquireNetworkTransmissionLock(LynxMessage message) throws java.lang.InterruptedException
acquireNetworkTransmissionLock in interface LynxUsbDevicejava.lang.InterruptedExceptionpublic void releaseNetworkTransmissionLock(LynxMessage message) throws java.lang.InterruptedException
releaseNetworkTransmissionLock in interface LynxUsbDevicejava.lang.InterruptedExceptionpublic void transmit(LynxMessage message) throws java.lang.InterruptedException
transmit in interface LynxUsbDevicejava.lang.InterruptedExceptionpublic boolean setControlHubModuleAddressIfNecessary()
throws RobotCoreException,
java.lang.InterruptedException
setControlHubModuleAddressIfNecessary in interface LynxUsbDeviceRobotCoreExceptionjava.lang.InterruptedExceptionpublic java.lang.String getDeviceName()
HardwareDevicegetDeviceName in interface HardwareDevicepublic java.lang.String getConnectionInfo()
HardwareDevicegetConnectionInfo in interface HardwareDevicepublic int getVersion()
HardwareDevicegetVersion in interface HardwareDevicepublic HardwareDevice.Manufacturer getManufacturer()
HardwareDevicegetManufacturer in interface HardwareDevicepublic void resetDeviceConfigurationForOpMode()
HardwareDeviceresetDeviceConfigurationForOpMode in interface HardwareDevicepublic ShutdownReason getShutdownReason()
public void setOwner(RobotUsbModule owner)
public RobotUsbModule getOwner()
public SerialNumber getSerialNumber()
RobotArmingStateNotifiergetSerialNumber in interface RobotArmingStateNotifierpublic RobotArmingStateNotifier.ARMINGSTATE getArmingState()
RobotArmingStateNotifiergetArmingState in interface RobotArmingStateNotifierpublic void registerCallback(RobotArmingStateNotifier.Callback callback, boolean doInitialCallback)
RobotArmingStateNotifierregisterCallback in interface RobotArmingStateNotifierRobotArmingStateNotifier.unregisterCallback(Callback)public void unregisterCallback(RobotArmingStateNotifier.Callback callback)
RobotArmingStateNotifierunregisterCallback in interface RobotArmingStateNotifierRobotArmingStateNotifier.registerCallback(Callback, boolean)public void arm()
throws RobotCoreException,
java.lang.InterruptedException
RobotUsbModulearm in interface RobotUsbModuleRobotCoreExceptionjava.lang.InterruptedExceptionRobotUsbModulepublic void pretend()
throws RobotCoreException,
java.lang.InterruptedException
RobotUsbModulepretend in interface RobotUsbModuleRobotCoreExceptionjava.lang.InterruptedExceptionRobotUsbModulepublic void armOrPretend()
throws RobotCoreException,
java.lang.InterruptedException
RobotUsbModulearmOrPretend in interface RobotUsbModuleRobotCoreExceptionjava.lang.InterruptedExceptionRobotUsbModulepublic void disarm()
throws RobotCoreException,
java.lang.InterruptedException
RobotUsbModuledisarm in interface RobotUsbModuleRobotCoreExceptionjava.lang.InterruptedExceptionRobotUsbModulepublic java.lang.String getGlobalWarning()
GlobalWarningSourcegetGlobalWarning in interface GlobalWarningSourcepublic void suppressGlobalWarning(boolean suppress)
GlobalWarningSourceGlobalWarningSource.getGlobalWarning() will always return an empty string. Internally,
a supression count is maintained which is incremented if 'suppress' is true and decremented
if it is false. The initial value of the count is zero; suppression is in effect if the
count is greater than zero.suppressGlobalWarning in interface GlobalWarningSourcesuppress - whether to suppress or desupress warnings associated with this sourceGlobalWarningSource.clearGlobalWarning()public void setGlobalWarning(java.lang.String warning)
GlobalWarningSourcesetGlobalWarning in interface GlobalWarningSourcewarning - the warning to be associated with this sourcesGlobalWarningSource.clearGlobalWarning()public void clearGlobalWarning()
GlobalWarningSourceclearGlobalWarning in interface GlobalWarningSourceGlobalWarningSource.setGlobalWarning(String)