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).You need to perform the following 2 steps to achieve this functionality:
- Download the vendor specific class decoder DLL (Download)
- Write your custom device class decoder DLL (Download Sample Code)
Step1: Download vendor specific class decoder
You can download the vendor specific class decoder from here. Extract VendorDecoder.dll to USBTrace installation directory (Ex: \Program Files\USBTrace\)
Step2: 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.
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).
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.
Step 3: Installation
The name of the DLL should be vsdecoder.dll. This DLL should be copied along with vendordecoder.dll to USBTrace installation directory. For more information, we recommend you to refer the sample DLL source code.