public abstract class ModernRoboticsUsbI2cController extends ModernRoboticsUsbDevice implements I2cController
ModernRoboticsUsbDevice.CreateReadWriteRunnableI2cController.I2cPortReadyBeginEndNotifications, I2cController.I2cPortReadyCallbackHardwareDevice.Manufacturer| Modifier and Type | Field and Description |
|---|---|
protected I2cController.I2cPortReadyBeginEndNotifications[] |
i2cPortReadyBeginEndCallbacks |
protected boolean |
notificationsActive |
protected int |
numberOfI2cPorts |
createReadWriteRunnable, readWriteRunnable, readWriteServiceI2C_BUFFER_START_ADDRESS| Constructor and Description |
|---|
ModernRoboticsUsbI2cController(int numberOfI2cPorts,
Context context,
SerialNumber serialNumber,
SyncdDevice.Manager manager,
OpenRobotUsbDevice openRobotUsbDevice,
ModernRoboticsUsbDevice.CreateReadWriteRunnable createReadWriteRunnable) |
| Modifier and Type | Method and Description |
|---|---|
void |
deregisterForPortReadyBeginEndCallback(int port)
Deregisters any existing notifications callback for the given port
|
I2cController.I2cPortReadyBeginEndNotifications |
getPortReadyBeginEndCallback(int port)
Returns the current callback registered for a given port
|
boolean |
isArmed()
Returns whether, as of this instant, this controller is alive and operational in
its normally expected mode; that is, whether it is currently in communication
with its underlying hardware or whether it is in some other state
|
void |
registerForPortReadyBeginEndCallback(I2cController.I2cPortReadyBeginEndNotifications callback,
int port)
Registers to be notification when portIsReady callbacks begin or cease
|
void |
shutdownComplete() |
void |
startupComplete() |
protected void |
throwIfI2cPortIsInvalid(int port) |
armDevice, disarmDevice, getCreateReadWriteRunnable, getDeviceName, getOpenRobotUsbDevice, getPretendDevice, getReadWriteRunnable, getVersion, initializeHardware, read, read8, readComplete, readFromWriteCache, readFromWriteCache, write, write8, write8, write8, writeCompleteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearI2cPortActionFlag, copyBufferIntoWriteBuffer, deregisterForPortReadyCallback, enableI2cReadMode, enableI2cWriteMode, getCopyOfReadBuffer, getCopyOfWriteBuffer, getI2cPortReadyCallback, getI2cReadCache, getI2cReadCacheLock, getI2cReadCacheTimeWindow, getI2cWriteCache, getI2cWriteCacheLock, getMaxI2cWriteLatency, getSerialNumber, isI2cPortActionFlagSet, isI2cPortInReadMode, isI2cPortInWriteMode, isI2cPortReady, readI2cCacheFromController, readI2cCacheFromModule, registerForI2cPortReadyCallback, setI2cPortActionFlag, writeI2cCacheToController, writeI2cCacheToModule, writeI2cPortFlagOnlyToController, writeI2cPortFlagOnlyToModuleclose, getConnectionInfo, getDeviceName, getManufacturer, getVersion, resetDeviceConfigurationForOpModeprotected final int numberOfI2cPorts
protected final I2cController.I2cPortReadyBeginEndNotifications[] i2cPortReadyBeginEndCallbacks
protected boolean notificationsActive
public ModernRoboticsUsbI2cController(int numberOfI2cPorts,
Context context,
SerialNumber serialNumber,
SyncdDevice.Manager manager,
OpenRobotUsbDevice openRobotUsbDevice,
ModernRoboticsUsbDevice.CreateReadWriteRunnable createReadWriteRunnable)
throws RobotCoreException,
java.lang.InterruptedException
RobotCoreExceptionjava.lang.InterruptedExceptionprotected void throwIfI2cPortIsInvalid(int port)
public boolean isArmed()
I2cControllerisArmed in interface I2cControllerpublic void registerForPortReadyBeginEndCallback(I2cController.I2cPortReadyBeginEndNotifications callback, int port)
I2cControllerregisterForPortReadyBeginEndCallback in interface I2cControllercallback - the callback to registerport - the port number to register the callback onpublic I2cController.I2cPortReadyBeginEndNotifications getPortReadyBeginEndCallback(int port)
I2cControllergetPortReadyBeginEndCallback in interface I2cControllerport - the port in questionpublic void deregisterForPortReadyBeginEndCallback(int port)
I2cControllerderegisterForPortReadyBeginEndCallback in interface I2cControllerport - the port in questionpublic void startupComplete()
throws java.lang.InterruptedException
startupComplete in interface ReadWriteRunnable.CallbackstartupComplete in class ModernRoboticsUsbDevicejava.lang.InterruptedExceptionpublic void shutdownComplete()
throws java.lang.InterruptedException
shutdownComplete in interface ReadWriteRunnable.CallbackshutdownComplete in class ModernRoboticsUsbDevicejava.lang.InterruptedException