9 itrace::getpacket, Itrace::getpacket, Catc ver. 1.40 – Teledyne LeCroy Automation API for Bluetooth Analyzers User Manual

Page 49

Advertising
background image

43

Automation API for CATC Bluetooth Analyzers

CATC

Ver. 1.40

2.4.9 ITrace::GetPacket

Retrieves raw packet representation

Parameters

packet_number

-

number of packet to retrieve

packet

-

raw packet representation

number_of_bits

-

number of bits in raw packet representation

Return values

ANALYZERCOMERROR_INVALIDPACKETNUMBER

-

specified packet number is invalid

Remarks

Packet

” parameter has

VT_ARRAY | VT_VARIANT

actual automation type. Each element of

this array has

VT_UI1

automation type. Since the last element of the array may contain

extra data, you need to use

number_of_bits

parameter to determine actual packet data.

Example

VBScript:

<OBJECT

ID = Analyzer

CLASSID = "clsid:0B179BB3-DC61-11d4-9B71-000102566088" >

</OBJECT>

<INPUT TYPE=TEXT NAME="TextPacketNumber">

<P ALIGN=LEFT ID=StatusText></P>

<SCRIPT LANGUAGE="VBScript">

<!--

Function DecToBin(Param, NeedLen)

While Param > 0

Param = Param/2

If Param - Int(Param) > 0 Then

Res = CStr(1) + Res

Else

Res = CStr(0) + Res

End If

Param = Int(Param)

Wend

DecToBin = Replace( Space(NeedLen - Len(Res)), " ", "0") & Res

End Function

Sub BtnGetPacket_OnClick

On Error Resume Next

Dim Packet

NumberOfBits = CurrentTrace.GetPacket (TextPacketNumber.value,

Packet)

If Err.Number <> 0 Then

MsgBox "GetPacket:" & Err.Number & ":" & Err.Description

Else

For Each PacketByte In Packet

PacketStr = PacketStr & DecToBin(PacketByte, 8) & " "

NBytes = NBytes + 1

HRESULT GetPacket (

[in] long packet_number,

[in, out] VARIANT* packet,

[out, retval] long* number_of_bits );

Advertising