Xbee Arduino
Arduino Driver for Xbee
Loading...
Searching...
No Matches
xbee_api_frame_t Struct Reference

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...
 

Detailed Description

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.

Member Data Documentation

◆ checksum

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.

◆ data

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:

frame.length = 10;
frame.data[0] = 0x01; // Example payload data
frame.checksum = calculateChecksum(frame.data, frame.length);
Structure to represent an XBee API frame.
Definition: xbee_api_frames.h:298
xbee_api_frame_type_t type
Type of the API frame.
Definition: xbee_api_frames.h:299
uint8_t data[XBEE_MAX_FRAME_DATA_SIZE]
Frame data.
Definition: xbee_api_frames.h:302
uint8_t checksum
Checksum of the API frame.
Definition: xbee_api_frames.h:301
uint16_t length
Length of the frame data.
Definition: xbee_api_frames.h:300
@ XBEE_API_TYPE_TX_REQUEST
Frame for transmitting data.
Definition: xbee_api_frames.h:203

◆ length

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.

◆ type

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.


The documentation for this struct was generated from the following file: