beautypg.com

2 ianalyzererrors::get_count, Ianalyzererrors::get_count, Catc ver. 1.40 – Teledyne LeCroy Automation API for Bluetooth Analyzers User Manual

Page 74

background image

68

Automation API for CATC Bluetooth Analyzers

CATC

Ver. 1.40

2.6.2 IAnalyzerErrors::get_Count

Parameters

number_of_errors -

points to long value where number of elements in the collection is

retrieved

Remarks

Example

WSH:

' makes recording, saves the portions of the recorded trace where "Bad

VCRCs" errors occured

CurrentDir = Left(WScript.ScriptFullName, InstrRev(WScript.ScriptFullName,

"\"))

Set Analyzer = WScript.CreateObject("CATC.Merlin")

Set Trace = Analyzer.MakeRecording (CurrentDir & "Input\test_ro.rec")

Set Errors = Trace.AnalyzerErrors (16) ' Payload Length Too Long

For Each ErrorPacketNumber In Errors

ErrorFile = CurrentDir & "\Output\ PldLenTooLong_error_span_" &

CStr(ErrorPacketNumber) & ".blt"

Trace.Save ErrorFile, CInt(ErrorPacketNumber)-5, CInt(ErrorPacketNum-

ber)+5

Next

C++:

IBTTrace* bt_trace;

. . .

IAnalyzerErrors* analyser_errors;

try

{

analyser_errors = bt_trace->AnalyzerErrors(error_type).Detach();

}

catch ( _com_error& er)

{

if (er.Description().length() > 0)

::MessageBox( NULL, er.Description(), _T("BTAnalyzer client"),

MB_OK );

else

::MessageBox( NULL, er.ErrorMessage(),_T("BTAnalyzer client"),

MB_OK );

return 1;

}

TCHAR all_errors[2048];

_stprintf( all_errors, _T("Errors: ") );

try

{

long errors_count = analyser_errors->GetCount();

long analyzer_error;

if ( !errors_count )

{

_tcscat( all_errors, _T("none") );

HRESULT get_Count(

[out, retval] long* number_of_errors );