3 adddescriptor instruction, Adddescriptor instruction – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 72

Advertising
background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

63

Format

InitDevice

( clear descriptors, device index )

InitDevice has the following instruction parameters:

clear descriptors: Specifies if all previously added descriptors for this device have to be
removed (1) or kept (zero). Default value is 1.

device index: Specifies the zero-based index of the device to initialize. Default value is 0.
Note: Current version supports only one emulated device.

Examples of calling the InitDevice instruction

# Device emulation

Main

{

# Start the handler task at the beginning of the script.

StartDeviceFrameworkHandler

()

# Initialize device to default state and clear all descriptors.

InitDevice

()

# Add all required descriptors.



# At some point, device emulator is connected to the host and

# enumerated

.



# Re-initialize device, but keep the descriptors.

InitDevice

( 0 )



# Emulate disconnection and reconnection.

SetLinkState

( RX_DETECT )

}

9.2.3 AddDescriptor Instruction

This instruction adds a descriptor structure to the descriptor list for a device. The descriptor alias
is used by the device Framework Handler task when automatically responding to
GET_DESCRIPTOR USB requests.

Format

AddDescriptor

( type, index, request type, recipient, language id,

bRequest, device index )

{
DescriptorData

Advertising