IUsbPacket Interface
The IUsbPacket interface is the primary dual interface for the UsbPacket object.
IID: C7D7C98D-6AB2-4a25-8235-CE2E1E7A5428
IUsbPacket::GetTimestamp
HRESULT GetTimestamp ( [out, retval] double* timestamp )
Gets the timestamp of packet in nanosecond.
|
Parameters |
|
|---|---|
|
timestamp |
Points to double value where timestamp is retrieved. |
IUsbPacket::GetDuration
HRESULT GetDuration( [out, retval] double* duration )
Gets the duration of packet in nanoseconds.
|
Parameters |
|
|---|---|
|
duration |
Points to double value where duration is retrieved. |
IUsbPacket::GetSpeed
HRESULT GetSpeed( [out, retval] int* speed )
Gets the speed of packet.
|
Parameters |
|
|---|---|
|
speed |
Points to integer value where speed is retrieved. |
Remarks
Speed can have the following values:
-
0 : High Speed
-
1 : Full Speed
-
2 : Low Speed
-
3 : Unknown
-
4 : Super Speed
IUsbPacket::GetChannel
HRESULT GetChannel( [out, retval] int* channel )
Gets the channel number of the packet.
|
Parameters |
|
|---|---|
|
Channel |
Points to integer value where channel is retrieved. |
Remarks
Channel can have the following values:
-
0 : Usb2 Channel 0
-
1 : Usb2 Channel 1
-
2 : Usb2 Channel 2
-
3 : Usb2 Channel 3
-
4 : Usb3 Rx Channel 0
-
5 : Usb3 Tx Channel 0
-
6 : Usb3 Rx Channel 1
-
7 : Usb3 Tx Channel 1
IUsbPacket::GetType
HRESULT GetType(
[out] VARIANT* is_usb3,
[out] VARIANT* is_bus_condition,
[out, retval] int* type )
Gets the type of packet.
|
Parameters |
|
|---|---|
|
is_usb3 |
Pointer to a Boolean variable indicating whether the packet is usb3 or not. |
|
is_bus_condition |
Pointer to a Boolean variable indicating whether the packet is an event or not. |
|
type |
Pointer to integer variable where the type of the packet is retrieved. |
Remarks
Type of packet has the following values:
USB3 Packets and Events:
-
0 : Unknown
-
1 : TSEQ
-
2 : TSX
-
3 : LFPS
-
4 : Electrical Idle
-
5 : IPS
-
6 : LC
-
7 : SKP
-
8 : HP
-
9 : DPP
-
10 : Logical Idle
-
11 : TS1
-
12 : TS2
-
13 : DP
-
14 : BRST
-
15 : BERC
-
16 : BCNT
-
17 : TERM
-
18 : Deferred Packet
-
19 : CP
USB2 Packets:
-
-1 : Unknown
-
0 : MDATA
-
1 : DATA2
-
2 : DATA1
-
3 : DATA0
-
4 : SETUP
-
5 : SOF
-
6 : IN
-
7 : OUT
-
8 : STALL
-
9 : NYET
-
10 : NAK
-
11 : ACK
-
12 : PRE & ERR
-
13 : PING
-
14 : SPLIT
-
15 : EXT
-
19 : LPM
USB2 Events
-
-1 : Unknown
-
0 : Chirp K
-
1 : Chirp J
-
2 : Full Speed K On High Speed
-
3 : Full Speed J On High Speed
-
4 : Suspend
-
5 : Resume
-
6 : SE1
-
7 : SE0
-
27 : Connect
-
28 : VBUS Voltage Change
-
30 : Keep Alive
-
31 : Reset
IUsbPacket::GetFieldValue
HRESULT GetFieldValue(
[in] BSTR field_name,
[out] VARIANT* field_value )
[out, retval] VARIANT* field_value_bit_size )
Retrieves the value of specified field.
|
Parameters |
|
|---|---|
|
field_name |
String providing the field name that its value is retrieved. |
|
field_value |
Pointer to DWORD or bytes array where field value is retrieved. If the size of returned value is less than or equal to 4 bytes, the type is DWORD otherwise it is byte stream. |
|
field_value_bit_size |
Pointer to Integer variable where size of field value in bit is retrieved. |
Remarks
To retrieve available fields names in this packet call GetAllFieldsValues() function.
IUsbPacket::GetAllFieldsValues
HRESULT GetAllFieldsValues(
[out] VARIANT* fields_names,
[out] VARIANT* fields_values,
[out] VARIANT* fields_values_bit_size,
[out, retval] int* fields_count )
Retrieves the values of all available fields. It returns three arrays that contain the name, value, and size of fields.
|
Parameters |
|
|---|---|
|
fields_names |
Array of strings containing fields names. |
|
fields_values |
Array of DWORDs or bytes arrays containing fields values. If size of field value is less than or equal to 4 bytes it is DWORD otherwise bytes array. |
|
fields_values_bit_size |
Array of integers containing size of fields in bit. |
|
fields_count |
Pointer to integer variable containing count of fields. |
Remarks
The bit order and byte order are always little Endian for all fields.
IUsbPacket::GetMarker
HRESULT GetMarker( [out, retval] BSTR* marker )
Retrieves the marker text of current packet.
|
Parameters |
|
|---|---|
|
marker |
Pointer to string variable where marker text is retrieved. |
IUsbPacket::GetErrorsBitmap
HRESULT GetErrorsBitmap( [out, retval] VARIANT* errors_bitmap )
Retrieves the errors of a packet.
|
Parameters |
|
|---|---|
|
errors_bitmap |
Pointer to unsigned 64 bits integer variable where errors are retrieved. |
Remarks
The format of the returned errors bitmap is shown below:
-
Bit 0 : Reserved
-
Bit 1 : USB2 PID Error
-
Bit 2 : USB2 CRC5 Error
-
Bit 3 : USB2 CRC16 Error
-
Bit 4 : USB2 Packet Length Error
-
Bit 5 : USB2 Bit Stuff Error
-
Bit 6 : USB2 EOP Error
-
Bit 7 : USB2 Babble Start Error
-
Bit 8 : USB2 Babble End Error
-
Bit 9 : USB2 Frame Length Error
-
Bit 10 : USB2 Turnaround/Timeout Error
-
Bit 11 : USB2 Analyzer Internal Error
-
Bit 12 : USB2 Data Toggle Error
-
Bit 13 : USB2 Frame/uFrame Number Error
-
Bit 14 : USB2 Last Byte Incomplete Error
-
Bit 15 : USB2 OTG Signal Error
-
Bit 16 : USB3 CRC5 Error
-
Bit 17 : USB3 CRC16 Error
-
Bit 18 : USB3 CRC32 Error
-
Bit 19 : USB3 Disparity Error
-
Bit 20 : USB3 10 Bit Symbol Error
-
Bit 21 : USB3 Unknown Packet(IPS) Error
-
Bit 22 : USB3 Framing Symbol Error
-
Bit 23 : USB3 LC Data Symbol Error
-
Bit 24 : USB3 Bad Header Packet Length Error
-
Bit 25 : USB3 Bad Data Length Field Error
-
Bit 26 : USB3 SKP Symbol Error
-
Bit 27 : USB3 Control Endpoint Direction Error
-
Bit 28 : USB3 Missed DPH Error
-
Bit 29 : USB3 Missed DPP Error
-
Bit 30 : USB3 Setup DP Error
-
Bit 31 : USB3 Sequence Number Error
-
Bit 32 – 44 : Reserved
-
Bit 45 : USB3 TP Non-Zero Reserved Error
-
Bit 46 : USB3 Missed ITP Error
-
Bit 47 : USB3 Late/Early ITP Error
-
Bit 48 – 63 : Reserved
The following error bits are valid after transaction level decoding:
-
Bit 4 : USB2 Packet Length Error
-
Bit 10 : USB2 Turnaround/Timeout Error
-
Bit 12 : USB2 Data Toggle Error
-
Bit 27 : USB3 Control Endpoint Direction Error
-
Bit 46 : USB3 Missed ITP Error
-
Bit 47 : USB3 Late/Early ITP Error
IUsbPacket::GetRawData
HRESULT GetRawData(
[out] VARIANT* raw_data_array,
[out, retval] int* array_size )
Retrieves the marker text of current packet.
|
Parameters |
|
|---|---|
|
raw_data_array |
Array of bytes where raw data of packet is retrieved. |
|
array_size |
Pointer to integer variable containing returned bytes count. |
Remarks
The returned array is empty for bus conditions.
IUsbPacket::GetUsb3ScrambledData
HRESULT GetUsb3ScrambledData(
[out] VARIANT* scrambled_data_array,
[out, retval] int* array_size )
Retrieves the scrambled raw packet representation of USB3 packets.
|
Parameters |
|
|---|---|
|
scrambled_data_array |
Bytes array variable where scrambled bytes of packet are retrieved. |
|
array_size |
Pointer to integer variable containing count of returned bytes. |
IUsbPacket::GetUsb3TenBitData
HRESULT GetUsb3TenBitData(
[out] VARIANT* symbles_array,
[out, retval] int* array_size )
Retrieves the ten bit symbols of USB3 packets.
|
Parameters |
|
|---|---|
|
symbols_array |
Array of DWORDs containing returned symbols. |
|
array_size |
Pointer to integer variable containing count of returned symbols. |
Remarks
The format of returned symbols is shown below:
|
15 |
|
|
|
|
10 |
0 |
|
|
|
|
|
|
|
Ten Bit Symbol |
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
18 |
17 |
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Running Disparity |
Invalid Symbol |
RD Error |