public abstract class ModernRoboticsUsbController extends ModernRoboticsUsbDevice
Modifier and Type | Class and Description |
---|---|
protected static class |
ModernRoboticsUsbController.WRITE_STATUS |
ModernRoboticsUsbDevice.CreateReadWriteRunnable
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
callbackLock |
protected java.util.concurrent.atomic.AtomicInteger |
callbackWaiterCount |
protected java.lang.Object |
concurrentClientLock |
protected java.util.concurrent.atomic.AtomicLong |
readCompletionCount |
protected boolean |
readWriteRunnableIsRunning |
protected ModernRoboticsUsbController.WRITE_STATUS |
writeStatus |
createReadWriteRunnable, readWriteRunnable, readWriteService
Constructor and Description |
---|
ModernRoboticsUsbController(Context context,
SerialNumber serialNumber,
SyncdDevice.Manager manager,
OpenRobotUsbDevice openRobotUsbDevice,
ModernRoboticsUsbDevice.CreateReadWriteRunnable createReadWriteRunnable) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isOkToReadOrWrite() |
byte[] |
read(int address,
int size)
Read from device
|
void |
readComplete() |
void |
shutdownComplete() |
void |
startupComplete() |
void |
write(int address,
byte[] data)
Write to device
|
void |
writeComplete() |
armDevice, disarmDevice, getCreateReadWriteRunnable, getDeviceName, getOpenRobotUsbDevice, getPretendDevice, getReadWriteRunnable, getVersion, initializeHardware, read8, readFromWriteCache, readFromWriteCache, write8, write8, write8
protected ModernRoboticsUsbController.WRITE_STATUS writeStatus
protected boolean readWriteRunnableIsRunning
protected final java.util.concurrent.atomic.AtomicInteger callbackWaiterCount
protected final java.util.concurrent.atomic.AtomicLong readCompletionCount
protected final java.lang.Object concurrentClientLock
protected final java.lang.Object callbackLock
public ModernRoboticsUsbController(Context context, SerialNumber serialNumber, SyncdDevice.Manager manager, OpenRobotUsbDevice openRobotUsbDevice, ModernRoboticsUsbDevice.CreateReadWriteRunnable createReadWriteRunnable) throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
public void write(int address, byte[] data)
ModernRoboticsUsbDevice
write
in class ModernRoboticsUsbDevice
address
- address to writedata
- data to writepublic byte[] read(int address, int size)
ModernRoboticsUsbDevice
read
in class ModernRoboticsUsbDevice
address
- address to readsize
- number of bytes to readpublic void writeComplete() throws java.lang.InterruptedException
writeComplete
in interface ReadWriteRunnable.Callback
writeComplete
in class ModernRoboticsUsbDevice
java.lang.InterruptedException
public void readComplete() throws java.lang.InterruptedException
readComplete
in interface ReadWriteRunnable.Callback
readComplete
in class ModernRoboticsUsbDevice
java.lang.InterruptedException
protected boolean isOkToReadOrWrite()
public void startupComplete()
startupComplete
in interface ReadWriteRunnable.Callback
startupComplete
in class ModernRoboticsUsbDevice
public void shutdownComplete()
shutdownComplete
in interface ReadWriteRunnable.Callback
shutdownComplete
in class ModernRoboticsUsbDevice