beautypg.com

Chapter 14: usb decoders, Decoder files, Script decoding mechanisms – Teledyne LeCroy USB Script Decode Manual User Manual

Page 61: 14 usb decoders, Usb d, Hapter, Ecoders

background image

55

C

HAPTER

14

CATC Scripting Language for USB

USB Decoders

C

HAPTER

14: USB D

ECODERS

Decoding scripts for the CATC USB Analyzers can now be written in the new
CATC Script Decoding Language. The document describing this decoding
language is included with the CATC software on the CD, and also online.

USBTracer, USBMobile, and USB Advisor ship with decoder scripts for many of
the classes and their attributes. These files are located in the USBTracer
\Scripts

directory (for example). Users may edit the decoder scripts or create

new scripts to accommodate specific development needs, especially decoding of
vendor- and application-specific classes and attributes.

This chapter discusses the purposes of the USBTracer decoder files, along with the
common constants, global variables, and functions that make up the USBTracer
Decoding API. The procedures for adding attribute decoders for existing manage-
ment classes and for creating new management class decoders are provided as well.

Decoder Files

USBTracer decoders are used to decode packets with vendor-specific data or other
custom information so that the custom content can be displayed as a CATC Trace
in USBTracer. The view settings in the scripts may be edited to either reveal or hide
particular fields when the header cells are expanded or collapsed. For instance, it
may be desirable to have a field visible even when its header cell is collapsed; on
the other hand, cells can also be defined so that they are revealed only when the
header cell is expanded.

In addition to displaying decoded custom content as data as a trace, the decoder
scripts create a special View window that presents the decoded data in a text format.
The window is opened by left-clicking on any cell in the trace to access the pop-up
View menu and then selecting the “View fields” option.

Script Decoding Mechanisms

The older script decoding mechanism is still supported, and the scripts are now
stored in a directory called Legacy in the Scripts directory. The older mechanism
is still used for many of the decoding types, such as the Standard descriptors. The
scripts for it are the same as those used on USB Chief, the previous generation USB
Analyzer. The newer decoding scripts are NOT compatible with USB Chief.

The new script language can be implemented using 2 different methods. These are

Distinguished in the scripts by the script variable UsbScriptDecodeType.