|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--usb.core.Device | +--usb.windows.DeviceImpl | +--usb.windows.JUSB
Provides access to the devices using and configured with the jUSB driver. This involves that a device must first be configured with the jUSB driver. How you can replace a driver from an USB device and attach the jUSB driver is completly explained in Appendix D in the JavaUSBAPIfor Windows documentation found on www.steelbrothers.ch/jusb/.
Field Summary |
Fields inherited from class usb.windows.DeviceImpl |
configuration, descriptor, EXTERNAL_HUB, NO_DEVICE_CONNECTED, USB_DEVICE |
Fields inherited from class usb.core.Device |
DEVICE_REMOTE_WAKEUP, DEVICE_SELFPOWERED |
Constructor Summary | |
JUSB(USB bus,
DeviceImpl hub,
java.lang.String devicePath,
int address,
java.lang.String driverKeyName,
java.lang.String friendlyDevName,
java.lang.String uniqueID,
int portIndex)
Creates a new instance of JUSB |
Method Summary | |
void |
claimInterface(int ifnum)
Not implemented yet! |
int |
clearHalt(byte ep)
Not implemented yet! |
Device |
getChild(int port)
Not implemented yet! |
java.lang.String |
getClaimer(int ifnum)
Not implemented yet! |
byte[] |
getConfigBuf(int n)
Returns a buffer holding the entire set of configuration descriptors for the specified configuration. |
Configuration |
getConfiguration()
Returns the default configuration from the device. |
Configuration |
getConfiguration(int index)
Not implemented for all devices. |
java.lang.String |
getSpeed()
Not implemented yet! |
byte[] |
readBulk(int ep,
int length)
Not implemented yet! |
byte[] |
readControl(byte type,
byte request,
short value,
short index,
short length)
All USB device respond to request from the host on the device's Default ControlPipe. |
byte[] |
readIntr(int ep,
int len)
Reads a specified number of bytes from a INTERRUPT IN endpoint. |
void |
releaseInterface(int ifnum)
Not implemented yet! |
void |
setInterface(int ifnum,
int alt)
Not implemented yet! |
void |
writeBulk(int ep,
byte[] buf)
Not implemented yet! |
void |
writeControl(byte type,
byte request,
short value,
short index,
byte[] buf)
Not implemented yet! |
void |
writeIntr(int ep,
byte[] buf)
Not implemented yet! |
Methods inherited from class usb.windows.DeviceImpl |
closeHandle, getConfigurationDescriptor, getDeviceDescriptor, getDeviceDescriptor, getDeviceFriendlyName, getDevicePath, getDriverKeyName, getFriendlyDeviceName, getHub, getHubPortNum, getNumPorts, getUniqueDeviceID, openHandle, printByteArray |
Methods inherited from class usb.core.Device |
control, getAddress, getBus, getPortIdentifier, getSPI, getString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JUSB(USB bus, DeviceImpl hub, java.lang.String devicePath, int address, java.lang.String driverKeyName, java.lang.String friendlyDevName, java.lang.String uniqueID, int portIndex) throws java.io.IOException
Method Detail |
public void claimInterface(int ifnum) throws java.io.IOException
claimInterface
in interface DeviceSPI
ifnum
- Number from the descriptor, returned by
Interface.getNumber()
.
java.io.IOException
DeviceSPI.releaseInterface(int)
public int clearHalt(byte ep) throws java.io.IOException
clearHalt
in interface DeviceSPI
ep
- Endpoint address and direction, as returned by
Endpoint.getEndpoint()
.
java.io.IOException
public Device getChild(int port) throws java.io.IOException
getChild
in interface DeviceSPI
getChild
in class DeviceImpl
port
- Number of the hub port of interest, from one to the
Hub.getNumPorts()
.
java.io.IOException
public java.lang.String getClaimer(int ifnum) throws java.io.IOException
getClaimer
in interface DeviceSPI
ifnum
- Number from the descriptor, returned by
Interface.getNumber()
.
java.io.IOException
public byte[] getConfigBuf(int n) throws java.io.IOException
DeviceSPI
getConfigBuf
in interface DeviceSPI
n
- Number of the configuration, from zero to the limit
specified by DeviceDescriptor.getNumConfigurations()
java.io.IOException
public byte[] readBulk(int ep, int length) throws java.io.IOException
readBulk
in interface DeviceSPI
ep
- Endpoint direction and address, as specified in an
endpoint descriptor by Endpoint.getEndpoint()
.length
- How many bytes to read.
java.io.IOException
public byte[] readControl(byte type, byte request, short value, short index, short length) throws java.io.IOException
readControl
in interface DeviceSPI
type
- Masked together using three constants from
ControlMessage
: DIR_TO_HOST, a TYPE_*, and a RECIP_*.request
- bRequest field, either standard (from table 9-3 in
the USB 2.0 specification) for TYPE_STANDARD, or else as specified
in the class or vendor device type specification.value
- sixteen bit field associated with requestindex
- sixteen bit field associated with requestlength
- How much data should be read; may be zero to indicate
that no READ phase follows the SETUP packet.
java.io.IOException
public byte[] readIntr(int ep, int len) throws java.io.IOException
DeviceSPI
This blocks until an interrupt transfer completes. It's the
caller's responsibility to ensure that the endpoint is polled
often enough to meet Endpoint.getInterval()
requirements
after a transfer completes.
An endpoint's interface should be claimed before it is used for interrupt I/O.
readIntr
in interface DeviceSPI
ep
- Endpoint direction and address, as specified in an
endpoint descriptor by Endpoint.getEndpoint()
.
java.io.IOException
public void releaseInterface(int ifnum) throws java.io.IOException
releaseInterface
in interface DeviceSPI
ifnum
- Number from the descriptor, returned by
Interface.getNumber()
.
java.io.IOException
DeviceSPI.claimInterface(int)
public void setInterface(int ifnum, int alt) throws java.io.IOException
setInterface
in interface DeviceSPI
ifnum
- Number from the descriptor, returned by
Interface.getNumber()
.alt
- Number from the descriptor, returned by
Interface.getAlternateSetting()
.
java.io.IOException
public void writeBulk(int ep, byte[] buf) throws java.io.IOException
writeBulk
in interface DeviceSPI
ep
- Endpoint direction and address, as specified in an
endpoint descriptor by Endpoint.getEndpoint()
.buf
- The bytes to write.
java.io.IOException
public void writeControl(byte type, byte request, short value, short index, byte[] buf) throws java.io.IOException
writeControl
in interface DeviceSPI
type
- Masked together using three constants from
ControlMessage
: DIR_TO_DEVICE, a TYPE_*, and a RECIP_*.request
- bRequest field, either standard (from table 9-3 in
the USB 2.0 specification) for TYPE_STANDARD, or else as specified
in the class or vendor device type specification.value
- sixteen bit field associated with requestindex
- sixteen bit field associated with requestbuf
- The data to be written. Length may be zero to indicate
that no WRITe phase follows the SETUP packet.
java.io.IOException
public void writeIntr(int ep, byte[] buf) throws java.io.IOException
writeIntr
in interface DeviceSPI
ep
- Endpoint direction and address, as specified in an
endpoint descriptor by Endpoint.getEndpoint()
.buf
- The bytes to write.
java.io.IOException
public java.lang.String getSpeed()
getSpeed
in class DeviceImpl
public Configuration getConfiguration(int index) throws java.io.IOException
DeviceImpl
getConfiguration
in class DeviceImpl
java.io.IOException
public Configuration getConfiguration() throws java.io.IOException
DeviceImpl
getConfiguration
in class DeviceImpl
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |