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

SendFile Instruction

This instruction instructs the script parser to use some file as a data source and generate a stream of Data Packets (DPH + DPP) using the instruction parameters.

Note: Currently, this instruction works only for HOST emulation mode and uses the
SETUP/BULK OUT transaction layout.

SendFile(file_path, device_addr, endpoint, 
[delay,start_seq_num, payload_size, stream_id, route_string] )

Parameters

File

Path to the data source file.

DevAddr

Device address

Endp

Device endpoint

Delay

Delay between packets. Default value is 0.

StartSeqN

Starting Sequence Number. Defines the starting Sequence Number for the following transaction (must be from 0 to 31). Default value is 0.

DPPSize

Specifies the size of the Data Packet payload to use in the Tx packet stream. By default, the parser uses a 1024 byte size (and possibly less for the last packet).

StreamID

Specifies the Stream ID value to use in DPH. Default value is 0.

RouteStr

Specifies the Route String value to use in DPH. Default value is 0.

Example

Main
{
    # Create stream of Tx packets as for BULK-OUT transaction,
    # targeting device with address 0x12 and endpoint 3.
SendFile("C:\some_file.dat", 0x12, 3 )

    # Create stream of Tx packets with 200 ns delay between them,
    # targeting a device with address 0x10 and endpoint 0.
    # Transaction starts from Sequence Number 10.
SendFile("C:\some_file1.dat", 0x10, 0, 200, 10 )

    # Create stream of Tx packets as for BULK-OUT transaction,
    # targeting device with address 0x1 and endpoint 2.
    # Non-standard size 512 bytes is used for this transaction.
SendFile("C:\some_file.dat", 0x1, 2,DPPSize = 512 )
}