This section describes the structure of the UDP packets exchanged between the QSPY Back-End and the various front-ends, such as QUTest and QView (blue arrows in the sequence diagram below).
The UDP packets exchanged between the QSPY Back-End and the QView
Front-End consists of:
QView
to detect any data discontinuities.The QSPY UDP socket supports two "channels":
A Front-End can choose the "data channels" when "attaching" to the QSPY host application (see qspy::attach()). The data channels are not exclusive, meaning that a front-end can "attach" simultaneously to both binary and text channels. In this case, the front-end would receive each packet as both binary and text formats.
This packet has Record-ID==INFO and has no Data Payload.
Code Example:
This packet has Record-ID==COMMAND and Data Payload of the form:
Data item | binary format | description |
---|---|---|
Command-ID | B (byte) | command number |
Command-Par | I (unsigned 4-byte integer) | command parameter |
This packet has Record-ID==RESET and has no Data Payload.
Data item | binary format | description |
---|---|---|
Tick-rate | B (byte) | system tick rate number |
This packet has Record-ID==PEEK and Data Payload of the form:
Data item | binary format | description |
---|---|---|
Peek-addr | Target-dependent Typically I | Address of the data in the Target |
Peek-length | B (byte) | Number of bytes to peek |
This packet has Record-ID==POKE and Data Payload of the form:
Data item | binary format | description |
---|---|---|
Poke-addr | Target-dependent Typically I | Address of the data in the Target |
Poke-length | B (byte) | Number of bytes to poke (<= 8) |
Poke-data | user-defined | Binary data to poke to the Target (8 bytes maximum) |
This packet has Record-ID==GLB_FILTER and Data Payload of the form:
Data item | binary format | description |
---|---|---|
Data Len | B (byte) | Number of bytes sent (currently 16) |
Filters | 16B | 8-bytes (128-bits), each bit corresponding to Global Filter |
This packet has Record-ID==LOC_FILTER and Data Payload of the form:
Data item | binary format | description |
---|---|---|
Local filter # | B (byte) | The Number of the Local Filter |
Object-addr | Target-dependent Typically I | Address of the object in the Target |
The Local filters are numbered as follows:
0. State Machine Local Filter (SM)
This packet provides a shortcut for setting the Active Object Local Filter by providing just the unique priority of the AO. The packet has Record-ID==AO_FILTER and Data Payload of the form:
Data item | binary format | description |
---|---|---|
AO prio | B (byte) | Priority of the AO to filter (0 to disable the AO filter) |
This packet has Record-ID==EVENT and Data Payload of the form:
Data item | binary format | description |
---|---|---|
AO prio | B (byte) | Priority of the recipient AO (0 to publish the event) |
signal | Target-dependent Typically H | signal of the event |
parameters | user-defined | Binary data corresponding to all event parameters |
The Event signal sig
must be formatted according to the Target configuration (see Q_SIGNAL_SIZE)
The Event parameters must be formatted with the particular endianness of the Target and with any padding required for proper alignment of objects in the Target memory.
The parameters need to match exactly the event memory layout in your Target, including the endianness and any padding that the Target compiler might be using. (To test the right binary format and padding, you can use the Generate Event... command).
For example, let's assume that the parameters of your event are: a byte, followed by a 2-byte integer, followed by a 4-byte integer. Also, let's assume that your Target is little endian. From the Generate Event... command you discover that to format this event correctly you need to use the following event parameters:
Par # | format | data (example) |
---|---|---|
par1: | B | 0x11 |
par2: | B | 0x00 |
par3: | H | 0x1122 |
par4: | I | 0x11223344 |
This packet has Record-ID==ATTACH and Data Payload of the form:
Data item | binary format | description |
---|---|---|
channels | B (byte) | Binary bitmask of QSPY channels to attach to |
This packet has Record-ID==DETACH and has no Data Payload.
This packet has Record-ID==SAVE_DIC and has no Data Payload.
This packet has Record-ID==SCREEN_OUT and has no Data Payload.
This packet has Record-ID==BIN_OUT and has no Data Payload.
This packet has Record-ID==MATLAB_OUT and has no Data Payload.
This packet has Record-ID==SEQUENCE_OUT and has no Data Payload.
This packet has Record-ID==ATTACH and has no Data Payload.
This packet has Record-ID==DETACH and has no Data Payload.
Next: QSPY Sequence Output