public class TestUsbLib extends Object
| Constructor and Description |
|---|
TestUsbLib() |
| Modifier and Type | Method and Description |
|---|---|
void |
claim(int ifcnum,
boolean force)
Claims an interface.
|
void |
connect(int index)
Connects to a USB device.
|
void |
connect(int vendId,
int devId,
String serial,
int index)
Connects to a USB device.
|
void |
disconnect()
Disconnects from a USB device.
|
void |
readBulk(int endp,
int leng,
int timeout)
Reads bulk data.
|
void |
readControl(int type,
int request,
int value,
int index,
int leng,
int timeout)
Reads from the control endpoint.
|
void |
release(int ifcnum)
Releases an interface.
|
void |
setConfig(int cfgnum)
Sets the active configuration.
|
void |
setInterface(int ifcnum,
int altnum)
Sets the alternate setting (interface).
|
void |
showBus()
Shows all the devices on the bus.
|
void |
showConfig()
Shows the active configuration in the connected device.
|
void |
showConfig(int cfgnum)
Shows a configuration in the connected device.
|
void |
showConfig(int cfgnum,
int devnum)
Shows a configuration in an arbitrary device.
|
void |
showDevice()
Shows the connected device.
|
void |
showDevice(int devnum)
Shows an arbitrary device.
|
void |
showEndpt(int endp,
int ifcnum)
Shows an endpoint in the current setting of the active configuration of
the connected device.
|
void |
showEndpt(int endp,
int ifcnum,
int altnum)
Shows an endpoint in the active configuration of the connected device.
|
void |
showEndpt(int endp,
int ifcnum,
int altnum,
int cfgnum)
Shows an arbitrary endpoint in the connected device.
|
void |
showEndpt(int endp,
int ifcnum,
int altnum,
int cfgnum,
int devnum)
Shows an arbitrary endpoint in an arbitrary device.
|
void |
showIntfce(int ifcnum)
Shows the interface with the current setting in the active
configuration of the connected device.
|
void |
showIntfce(int ifcnum,
int altnum)
Shows an interface in the active configuration of the connected device.
|
void |
showIntfce(int ifcnum,
int altnum,
int cfgnum)
Shows an arbitrary interface in the connected device.
|
void |
showIntfce(int ifcnum,
int altnum,
int cfgnum,
int devnum)
Shows an arbitrary interface in an arbitrary device.
|
void |
writeBulk(int endp,
int timeout,
int data0,
int... data)
Writes bulk data.
|
void |
writeControl(int type,
int request,
int value,
int index,
int timeout,
int data0,
int... data)
Writes to the control endpoint.
|
@Command(name="connect",
description="Connect to a USB device")
public void connect(@Argument(name="vendId",description="The vendor ID, or -1 for all")
int vendId,
@Argument(name="devId",description="The device ID, or -1 for all")
int devId,
@Argument(name="serial",description="The serial number, or empty for all")
String serial,
@Argument(name="index",description="Index in list of matching devices")
int index)
throws org.lsst.ccs.drivers.commons.DriverException
vendId - The vendor ID, or -1 for alldevId - The device ID, or -1 for allserial - The serial number, or empty for allindex - The index in the list of matching devicesorg.lsst.ccs.drivers.commons.DriverException@Command(name="connect",
description="Connect to a USB device")
public void connect(@Argument(name="index",description="Index in list of all devices")
int index)
throws org.lsst.ccs.drivers.commons.DriverException
index - The index in the list of all devicesorg.lsst.ccs.drivers.commons.DriverException@Command(name="disconnect",
description="Disconnect from a USB device")
public void disconnect()
@Command(name="readcontrol",
description="Read from the control endpoint")
public void readControl(@Argument(name="type",description="Request type")
int type,
@Argument(name="request",description="Request code")
int request,
@Argument(name="value",description="Value")
int value,
@Argument(name="index",description="Index")
int index,
@Argument(name="leng",description="No. bytes to read")
int leng,
@Argument(name="timeout",description="Timeout (ms)")
int timeout)
throws org.lsst.ccs.drivers.commons.DriverException
type - The request typerequest - The request codevalue - The valueindex - The indexleng - The number of bytes to readtimeout - The timeout (ms)org.lsst.ccs.drivers.commons.DriverException@Command(name="writecontrol",
description="Write to the control endpoint")
public void writeControl(@Argument(name="type",description="Request type")
int type,
@Argument(name="request",description="Request code")
int request,
@Argument(name="value",description="Value")
int value,
@Argument(name="index",description="Index")
int index,
@Argument(name="timeout",description="Timeout (ms)")
int timeout,
@Argument(name="data0",description="First byte of data to write")
int data0,
@Argument(name="data",description="The rest of the data to write")
int... data)
throws org.lsst.ccs.drivers.commons.DriverException
type - The request typerequest - The request codevalue - The valueindex - The indextimeout - The timeout (ms)data0 - The first byte to writedata - The remaining bytes to writeorg.lsst.ccs.drivers.commons.DriverException@Command(name="readbulk",
description="Read bulk data")
public void readBulk(@Argument(name="endpoint",description="Endpoint address")
int endp,
@Argument(name="leng",description="No. bytes to read")
int leng,
@Argument(name="timeout",description="Timeout (ms)")
int timeout)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint addressleng - The number of bytes to readtimeout - The timeout (ms)org.lsst.ccs.drivers.commons.DriverException@Command(name="writebulk",
description="Write bulk data")
public void writeBulk(@Argument(name="endpoint",description="Endpoint address")
int endp,
@Argument(name="timeout",description="Timeout (ms)")
int timeout,
@Argument(name="data0",description="First byte of data to write")
int data0,
@Argument(name="data",description="The rest of the data to write")
int... data)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint addresstimeout - The timeout (ms)data0 - The first byte to writedata - The remaining bytes to writeorg.lsst.ccs.drivers.commons.DriverException@Command(name="claim",
description="Claim an interface")
public void claim(@Argument(name="ifcnum",description="Interface number")
int ifcnum,
@Argument(name="force",description="Force the claim")
boolean force)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberforce - Whether to force the claimorg.lsst.ccs.drivers.commons.DriverException@Command(name="release",
description="Release an interface")
public void release(@Argument(name="ifcnum",description="Interface number")
int ifcnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="setconfig",
description="Sets the active configuration")
public void setConfig(@Argument(name="cfgnum",description="Configuration number")
int cfgnum)
throws org.lsst.ccs.drivers.commons.DriverException
cfgnum - The configuration numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="setinterface",
description="Sets the interface")
public void setInterface(@Argument(name="ifcnum",description="Interface number")
int ifcnum,
@Argument(name="altnum",description="Alternate setting number")
int altnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberaltnum - The alternate setting numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="showbus",
description="Show all the devices on the bus")
public void showBus()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="showdevice",
description="Show a device")
public void showDevice(@Argument(name="devnum",description="Device number")
int devnum)
throws org.lsst.ccs.drivers.commons.DriverException
devnum - The index in the list of all devicesorg.lsst.ccs.drivers.commons.DriverException@Command(name="showdevice",
description="Show the connected device")
public void showDevice()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="showconfig",
description="Show a configuration")
public void showConfig(@Argument(name="cfgnum",description="Configuration number")
int cfgnum,
@Argument(name="devnum",description="Device number")
int devnum)
throws org.lsst.ccs.drivers.commons.DriverException
cfgnum - The configuration numberdevnum - The index in the list of all devicesorg.lsst.ccs.drivers.commons.DriverException@Command(name="showconfig",
description="Show a configuration")
public void showConfig(@Argument(name="cfgnum",description="Configuration number")
int cfgnum)
throws org.lsst.ccs.drivers.commons.DriverException
cfgnum - The configuration numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="showconfig",
description="Show the active configuration")
public void showConfig()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="showinterface",
description="Show an interface")
public void showIntfce(@Argument(name="ifcnum",description="Interface number")
int ifcnum,
@Argument(name="altnum",description="Alternate setting number")
int altnum,
@Argument(name="cfgnum",description="Configuration number")
int cfgnum,
@Argument(name="devnum",description="Device number")
int devnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberaltnum - The alternate setting numbercfgnum - The configuration numberdevnum - The index in the list of all devicesorg.lsst.ccs.drivers.commons.DriverException@Command(name="showinterface",
description="Show an interface")
public void showIntfce(@Argument(name="ifcnum",description="Interface number")
int ifcnum,
@Argument(name="altnum",description="Alternate setting number")
int altnum,
@Argument(name="cfgnum",description="Configuration number")
int cfgnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberaltnum - The alternate setting numbercfgnum - The configuration numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="showinterface",
description="Show an interface")
public void showIntfce(@Argument(name="ifcnum",description="Interface number")
int ifcnum,
@Argument(name="altnum",description="Alternate setting number")
int altnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberaltnum - The alternate setting numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="showinterface",
description="Show an interface")
public void showIntfce(@Argument(name="ifcnum",description="Interface number")
int ifcnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="showendpoint",
description="Show an endpoint")
public void showEndpt(@Argument(name="endp",description="Endpoint address")
int endp,
@Argument(name="ifcnum",description="Interface number")
int ifcnum,
@Argument(name="altnum",description="Alternate setting number")
int altnum,
@Argument(name="cfgnum",description="Configuration number")
int cfgnum,
@Argument(name="devnum",description="Device number")
int devnum)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint addressifcnum - The interface numberaltnum - The alternate setting numbercfgnum - The configuration numberdevnum - The index in the list of all devicesorg.lsst.ccs.drivers.commons.DriverException@Command(name="showendpoint",
description="Show an endpoint")
public void showEndpt(@Argument(name="endp",description="Endpoint address")
int endp,
@Argument(name="ifcnum",description="Interface number")
int ifcnum,
@Argument(name="altnum",description="Alternate setting number")
int altnum,
@Argument(name="cfgnum",description="Configuration number")
int cfgnum)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint addressifcnum - The interface numberaltnum - The alternate setting numbercfgnum - The configuration numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="showendpoint",
description="Show an endpoint")
public void showEndpt(@Argument(name="endp",description="Endpoint address")
int endp,
@Argument(name="ifcnum",description="Interface number")
int ifcnum,
@Argument(name="altnum",description="Alternate setting number")
int altnum)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint addressifcnum - The interface numberaltnum - The alternate setting numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="showendpoint",
description="Show an endpoint")
public void showEndpt(@Argument(name="endp",description="Endpoint address")
int endp,
@Argument(name="ifcnum",description="Interface number")
int ifcnum)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint addressifcnum - The interface numberorg.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2015 LSST. All rights reserved.