API frames
An API frame is the structured data sent and received through the serial interface of the radio module when it is configured in API or API escaped operating modes. API frames are used to communicate with the module or with other modules in the network. An API frame has the following structure:
Field | Description |
---|---|
Start delimeter | The first byte of a frame consisting of a special sequence of bits which indicate the beginning of a data frame. Its value is always 0x7E. This allows for easy detection of a new incoming frame. |
Length |
Specifies the total number of bytes included in the frame data field. Its two-byte value excludes the start delimiter, the length, and the checksum. |
Frame data |
Composed by the API identifier and the API identifier-specific data. The content of the specific data depends on the API identifier (also called API frame type). |
Checksum | The last byte of the frame. It helps test data integrity and is calculated by taking the hash sum of all the API frame bytes that came before it, excluding the first three bytes (start delimiter and length). |
If your module is operating in API escaped operating mode, some bytes in the Length, Frame data, and Checksum frame fields may need to be escaped. XCTU automatically performs this step and escapes the appropriate characters. See API escaped operating mode.
Note There are many different types of API frames. You can use the Frames generator tool to learn the specific data contained within a determined API frame as well as to build and fill any type of API frame. See Frames generator tool.