USBTrace : Class Decoding : Vendor Specific
Download USBTrace and class decoders:
Send us your feedback
Download custom device class decoder sample:
With the help of vendor class decoder you can write your own custom device class decoders, for your devices which belong to the vendor specific USB device class (Class Code: 0xFF).
Refer Sample Code for writing your own vendor decoder DLL. The output DLL (named vsdecoder.dll) should be copied to USBTrace installation directory.
How to write your custom device class decoder DLL ?
The custom device class decoder which you should write is a Windows DLL which has the following 2 exported functions implemented:
You can modify this sample to implement your own device class decoder.
GetReqName
In this function, you will have to return the name of the given request (Ex: "SetPortDetails"). The request name must be filled in the sReqName parameter. Request details such as bmRequestType, bRequest, wValue, wIndex are as per the USB specification (Setup Packet, 8 Bytes). Request data and length of the data (pData, nDataLen) are also given. reqNameLen specifies the length of sReqName buffer.
The request name which you provide will be displayed in the Log view (USBTrace captured data list).
GetReqInfo
In this function, you will have to return the detailed request information.
The detailed request information must be filled in sInfoString parameter in the following format:
Example: "VENDOR_SEND_COMMAND;Command Code=0x21;Control=CT_NONE"
This will be displayed in the additional information view.
pInfoStringLen points to the length of sInfoString. If the given pInfoStringLen is insufficient, you must fail this function providing the required length in the same variable.
Handling Bulk, Interrupt, Isochronous packets
In addition to control packets, you can also decode bulk, interrupt and isochronous packets from your own custom vendor specific class decoder.
The bmRequestType parameter can take the following values for these transfer types: TRANSFER_TYPE_BULKORINTERRUPT, TRANSFER_TYPE_ISOCH
#define TRANSFER_TYPE_ISOCH 0xFE
The wValue parameter will contain the endpoint address if bmRequestType equals any one of the above 2 values. pData will contain the transfer buffer and nDataLen will contain the buffer length.
How to install ?
The name of the DLL should be vsdecoder.dll. This DLL should be copied to USBTrace installation directory. For more information, we recommend you to refer the sample DLL source code.