v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha
v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha

Wait Packet Instruction

This instruction tells the Voyager USB 3.2 Exerciser to turn on processing of Rx packets and wait for a specified number of incoming TP or DP packets before proceeding. It does NOT work for ITP or LMP packets. Specific attributes of the packet or number of packets to wait for can be specified by a preceding PrepareWaitPacket instruction (see next section).

Note: If the PrepareWaitPacket instruction was not issued before this instruction, then all packets received before this instruction are lost and not processed.

WaitPacket [( packet_count, start_at_last_send_pkt )]

Parameters

Packet_Count

Number of packets for which to wait before proceeding. Ifomitted, the instruction uses value 1 by default.

Start_At_Last_Send_Pkt

If not set to 0, it instructs the Exerciser to prepare to wait for incoming packets at the time it executes the Send Packet instruction and transmits a packet. This is equivalent to placing PrepareWaitPkt just before the previous Send Packet instruction. This guarantees that the Exerciser does not miss an incoming packet from its USB 3.2 Link partner while it switches from the Send Packet to the Wait Packet instruction.
If omitted, the instruction uses value 1 by default.
If set to 0, the Exerciser prepares to wait for incoming packets at the time it executes the WaitPacket instruction. This is equivalent to placing PrepareWaitPkt just before the WaitPacket instruction.

Example

Set Mode = DEVICE # Set ‘Device’ mode.
Main
{
# Response To GetDescriptor(Device)
    # Wait for HOST SETUP.
WaitPacket

Send TP_ACK
    {
      DevAddr = 0
      Endp    = 0
      dir     = HOST_TO_DEVICE
      SeqNum  = 1
      NumP    = 1
    }
# Wait for HOST ACK.
WaitPacket

      $DeviceDescriptorPayLoad = DeviceDescriptor
      {
            Length             = 0x12
            DescriptorType     = DEVICE_DESC
            bcdUSB             = 0x0200
            DeviceClass        = 0x00
            DeviceSubClass     = 0x00
            DeviceProtocol     = 0x40
            MaxPacketSize0     = 0x38
            dVendor            = 0x4235
            dProduct           = 0x0000
            bcdDevice          = 0x0001
            Manufacturer       = 0x00
            Product            = 0x02
            SerialNumber       = 0x03
            NumConfigurations  = 1
      }
Send DP
      {
        dir  = HOST_TO_DEVICE
        Data = $DeviceDescriptorPayLoad       
      }
#Wait for HOST ACK.
    #Wait for HOST STATUS.
WaitPacket( 2 )
Send TP_ACK
      {
        DevAddr = 0
        Endp    = 0
        dir     = HOST_TO_DEVICE
        SeqNum  = 1
        NumP    = 0
      }
}