Xbee Arduino
Arduino Driver for Xbee
|
Structure to represent an XBee API frame. More...
#include <xbee_api_frames.h>
Public Attributes | |
xbee_api_frame_type_t | type |
Type of the API frame. More... | |
uint16_t | length |
Length of the frame data. More... | |
uint8_t | checksum |
Checksum of the API frame. More... | |
uint8_t | data [XBEE_MAX_FRAME_DATA_SIZE] |
Frame data. More... | |
Structure to represent an XBee API frame.
This structure is used to represent an XBee API frame, which is a structured data packet exchanged between the host (e.g., microcontroller) and the XBee module. An API frame contains a specific type, a length field, a checksum for data integrity, and the actual frame data.
XBee API frames are used for various communication tasks, including sending commands, transmitting data, receiving status information, and controlling IO pins. Each field in this structure serves a specific purpose in constructing and interpreting these frames.
xbee_api_frame_t::checksum |
Checksum of the API frame.
The checksum of the API frame, used to verify the integrity of the frame data. The checksum is calculated over the frame's data and is essential for detecting transmission errors.
xbee_api_frame_t::data |
Frame data.
The actual data contained within the API frame. This array holds the payload or command data associated with the frame type. The size of this array is defined by XBEE_MAX_FRAME_DATA_SIZE
, which should be set according to the maximum expected frame size in the application.
Example Usage:
xbee_api_frame_t::length |
Length of the frame data.
The length of the frame data, excluding the start delimiter, length bytes, and checksum. This field specifies the size of the data portion of the frame, helping in parsing and processing the frame.
xbee_api_frame_t::type |
Type of the API frame.
The type of the API frame, represented by the xbee_api_frame_type_t
enumeration. This field indicates the purpose of the frame, such as whether it is an AT command, a data transmission, or a status report.