Xbee Arduino
Arduino Driver for Xbee
|
A class to interface with XBee modules on Arduino platforms. More...
#include <XBeeArduino.h>
Public Member Functions | |
XBeeArduino (Stream *serialPort, uint32_t baudrate, XBeeModuleType moduleType, void(*onReceiveCallback)(void *), void(*onSendCallback)(void *)) | |
Constructor for XBeeArduino class. More... | |
~XBeeArduino () | |
Destructor for XBeeArduino class. More... | |
bool | begin () |
Initializes the XBee module. More... | |
bool | connect () |
Connects the XBee module to the network. More... | |
void | process () |
Lets the XBee class process. More... | |
bool | disconnect () |
Disconnects the XBee module from the network. More... | |
template<typename T > | |
bool | sendData (const T &data) |
Sends data through the XBee module. More... | |
bool | isConnected () |
Checks if the XBee module is connected to the network. More... | |
void | reset () |
Resets the XBee module. More... | |
bool | setApiOptions (const uint8_t options) |
Sets the API options for XBee. More... | |
bool | getLoRaWANDevEUI (uint8_t *devEUI, uint8_t length) |
Retrieves the DevEUI of the LoRaWAN XBee module. More... | |
bool | setLoRaWANAppEUI (const char *value) |
Sets the App EUI of the LoRaWAN XBee module. More... | |
bool | setLoRaWANAppKey (const char *value) |
Sets the App Key of the LoRaWAN XBee module. More... | |
bool | setLoRaWANNwkKey (const char *value) |
Sets the App Key of the LoRaWAN XBee module. More... | |
bool | applyChanges (void) |
Applys config changes on XBee. More... | |
bool | writeConfig (void) |
Write config on XBee. More... | |
bool | setLoRaWANClass (const char value) |
Sets the LoRaWAN Class on the XBee LR module. More... | |
bool | setLoRaWANActivationMode (const uint8_t value) |
Sets the LoRaWAN Activation Mode on the XBee LR module. More... | |
bool | setLoRaWANADR (const uint8_t value) |
Sets the LoRaWAN Adaptive Data Rate (ADR) on the XBee LR module. More... | |
bool | setLoRaWANDataRate (const uint8_t value) |
Sets the LoRaWAN Data Rate on the XBee LR module. More... | |
bool | setLoRaWANRegion (const uint8_t value) |
Sets the LoRaWAN Region on the XBee LR module. More... | |
bool | setLoRaWANDutyCycle (const uint8_t value) |
Sets the LoRaWAN Duty Cycle on the XBee LR module. More... | |
bool | getLoRaWANSpecVersion (char *responseBuffer, uint8_t buffer_size) |
Gets the LoRaWAN Specification Version from the XBee LR module. More... | |
bool | setLoRaWANJoinRX1Delay (const uint32_t value) |
Sets the LoRaWAN Join RX1 Delay on the XBee LR module. More... | |
bool | setLoRaWANJoinRX2Delay (const uint32_t value) |
Sets the LoRaWAN Join RX2 Delay on the XBee LR module. More... | |
bool | setLoRaWANRX1Delay (const uint32_t value) |
Sets the LoRaWAN RX1 Delay on the XBee LR module. More... | |
bool | setLoRaWANRX2Delay (const uint32_t value) |
Sets the LoRaWAN RX2 Delay on the XBee LR module. More... | |
bool | setLoRaWANRX2DataRate (const uint8_t value) |
Sets the LoRaWAN RX2 Data Rate on the XBee LR module. More... | |
bool | setLoRaWANRX2Frequency (const uint32_t value) |
Sets the LoRaWAN RX2 Frequency on the XBee LR module. More... | |
bool | setLoRaWANTransmitPower (const uint8_t value) |
Sets the LoRaWAN Transmit Power on the XBee LR module. More... | |
A class to interface with XBee modules on Arduino platforms.
This class provides methods for interacting with XBee modules. It includes functionality for initializing the module, sending/receiving data, and configuring the module.
XBeeArduino::XBeeArduino | ( | Stream * | serialPort, |
uint32_t | baudrate, | ||
XBeeModuleType | moduleType, | ||
void(*)(void *) | onReceiveCallback, | ||
void(*)(void *) | onSendCallback | ||
) |
Constructor for XBeeArduino class.
serialPort | A pointer to a Stream object (HardwareSerial or SoftwareSerial). |
baudrate | The baud rate for UART communication. |
moduleType | The type of XBee module (standard or LoRa). |
onReceiveCallback | A callback function to handle received data. |
onSendCallback | A callback function to handle post-send events. |
Initializes the XBee module based on the type and sets up callbacks and UART communication.
serialPort | A pointer to a Stream object (HardwareSerial or SoftwareSerial). |
baudrate | The baud rate for UART communication. |
moduleType | The type of XBee module (standard or LoRa). |
onReceiveCallback | A callback function to handle received data. |
onSendCallback | A callback function to handle post-send events. |
XBeeArduino::~XBeeArduino | ( | ) |
Destructor for XBeeArduino class.
Ensures proper disconnection and cleanup of the XBee module.
bool XBeeArduino::applyChanges | ( | void | ) |
Applys config changes on XBee.
bool XBeeArduino::begin | ( | ) |
Initializes the XBee module.
bool XBeeArduino::connect | ( | ) |
Connects the XBee module to the network.
bool XBeeArduino::disconnect | ( | ) |
Disconnects the XBee module from the network.
bool XBeeArduino::getLoRaWANDevEUI | ( | uint8_t * | devEUI, |
uint8_t | length | ||
) |
Retrieves the DevEUI of the LoRaWAN XBee module.
devEUI | A pointer to a buffer where the DevEUI will be stored. |
bool XBeeArduino::getLoRaWANSpecVersion | ( | char * | responseBuffer, |
uint8_t | buffer_size | ||
) |
Gets the LoRaWAN Specification Version from the XBee LR module.
Wrapper function to get the LoRaWAN Specification Version from the XBee LR module.
This function sends the AT_LV command to retrieve the LoRaWAN Specification Version currently in use by the XBee LR module.
[out] | responseBuffer | Buffer to store the retrieved version string. |
[in] | buffer_size | The size of the response buffer. |
This function sends the AT_LV command to retrieve the LoRaWAN Specification Version currently in use by the XBee LR module.
[out] | responseBuffer | Buffer to store the retrieved version string. |
[in] | buffer_size | The size of the response buffer. |
bool XBeeArduino::isConnected | ( | ) |
Checks if the XBee module is connected to the network.
void XBeeArduino::process | ( | ) |
Lets the XBee class process.
void XBeeArduino::reset | ( | ) |
Resets the XBee module.
template bool XBeeArduino::sendData< XBeeLRPacket_s > | ( | const T & | data | ) |
Sends data through the XBee module.
data | The data to be sent. |
bool XBeeArduino::setApiOptions | ( | const uint8_t | options | ) |
Sets the API options for XBee.
options | The API options to set. |
bool XBeeArduino::setLoRaWANActivationMode | ( | const uint8_t | value | ) |
Sets the LoRaWAN Activation Mode on the XBee LR module.
Wrapper function to set the LoRaWAN Activation Mode on the XBee LR module.
This function sends the AT_AM command to set the Activation Mode (e.g., OTAA or ABP) on the XBee LR module.
[in] | value | The Activation Mode to be set. |
This function sends the AT_AM command to set the Activation Mode (e.g., OTAA or ABP) on the XBee LR module.
[in] | value | The Activation Mode to be set. |
bool XBeeArduino::setLoRaWANADR | ( | const uint8_t | value | ) |
Sets the LoRaWAN Adaptive Data Rate (ADR) on the XBee LR module.
Wrapper function to set the LoRaWAN Adaptive Data Rate (ADR) on the XBee LR module.
This function sends the AT_AD command to enable or disable the Adaptive Data Rate (ADR) feature on the XBee LR module.
[in] | value | The ADR setting to be set (e.g., 0 for disable, 1 for enable). |
This function sends the AT_AD command to enable or disable the Adaptive Data Rate (ADR) feature on the XBee LR module.
[in] | value | The ADR setting to be set (e.g., 0 for disable, 1 for enable). |
bool XBeeArduino::setLoRaWANAppEUI | ( | const char * | value | ) |
Sets the App EUI of the LoRaWAN XBee module.
value | A pointer to a buffer where the App EUI will be stored. |
bool XBeeArduino::setLoRaWANAppKey | ( | const char * | value | ) |
Sets the App Key of the LoRaWAN XBee module.
value | A pointer to a buffer where the App Key will be stored. |
bool XBeeArduino::setLoRaWANClass | ( | const char | value | ) |
Sets the LoRaWAN Class on the XBee LR module.
Wrapper function to set the LoRaWAN Class on the XBee LR module.
This function sends the AT_LC command to set the LoRaWAN Class (e.g., 'A', 'B', 'C') on the XBee LR module.
[in] | value | The LoRaWAN Class to be set ('A', 'B', or 'C'). |
This function sends the AT_LC command to set the LoRaWAN Class (e.g., 'A', 'B', 'C') on the XBee LR module.
[in] | value | The LoRaWAN Class to be set ('A', 'B', or 'C'). |
bool XBeeArduino::setLoRaWANDataRate | ( | const uint8_t | value | ) |
Sets the LoRaWAN Data Rate on the XBee LR module.
Wrapper function to set the LoRaWAN Data Rate on the XBee LR module.
This function sends the AT_DR command to set the Data Rate on the XBee LR module.
[in] | value | The Data Rate to be set. |
This function sends the AT_DR command to set the Data Rate on the XBee LR module.
[in] | value | The Data Rate to be set. |
bool XBeeArduino::setLoRaWANDutyCycle | ( | const uint8_t | value | ) |
Sets the LoRaWAN Duty Cycle on the XBee LR module.
Wrapper function to set the LoRaWAN Duty Cycle on the XBee LR module.
This function sends the AT_DC command to configure the duty cycle settings on the XBee LR module.
[in] | value | The Duty Cycle to be set. |
This function sends the AT_DC command to configure the duty cycle settings on the XBee LR module.
[in] | value | The Duty Cycle to be set. |
bool XBeeArduino::setLoRaWANJoinRX1Delay | ( | const uint32_t | value | ) |
Sets the LoRaWAN Join RX1 Delay on the XBee LR module.
Wrapper function to set the LoRaWAN Join RX1 Delay on the XBee LR module.
This function sends the AT_J1 command to set the RX1 delay (in milliseconds) for the Join Accept message on the XBee LR module.
[in] | value | The RX1 Delay value to be set (in milliseconds). |
This function sends the AT_J1 command to set the RX1 delay (in milliseconds) for the Join Accept message on the XBee LR module.
[in] | value | The RX1 Delay value to be set (in milliseconds). |
bool XBeeArduino::setLoRaWANJoinRX2Delay | ( | const uint32_t | value | ) |
Sets the LoRaWAN Join RX2 Delay on the XBee LR module.
Wrapper function to set the LoRaWAN Join RX2 Delay on the XBee LR module.
This function sends the AT_J2 command to set the RX2 delay (in milliseconds) for the Join Accept message on the XBee LR module.
[in] | value | The RX2 Delay value to be set (in milliseconds). |
This function sends the AT_J2 command to set the RX2 delay (in milliseconds) for the Join Accept message on the XBee LR module.
[in] | value | The RX2 Delay value to be set (in milliseconds). |
bool XBeeArduino::setLoRaWANNwkKey | ( | const char * | value | ) |
Sets the App Key of the LoRaWAN XBee module.
value | A pointer to a buffer where the App Key will be stored. |
bool XBeeArduino::setLoRaWANRegion | ( | const uint8_t | value | ) |
Sets the LoRaWAN Region on the XBee LR module.
Wrapper function to set the LoRaWAN Region on the XBee LR module.
This function sends the AT_LR command to set the operational region (e.g., US915, EU868) on the XBee LR module.
[in] | value | The Region to be set. |
This function sends the AT_LR command to set the operational region (e.g., US915, EU868) on the XBee LR module.
[in] | value | The Region to be set. |
bool XBeeArduino::setLoRaWANRX1Delay | ( | const uint32_t | value | ) |
Sets the LoRaWAN RX1 Delay on the XBee LR module.
Wrapper function to set the LoRaWAN RX1 Delay on the XBee LR module.
This function sends the AT_D1 command to set the RX1 delay (in milliseconds) on the XBee LR module.
[in] | value | The RX1 Delay value to be set (in milliseconds). |
This function sends the AT_D1 command to set the RX1 delay (in milliseconds) on the XBee LR module.
[in] | value | The RX1 Delay value to be set (in milliseconds). |
bool XBeeArduino::setLoRaWANRX2DataRate | ( | const uint8_t | value | ) |
Sets the LoRaWAN RX2 Data Rate on the XBee LR module.
Wrapper function to set the LoRaWAN RX2 Data Rate on the XBee LR module.
This function sends the AT_XD command to set the RX2 Data Rate on the XBee LR module.
[in] | value | The RX2 Data Rate to be set. |
This function sends the AT_XD command to set the RX2 Data Rate on the XBee LR module.
[in] | value | The RX2 Data Rate to be set. |
bool XBeeArduino::setLoRaWANRX2Delay | ( | const uint32_t | value | ) |
Sets the LoRaWAN RX2 Delay on the XBee LR module.
Wrapper function to set the LoRaWAN RX2 Delay on the XBee LR module.
This function sends the AT_D2 command to set the RX2 delay (in milliseconds) on the XBee LR module.
[in] | value | The RX2 Delay value to be set (in milliseconds). |
This function sends the AT_D2 command to set the RX2 delay (in milliseconds) on the XBee LR module.
[in] | value | The RX2 Delay value to be set (in milliseconds). |
bool XBeeArduino::setLoRaWANRX2Frequency | ( | const uint32_t | value | ) |
Sets the LoRaWAN RX2 Frequency on the XBee LR module.
Wrapper function to set the LoRaWAN RX2 Frequency on the XBee LR module.
This function sends the AT_XF command to set the RX2 Frequency on the XBee LR module.
[in] | value | The RX2 Frequency to be set (in Hz). |
This function sends the AT_XF command to set the RX2 Frequency on the XBee LR module.
[in] | value | The RX2 Frequency to be set (in Hz). |
bool XBeeArduino::setLoRaWANTransmitPower | ( | const uint8_t | value | ) |
Sets the LoRaWAN Transmit Power on the XBee LR module.
Wrapper function to set the LoRaWAN Transmit Power on the XBee LR module.
This function sends the AT_PO command to set the transmit power level on the XBee LR module.
[in] | value | The Transmit Power value to be set (in dBm). |
This function sends the AT_PO command to set the transmit power level on the XBee LR module.
[in] | value | The Transmit Power value to be set (in dBm). |
bool XBeeArduino::writeConfig | ( | void | ) |
Write config on XBee.