|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectztex.ZtexDevice1
public class ZtexDevice1
A class representing an EZ-USB device that supports the ZTEX descriptor 1 or an unconfigured EZ-USB device.
Instances of this class are usually created by ZtexScanBus1
.
The following table describes the ZTEX descriptor 1.
Field name | Offset | Size | Description | ||||||||||||||||||||||||
ZTEX_DESCRIPTOR_SIZE | 0 | 1 | Size of the descriptor in bytes; must be 40 for descriptor version 1 | ||||||||||||||||||||||||
ZTEX_DESCRIPTOR_VERSION | 1 | 1 | Descriptor version; 1 for version 1 | ||||||||||||||||||||||||
ZTEXID | 2 | 4 | ID; must be "ZTEX" | ||||||||||||||||||||||||
PRODUCT_ID | 6 | 4 | Four numbers (0..255) representing the product ID and firmware compatibility information. A firmware can overwrite an installed one if ( INSTALLED.PRODUCTID[0]==0 || PRODUCTID[0]==0 || INSTALLED.PRODUCTID[0]==PRODUCTID[0] ) && ( INSTALLED.PRODUCTID[1]==0 || PRODUCTID[1]==0 || INSTALLED.PRODUCTID[1]==PRODUCTID[1] ) && ( INSTALLED.PRODUCTID[2]==0 || PRODUCTID[2]==0 || INSTALLED.PRODUCTID[2]==PRODUCTID[2] ) && ( INSTALLED.PRODUCTID[3]==0 || PRODUCTID[3]==0 || INSTALLED.PRODUCTID[3]==PRODUCTID[3] )Here is a list of the preserved product ID's:
|
||||||||||||||||||||||||
FW_VERSION | 10 | 1 | May be used to specify the firmware version. | ||||||||||||||||||||||||
INTERFACE_VERSION | 11 | 1 | The interface version. This number specifies the protocol that is used for interfacing the host software. A description of interface version 1 can be found in Ztex1v1 |
||||||||||||||||||||||||
INTERFACE_CAPABILITIES | 12 | 6 | 6 bytes, each bit represents a capability. If set, the capability is supported. A description of the capabilities of interface version 1 can be found in Ztex1v1 |
||||||||||||||||||||||||
MODULE_RESERVED | 18 | 12 | 12 bytes for application specific use, i.e. they depend from the PRODUCT_ID | ||||||||||||||||||||||||
SN_STRING | 30 | 10 | A serial number string of 10 characters. The default SN is "0000000000" |
Ztex1
,
Ztex1v1
,
ZtexScanBus1
Field Summary | |
---|---|
static int |
cypressProductId
EZ-USB USB product ID: 0x8613 |
static int |
cypressVendorId
Cypress vendor ID: 0x4b4 |
static int |
ztexProductId
USB product ID for ZTEX devices that support ZTEX descriptor 1: 0x100. |
static int |
ztexProductIdMax
Largest USB product ID for ZTEX devices that support ZTEX descriptor 1: 0x1ff. |
static int |
ztexVendorId
ZTEX vendor ID: 0x221a |
Constructor Summary | |
---|---|
ZtexDevice1(Usb_Device p_dev,
int pUsbVendorId,
int pUsbProductId,
boolean allowUnconfigured)
Constructs an instance from a given USB device. |
Method Summary | |
---|---|
static java.lang.String |
byteArrayString(byte[] buf)
Produces a nice string representation of an array of bytes. |
boolean |
compatible(int productId0,
int productId1,
int productId2,
int productId3)
Checks whether the given product ID is compatible to the device. |
Usb_Device |
dev()
Returns the USB device. |
int |
fwVersion()
Returns the firmware version. |
byte[] |
interfaceCapabilities()
Returns the interface capabilities (all 6 bytes). |
int |
interfaceCapabilities(int i)
Returns byte i of the interface capabilities. |
boolean |
interfaceCapabilities(int i,
int j)
Returns byte i, bit j of the interface capabilities. |
int |
interfaceVersion()
Returns the interface version. |
java.lang.String |
manufacturerString()
Returns the manufacturer string of the device. |
byte[] |
moduleReserved()
Returns the application specific information (all 12 bytes). |
int |
moduleReserved(int i)
Returns byte i of the application specific information. |
byte[] |
productId()
Returns the product ID (all 4 bytes). |
int |
productId(int i)
Returns byte i of the product ID. |
java.lang.String |
productString()
Returns the product string of the device. |
java.lang.String |
snString()
Returns the serial number string of the device. |
java.lang.String |
toString()
Returns a string representation if the device with a lot of useful information. |
int |
usbProductId()
Returns the USB product ID of the device. |
int |
usbVendorId()
Returns the USB vendor ID of the device. |
boolean |
valid()
Returns true if ZTEX descriptor 1 is available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int cypressVendorId
public static final int cypressProductId
public static final int ztexVendorId
public static final int ztexProductId
Please read the informations about USB vendor and product ID's.
ztexProductIdMax
,
Constant Field Values
public static final int ztexProductIdMax
ztexProductId
+1 to ztexProductIdMax (0x101 to 0x1ff) are reserved for ZTEX devices and allow to identify products without reading the ZTEX descriptor.
Please read the informations about USB vendor and product ID's.
ztexProductId
,
Constant Field Values
Constructor Detail |
---|
public ZtexDevice1(Usb_Device p_dev, int pUsbVendorId, int pUsbProductId, boolean allowUnconfigured) throws UsbException, InvalidFirmwareException, DeviceNotSupportedException
InvalidFirmwareException
is thrown.
To suppress this behavior (e.g. if the EZ-USB device is known to be unconfigured) the vendor and product id's
can be set to -1.
p_dev
- The USB device.pUsbVendorId
- The given vendor ID.pUsbProductId
- The given product ID.allowUnconfigured
- If true, unconfigured devices are allowed.
UsbException
- if an USB communication error occurs.
InvalidFirmwareException
- if no valid ZTEX descriptor 1 is found.
DeviceNotSupported
- if the device has the wrong USB ID's.
DeviceNotSupportedException
Method Detail |
---|
public static java.lang.String byteArrayString(byte[] buf)
buf
- A byte array.
public java.lang.String toString()
toString
in class java.lang.Object
public final boolean compatible(int productId0, int productId1, int productId2, int productId3)
if ( this.productId(0)==0 || productId0<=0 || this.productId(0)==productId0 ) && ( this.productId(0)==0 || productId1<=0 || this.productId(1)==productId1 ) && ( this.productId(2)==0 || productId2<=0 || this.productId(2)==productId2 ) && ( this.productId(3)==0 || productId3<=0 || this.productId(3)==productId3 )
productId0
- Byte 0 of the given product IDproductId1
- Byte 1 of the given product IDproductId2
- Byte 2 of the given product IDproductId3
- Byte 3 of the given product ID
public final Usb_Device dev()
public final boolean valid()
public final int usbVendorId()
public final int usbProductId()
public final java.lang.String manufacturerString()
public final java.lang.String productString()
public final java.lang.String snString()
public final byte[] productId()
public int productId(int i)
i
- index
public final int fwVersion()
public final int interfaceVersion()
public final byte[] interfaceCapabilities()
public final int interfaceCapabilities(int i)
i
- index
public final boolean interfaceCapabilities(int i, int j)
i
- byte indexj
- bit index
public final byte[] moduleReserved()
public final int moduleReserved(int i)
i
- index
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |