Xbee Arduino
Arduino Driver for Xbee
Loading...
Searching...
No Matches
XBeeArduino.h
Go to the documentation of this file.
1#ifndef XBEE_ARDUINO_H
2#define XBEE_ARDUINO_H
3
4#include <Arduino.h>
5#include "port.h"
6#include "xbee.h"
7#include "xbee_lr.h" // Assuming this is where XBeeLRPacket_t and other XBee-related types are defined
8
47};
48
58public:
68 XBeeArduino(Stream* serialPort, uint32_t baudrate, XBeeModuleType moduleType,
69 void (*onReceiveCallback)(void*),
70 void (*onSendCallback)(void*));
71
76
81 bool begin();
82
87 bool connect();
88
93 void process();
94
99 bool disconnect();
100
106 template <typename T>
107 bool sendData(const T& data);
108
113 bool isConnected();
114
118 void reset();
119
125 bool setApiOptions(const uint8_t options);
126
132 bool getLoRaWANDevEUI(uint8_t* devEUI, uint8_t length);
133
139 bool setLoRaWANAppEUI(const char* value);
140
146 bool setLoRaWANAppKey(const char* value);
147
153 bool setLoRaWANNwkKey(const char* value);
154
159 bool applyChanges(void);
164 bool writeConfig(void);
165
176 bool setLoRaWANClass(const char value);
177
188 bool setLoRaWANActivationMode(const uint8_t value);
189
200 bool setLoRaWANADR(const uint8_t value);
201
212 bool setLoRaWANDataRate(const uint8_t value);
213
224 bool setLoRaWANRegion(const uint8_t value);
225
236 bool setLoRaWANDutyCycle(const uint8_t value);
237
249 bool getLoRaWANSpecVersion(char* responseBuffer, uint8_t buffer_size);
250
261 bool setLoRaWANJoinRX1Delay(const uint32_t value);
262
273 bool setLoRaWANJoinRX2Delay(const uint32_t value);
274
285 bool setLoRaWANRX1Delay(const uint32_t value);
286
297 bool setLoRaWANRX2Delay(const uint32_t value);
298
309 bool setLoRaWANRX2DataRate(const uint8_t value);
310
321 bool setLoRaWANRX2Frequency(const uint32_t value);
322
333 bool setLoRaWANTransmitPower(const uint8_t value);
334
335private:
336 Stream* serialPort_;
337 XBeeModuleType moduleType_;
338 XBee* xbee_;
339 uint32_t baudRate_;
340 void (*onReceiveCallback_)(void*);
341 void (*onSendCallback_)(void*);
342 XBeeCTable ctable_;
343 XBeeHTable htable_;
344 static XBeeArduino* instance_;
345 static void onReceiveWrapper(XBee* xbee, void* data);
346 static void onSendWrapper(XBee* xbee, void* data);
347};
348
349#endif // XBEE_ARDUINO_H
XBeeModuleType
Enum to represent the type of XBee module.
Definition: XBeeArduino.h:44
@ XBEE_STANDARD
Standard XBee module.
Definition: XBeeArduino.h:45
@ XBEE_LORA
LoRa XBee module.
Definition: XBeeArduino.h:46
A class to interface with XBee modules on Arduino platforms.
Definition: XBeeArduino.h:57
bool begin()
Initializes the XBee module.
Definition: XBeeArduino.cpp:88
void reset()
Resets the XBee module.
Definition: XBeeArduino.cpp:157
bool applyChanges(void)
Applys config changes on XBee.
Definition: XBeeArduino.cpp:191
void process()
Lets the XBee class process.
Definition: XBeeArduino.cpp:107
bool setLoRaWANTransmitPower(const uint8_t value)
Sets the LoRaWAN Transmit Power on the XBee LR module.
Definition: XBeeArduino.cpp:485
bool setLoRaWANJoinRX2Delay(const uint32_t value)
Sets the LoRaWAN Join RX2 Delay on the XBee LR module.
Definition: XBeeArduino.cpp:400
bool writeConfig(void)
Write config on XBee.
Definition: XBeeArduino.cpp:200
bool setLoRaWANAppKey(const char *value)
Sets the App Key of the LoRaWAN XBee module.
Definition: XBeeArduino.cpp:222
bool setLoRaWANRegion(const uint8_t value)
Sets the LoRaWAN Region on the XBee LR module.
Definition: XBeeArduino.cpp:331
bool setLoRaWANRX1Delay(const uint32_t value)
Sets the LoRaWAN RX1 Delay on the XBee LR module.
Definition: XBeeArduino.cpp:417
bool setLoRaWANDutyCycle(const uint8_t value)
Sets the LoRaWAN Duty Cycle on the XBee LR module.
Definition: XBeeArduino.cpp:348
bool setLoRaWANNwkKey(const char *value)
Sets the App Key of the LoRaWAN XBee module.
Definition: XBeeArduino.cpp:234
bool setLoRaWANDataRate(const uint8_t value)
Sets the LoRaWAN Data Rate on the XBee LR module.
Definition: XBeeArduino.cpp:314
bool setLoRaWANClass(const char value)
Sets the LoRaWAN Class on the XBee LR module.
Definition: XBeeArduino.cpp:263
bool setLoRaWANRX2DataRate(const uint8_t value)
Sets the LoRaWAN RX2 Data Rate on the XBee LR module.
Definition: XBeeArduino.cpp:451
bool getLoRaWANDevEUI(uint8_t *devEUI, uint8_t length)
Retrieves the DevEUI of the LoRaWAN XBee module.
Definition: XBeeArduino.cpp:246
bool connect()
Connects the XBee module to the network.
Definition: XBeeArduino.cpp:96
bool setLoRaWANActivationMode(const uint8_t value)
Sets the LoRaWAN Activation Mode on the XBee LR module.
Definition: XBeeArduino.cpp:280
bool isConnected()
Checks if the XBee module is connected to the network.
Definition: XBeeArduino.cpp:147
bool sendData(const T &data)
Sends data through the XBee module.
Definition: XBeeArduino.cpp:130
bool setLoRaWANAppEUI(const char *value)
Sets the App EUI of the LoRaWAN XBee module.
Definition: XBeeArduino.cpp:210
bool getLoRaWANSpecVersion(char *responseBuffer, uint8_t buffer_size)
Gets the LoRaWAN Specification Version from the XBee LR module.
Definition: XBeeArduino.cpp:366
bool setLoRaWANRX2Delay(const uint32_t value)
Sets the LoRaWAN RX2 Delay on the XBee LR module.
Definition: XBeeArduino.cpp:434
bool setLoRaWANJoinRX1Delay(const uint32_t value)
Sets the LoRaWAN Join RX1 Delay on the XBee LR module.
Definition: XBeeArduino.cpp:383
bool setApiOptions(const uint8_t options)
Sets the API options for XBee.
Definition: XBeeArduino.cpp:168
bool setLoRaWANRX2Frequency(const uint32_t value)
Sets the LoRaWAN RX2 Frequency on the XBee LR module.
Definition: XBeeArduino.cpp:468
~XBeeArduino()
Destructor for XBeeArduino class.
Definition: XBeeArduino.cpp:77
bool setLoRaWANADR(const uint8_t value)
Sets the LoRaWAN Adaptive Data Rate (ADR) on the XBee LR module.
Definition: XBeeArduino.cpp:297
bool disconnect()
Disconnects the XBee module from the network.
Definition: XBeeArduino.cpp:117
Platform-specific abstraction layer for hardware interfaces.
Definition: xbee.h:106
Definition: xbee.h:87
Definition: xbee.h:121
Header file for the XBee class.
Header file for the XBee LR (LoRaWAN) subclass.