public class UsbDevice extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
attachDriver(int ifcnum)
Re-attaches a kernel driver to an interface.
|
void |
bulkFlush(int endp)
Flushes bulk data from an endpoint.
|
int |
bulkRead(int endp,
byte[] data,
int offset,
int leng,
int timeout)
Reads bulk data from an endpoint.
|
int |
bulkWrite(int endp,
byte[] data,
int offset,
int leng,
int timeout)
Writes bulk data to an endpoint.
|
void |
claimInterface(int ifcnum,
boolean force)
Claims an interface.
|
void |
close()
Closes the device.
|
int |
controlRead(int type,
int rqst,
int value,
int index,
byte[] data,
int offset,
int leng,
int timeout)
Reads from a control endpoint.
|
int |
controlWrite(int type,
int rqst,
int value,
int index,
byte[] data,
int offset,
int leng,
int timeout)
Writes to a control endpoint.
|
void |
detachDriver(int ifcnum)
Detaches a kernel driver from an interface.
|
UsbConfiguration |
getActiveConfiguration()
Gets the active configuration.
|
int |
getActiveConfigurationNumber()
Gets the active configuration number.
|
int |
getAddress()
Gets the device address.
|
int |
getAltSetting(int ifcnum)
Gets an alternate setting.
|
int |
getBusNumber()
Gets the bus number.
|
UsbConfiguration |
getConfiguration(int index)
Gets a configuration by its index.
|
UsbConfiguration |
getConfigurationByValue(int value)
Gets a configuration by its value.
|
List<UsbConfiguration> |
getConfigurations()
Gets the list of available configurations.
|
UsbDeviceDescriptor |
getDescriptor()
Gets the device descriptor.
|
String |
getManufacturer()
Gets the manufacturer string.
|
int |
getPortNumber()
Gets the port number.
|
String |
getProduct()
Gets the product string.
|
String |
getSerialNumber()
Gets the serial number string.
|
int |
getSpeed()
Gets the negotiated device speed.
|
String |
getString(int index)
Gets a string (descriptor).
|
int |
interruptRead(int endp,
byte[] data,
int offset,
int leng,
int timeout)
Reads interrupt data from an endpoint.
|
int |
interruptWrite(int endp,
byte[] data,
int offset,
int leng,
int timeout)
Writes interrupt data to an endpoint.
|
void |
releaseInterface(int ifcnum)
Releases an interface.
|
void |
reset()
Resets the device.
|
void |
setActiveConfiguration(int cfgnum)
Sets the active configuration (by number).
|
void |
setAltSetting(int ifcnum,
int altnum)
Selects an alternate setting.
|
void |
setAutoDetachDriver(boolean enable)
Sets the auto-detach kernel driver option.
|
public UsbDeviceDescriptor getDescriptor()
public int getBusNumber()
public int getPortNumber()
public int getAddress()
public int getSpeed()
public List<UsbConfiguration> getConfigurations() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic UsbConfiguration getActiveConfiguration() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic UsbConfiguration getConfiguration(int index) throws org.lsst.ccs.drivers.commons.DriverException
index - The index of the configurationorg.lsst.ccs.drivers.commons.DriverExceptionpublic UsbConfiguration getConfigurationByValue(int value) throws org.lsst.ccs.drivers.commons.DriverException
value - The configuration valueorg.lsst.ccs.drivers.commons.DriverExceptionpublic void close()
public int getActiveConfigurationNumber()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setActiveConfiguration(int cfgnum)
throws org.lsst.ccs.drivers.commons.DriverException
cfgnum - The configuration numberorg.lsst.ccs.drivers.commons.DriverExceptionpublic void claimInterface(int ifcnum,
boolean force)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberforce - Whether to force the claimorg.lsst.ccs.drivers.commons.DriverExceptionpublic void releaseInterface(int ifcnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberorg.lsst.ccs.drivers.commons.DriverExceptionpublic void detachDriver(int ifcnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberorg.lsst.ccs.drivers.commons.DriverExceptionpublic void attachDriver(int ifcnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberorg.lsst.ccs.drivers.commons.DriverExceptionpublic void setAutoDetachDriver(boolean enable)
throws org.lsst.ccs.drivers.commons.DriverException
enable - Whether to enable the auto-detach optionorg.lsst.ccs.drivers.commons.DriverExceptionpublic void setAltSetting(int ifcnum,
int altnum)
throws org.lsst.ccs.drivers.commons.DriverException
ifcnum - The interface numberaltnum - The alternate setting numberorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getAltSetting(int ifcnum)
ifcnum - The interface numberpublic String getString(int index)
index - The index of the stringpublic String getManufacturer()
public String getProduct()
public String getSerialNumber()
public void reset()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int controlRead(int type,
int rqst,
int value,
int index,
byte[] data,
int offset,
int leng,
int timeout)
throws org.lsst.ccs.drivers.commons.DriverException
type - The transfer typerqst - The request parametervalue - The value parameterindex - The index parameterdata - The array to which the data is readoffset - The offset to the start of the read dataleng - The number of bytes to readtimeout - The timeout (ms)org.lsst.ccs.drivers.commons.DriverExceptionpublic int controlWrite(int type,
int rqst,
int value,
int index,
byte[] data,
int offset,
int leng,
int timeout)
throws org.lsst.ccs.drivers.commons.DriverException
type - The transfer typerqst - The request parametervalue - The value parameterindex - The index parameterdata - The array from which the data is writtenoffset - The offset to the start of the dataleng - The number of bytes to writetimeout - The timeout (ms)org.lsst.ccs.drivers.commons.DriverExceptionpublic int bulkRead(int endp,
byte[] data,
int offset,
int leng,
int timeout)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint address.data - The array to which the data is readoffset - The offset to the start of the read dataleng - The number of bytes to readtimeout - The timeout (ms)org.lsst.ccs.drivers.commons.DriverExceptionpublic void bulkFlush(int endp)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint address.org.lsst.ccs.drivers.commons.DriverExceptionpublic int bulkWrite(int endp,
byte[] data,
int offset,
int leng,
int timeout)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint address.data - The array from which the data is writtenoffset - The offset to the start of the written dataleng - The number of bytes to writetimeout - The timeout (ms)org.lsst.ccs.drivers.commons.DriverExceptionpublic int interruptRead(int endp,
byte[] data,
int offset,
int leng,
int timeout)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint address.data - The array to which the data is readoffset - The offset to the start of the read dataleng - The number of bytes to readtimeout - The timeout (ms)org.lsst.ccs.drivers.commons.DriverExceptionpublic int interruptWrite(int endp,
byte[] data,
int offset,
int leng,
int timeout)
throws org.lsst.ccs.drivers.commons.DriverException
endp - The endpoint address.data - The array from which the data is writtenoffset - The offset to the start of the written dataleng - The number of bytes to writetimeout - The timeout (ms)org.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2023 LSST. All rights reserved.