beautypg.com

2 iusbtrace2::gotounit, Iusbtrace2::gotounit – Teledyne LeCroy USB Analyzer Automation Manual User Manual

Page 62

background image

Teledyne LeCroy Automation API Reference Manual for USBTracer, USB Advisor, and Voyager USB Protocol
Suite

62

3.2.2 IUsbTrace2::GotoUnit


HRESULT GotoUnit ([in] long level, [in] long index );


Instructs the trace view to jump to the specified transaction unit.

Parameters


level

Transaction level

Possible values are:

0 = USB Packets

1 = USB Transactions

2 = USB Split Transactions

3 = USB Transfers

4 = Host WireAdapter Segments

5 = Host WireAdapter Transfers

6 = Device WireAdapter Segments

7 = Device WireAdapter Transfers

8 = PTP Transactions

9 = PTP Objects

10 = PTP Sessions

index

Index of unit inside transaction level

Return values

ANALYZERCOMERROR_INVALIDPACKETNUMBER

Unable to jump to specified transaction
unit: Either transaction level or
transaction index is invalid.

Example


WSH:

Set Analyzer = WScript.CreateObject("CATC.UsbTracer")
CurrentDir = Left(WScript.ScriptFullName, InstrRev(WScript.ScriptFullName, "\"))
Analyzer.StartRecording (CurrentDir & "test_ro.rec")
'... do something.
Set Trace = Analyzer.StopRecordingAndWaitForTrace

Trace.GotoUnit( 3, 2 ) ' jumps to USB transfer #2



C++:

IUsbTrace3* Usb_trace;

. . .
try
{

int level = 3; // USB Transfers

int index = 2;
Usb_trace ->GotoUnit( 3, 2 );

}
catch (_com_error& er)
{

if (er.Description().length() > 0)
::MessageBox( NULL, er.Description(), _T("UsbAnalyzer client"), MB_OK );
else
::MessageBox( NULL, er.ErrorMessage(), _T("UsbAnalyzer client"), MB_OK );
return 1;

}