public abstract class I2cDeviceSynchDevice<T extends I2cDeviceSynchSimple> extends java.lang.Object implements HardwareDevice
I2cDeviceSynchDevice
instances are I2c devices which are built on top of
I2cDeviceSynchSimple instances or subclasses thereof. The class provides common and handy utility services
for such devices.HardwareDevice.Manufacturer
Modifier and Type | Field and Description |
---|---|
protected T |
deviceClient |
protected boolean |
deviceClientIsOwned |
protected boolean |
isInitialized |
Modifier | Constructor and Description |
---|---|
protected |
I2cDeviceSynchDevice(T deviceClient,
boolean isOwned) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this device
|
protected void |
disengage() |
protected abstract boolean |
doInitialize()
Actually carries out the initialization of the instance.
|
protected void |
engage() |
java.lang.String |
getConnectionInfo()
Get connection information about this device in a human readable format
|
int |
getVersion()
Version
|
boolean |
initialize() |
protected void |
initializeIfNecessary() |
void |
onModuleStateChange(RobotArmingStateNotifier module,
RobotArmingStateNotifier.ARMINGSTATE state) |
protected void |
registerArmingStateCallback() |
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDeviceName, getManufacturer
protected T extends I2cDeviceSynchSimple deviceClient
protected boolean deviceClientIsOwned
protected boolean isInitialized
protected I2cDeviceSynchDevice(T deviceClient, boolean isOwned)
protected void registerArmingStateCallback()
protected void engage()
protected void disengage()
public void onModuleStateChange(RobotArmingStateNotifier module, RobotArmingStateNotifier.ARMINGSTATE state)
protected void initializeIfNecessary()
public boolean initialize()
protected abstract boolean doInitialize()
public void resetDeviceConfigurationForOpMode()
HardwareDevice
resetDeviceConfigurationForOpMode
in interface HardwareDevice
public void close()
HardwareDevice
close
in interface HardwareDevice
public int getVersion()
HardwareDevice
getVersion
in interface HardwareDevice
public java.lang.String getConnectionInfo()
HardwareDevice
getConnectionInfo
in interface HardwareDevice