9 itrace::getpacketscount – Teledyne LeCroy SAS_SATA Tracer_Trainer Automation API Manual User Manual

Page 40

Advertising
background image

LeCroy Corporation

Automation API for SAS/SATATracer/Trainer

Manual Version 1.11

40

4.1.9 ITrace::GetPacketsCount


HRESULT GetPacketsCount (

[out, retval] long* number_of_packets );

Retrieves the total number of packets in the trace


Parameters

number_of_packets

Total number of packets in the trace

Return values

Remarks

Example


WSH:

Set Analyzer = WScript.CreateObject("LeCroy.SASAnalyzer")
CurrentDir = Left(WScript.ScriptFullName, InstrRev(WScript.ScriptFullName, "\"))
Set Trace = Analyzer.MakeRecording (CurrentDir & "Input\test_ro.rec")
MsgBox Trace.GetPacketsCount & " packets recorded"


C++:
ISASTrace*

sas_trace;


. . .

long number_of_packets;
long trigg_packet_num;
try
{

bstr_trace_name = sas_trace->GetName();
number_of_packets = sas_trace->GetPacketsCount();
trigg_packet_num = sas_trace->GetTriggerPacketNum();

}

catch (_com_error& er)

{

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

}

TCHAR str_trace_name[256];
_tcscpy( str_trace_name, (TCHAR*)( bstr_trace_name) );
SysFreeString( bstr_trace_name );

TCHAR trace_info[256];
_stprintf( trace_info, _T("Trace:'%s', total packets:%ld, trigger packet:%ld"),

str_trace_name, number_of_packets, trigg_packet_num );

::SetWindowText( m_hwndStatus, trace_info );


Advertising