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.
GetReqName
BOOL GetReqName([IN] UCHAR bmRequestType, [IN] UCHAR bRequest, [IN] USHORT wValue,
[IN] USHORT wIndex, [IN] PVOID pData, [IN] ULONG nDataLen,
[OUT] PCHAR sReqName, [IN] USHORT reqNameLen);
|
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.
BOOL GetReqInfo([IN] UCHAR bmRequestType, [IN] UCHAR bRequest,
[IN] USHORT wValue, [IN] USHORT wIndex, [IN] BOOL in,
[IN] PVOID pData, [IN] ULONG nDataLen,
[OUT] PCHAR sInfoString, [IN][OUT] PUSHORT pInfoStringLen);
|
The detailed request information must be filled in sInfoString paramter in the following format:
"<header>;<param1>=<value1>;<param2>=<value2>" 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.
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.
