Control class for XBee modules.
More...
#include <XBee.h>
|
| XBee (Module *mod) |
| Default constructor. More...
|
|
int16_t | begin (long speed) |
| Initialization method. More...
|
|
void | reset () |
| Resets module using interrupt/GPIO pin 1.
|
|
int16_t | transmit (uint8_t *dest, const char *payload, uint8_t radius=1) |
| Sends data to the destination 64-bit (global) address, when destination 16-bit (local) address is unknown. More...
|
|
int16_t | transmit (uint8_t *dest, uint8_t *destNetwork, const char *payload, uint8_t radius=1) |
| Sends data to the destination 64-bit (global) address, when destination 16-bit (local) address is known. More...
|
|
size_t | available () |
| Gets the number of payload bytes received. More...
|
|
String | getPacketSource () |
| Gets packet source 64-bit address. More...
|
|
String | getPacketData () |
| Gets packet payload. More...
|
|
int16_t | setPanId (uint8_t *panId) |
| Sets PAN (Personal Area Network) ID. All XBees must be in the same PAN in order to communicate. More...
|
|
Control class for XBee modules.
◆ XBee()
Default constructor.
- Parameters
-
mod | Instance of Module that will be used to communicate with the radio. |
◆ available()
size_t XBee::available |
( |
| ) |
|
Gets the number of payload bytes received.
- Returns
- Number of available payload bytes, or 0 if nothing was received.
◆ begin()
int16_t XBee::begin |
( |
long |
speed | ) |
|
Initialization method.
- Parameters
-
speed | Baud rate to use for UART interface. |
- Returns
- Status Codes
◆ getPacketData()
String XBee::getPacketData |
( |
| ) |
|
Gets packet payload.
- Returns
- Packet payload, in the form of Arduino String.
◆ getPacketSource()
String XBee::getPacketSource |
( |
| ) |
|
Gets packet source 64-bit address.
- Returns
- Packet source address, in the form of uppercase hexadecimal Arduino String (i.e. 16 characters).
◆ setPanId()
int16_t XBee::setPanId |
( |
uint8_t * |
panId | ) |
|
Sets PAN (Personal Area Network) ID. All XBees must be in the same PAN in order to communicate.
- Parameters
-
panId | 8-byte PAN ID to be used, in the form of uppercase hexadecimal string (i.e. 16 characters). |
◆ transmit() [1/2]
int16_t XBee::transmit |
( |
uint8_t * |
dest, |
|
|
const char * |
payload, |
|
|
uint8_t |
radius = 1 |
|
) |
| |
Sends data to the destination 64-bit (global) address, when destination 16-bit (local) address is unknown.
- Parameters
-
dest | Destination 64-bit address, in the form of 8-byte array. |
payload | String of payload bytes. |
radius | Number of maximum "hops" for a broadcast transmission. Defaults to 1, set to 0 for unlimited number of hops. |
◆ transmit() [2/2]
int16_t XBee::transmit |
( |
uint8_t * |
dest, |
|
|
uint8_t * |
destNetwork, |
|
|
const char * |
payload, |
|
|
uint8_t |
radius = 1 |
|
) |
| |
Sends data to the destination 64-bit (global) address, when destination 16-bit (local) address is known.
- Parameters
-
dest | Destination 64-bit address, in the form of 8-byte array. |
destNetwork | Destination 16-bit address, in the form of 2-byte array. |
payload | String of payload bytes. |
radius | Number of maximum "hops" for a broadcast transmission. Defaults to 1, set to 0 for unlimited number of hops. |
The documentation for this class was generated from the following files:
- src/modules/XBee/XBee.h
- src/modules/XBee/XBee.cpp