9 itrace::getpacket, Itrace::getpacket – Teledyne LeCroy FireInspector Automation Application Programming Interface User Manual
Page 45

41
FireInspector Automation User’s Manual
CATC
Version 1.0
2.4.9
ITrace::GetPacket
Retrieves raw packet representation.
Syntax
HRESULT GetPacket (
[in] long packet_number,
[in, out] VARIANT* packet,
[out, retval] long* number_of_bits );
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 ele-
ment 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:0B179BC1-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