User Data Relay - 0x2D
Description
Allows for data to be sent to an interface with a designation of a target interface for the data to be output on. The frame can be sent or received from either of these interfaces: MicroPython (internal interface) or UART. This frame is used in conjunction with User Data Relay Output - 0xAD.
You can send and receive User Data Relay Frames from MicroPython. See Send and receive User Data Relay frames in the MicroPython Programming Guide.
Format
The following table provides the contents of the frame. For details on frame structure, see API frame format.
Field name | Field value | Data type | Description |
---|---|---|---|
Frame type |
0x2D |
Byte |
|
Frame ID |
|
|
Reference identifier used to match TX Status frames (type 0x89) sent for errors. A value of 0 disables the TX Status frame. |
Destination interface |
|
Byte |
0 = Serial port (SPI, or UART when in API mode) 2 = MicroPython |
Data | Variable |
Error cases
The Frame ID is used to report error conditions in a method consistent with existing transmit frames. The error codes are mapped to statuses. The following conditions result in an error that is reported in a TX Status frame, referencing the frame ID from the 0x2d request.
- Invalid interface (0x7c) : The user specified a destination interface that does not exist.
- Interface not accepting frames (0x7d): The destination interface is a valid interface, but is not in a state that can accept data. For example, the Destination Serial port does not have API 1 or API 2 enabled, or the MicroPython Relay frame queue is full.
Example use cases
An external processor outputs the Frame over the UART with the Micropython interface as a target. Micropython operates over the data and publishes the data to mqtt topic.