Digi XBee(R) ANSI C Host Library
|
Go to the source code of this file.
Data Structures | |
struct | xbee_dispatch_table_entry_t |
struct | xbee_dev_t |
struct | xbee_dev_t::rx |
Current mode of the XBee device (e.g., boot loader, API, command). More... | |
struct | xbee_frame_modem_status_t |
< XBEE_FRAME_MODEM_STATUS (0x8A) See XBEE_MODEM_STATUS_* More... | |
Macros | |
#define | XBEE_DEV_MAX_DISPATCH_PER_TICK 5 |
Maximum number of frames to dispatch per call to xbee_tick(). | |
#define | XBEE_MAX_RFPAYLOAD 256 |
Smart Energy and ZigBee are limited to 128 bytes, DigiMesh is 256 bytes. | |
#define | XBEE_MAX_RX_FRAME_LEN (XBEE_MAX_RFPAYLOAD + 18) |
Max Received Frame Size, including type, is for 0x91, Receive Explicit. More... | |
#define | XBEE_MAX_TX_FRAME_LEN (XBEE_MAX_RFPAYLOAD + 20) |
Max Transmitted Frame Size, including type, is for 0x11, Transmit Explicit. More... | |
#define | XBEE_MAX_FRAME_LEN XBEE_MAX_RX_FRAME_LEN |
Deprecated legacy macro, use XBEE_MAX_RX_FRAME_LEN instead. | |
#define | XBEE_DEV_STACK_VERSION_ADDR(x) ((uint8_t *)&(x).firmware_version + 3) |
Macro function to get a pointer to the LSB of the radio's firmware version. More... | |
#define | XBEE_FRAME_TABLE_END { 0xFF, 0, NULL, NULL } |
#define | XBEE_DEV_DUMP_FLAG_NONE 0x0000 |
#define | XBEE_DEV_DUMP_FLAG_DEFAULT XBEE_DEV_DUMP_FLAG_NONE |
#define | XBEE_WRITE_FLAG_NONE 0x0000 |
#define | XBEE_FRAME_MODEM_STATUS_DEBUG { XBEE_FRAME_MODEM_STATUS, 0, xbee_frame_dump_modem_status, NULL } |
Add this macro to the list of XBee frame handlers to have modem status changes dumped to STDOUT. | |
Functions | |
uint8_t | xbee_next_frame_id (xbee_dev_t *xbee) |
Increment and return current frame ID for a given XBee device. More... | |
int | xbee_dev_init (xbee_dev_t *xbee, const xbee_serial_t *serport, xbee_is_awake_fn is_awake, xbee_reset_fn reset) |
Initialize the XBee device structure and open a serial connection to a local, serially-attached XBee module. More... | |
void | xbee_dev_dump_settings (xbee_dev_t *xbee, uint16_t flags) |
Print information to stdout about the XBee device. More... | |
int | xbee_dev_reset (xbee_dev_t *xbee) |
Toggles the reset line of the XBee device. More... | |
int | xbee_dev_tick (xbee_dev_t *xbee) |
Check for newly received frames on an XBee device and dispatch them to registered frame handlers. More... | |
int | xbee_frame_write (xbee_dev_t *xbee, const void FAR *header, uint16_t headerlen, const void FAR *data, uint16_t datalen, uint16_t flags) |
Copies a frame into the transmit serial buffer to send to an XBee module. More... | |
void | xbee_dev_flowcontrol (xbee_dev_t *xbee, bool_t enabled) |
Control whether xbee_frame_write() checks the XBee CTS signal before sending frames. More... | |
void | _xbee_dispatch_table_dump (const xbee_dev_t *xbee) |
uint8_t | _xbee_checksum (const void FAR *bytes, uint16_t length, uint_fast8_t initial) |
Calculate the checksum for an XBee frame. More... | |
int | _xbee_frame_load (xbee_dev_t *xbee) |
Check XBee's serial buffer for complete frames and pass them off to the dispatcher. More... | |
int | _xbee_frame_dispatch (xbee_dev_t *xbee, const void FAR *frame, uint16_t length) |
Function called by _xbee_frame_load() to dispatch any frames read. More... | |
int | xbee_frame_dump_modem_status (xbee_dev_t *xbee, const void FAR *frame, uint16_t length, void FAR *context) |
Frame handler for 0x8A (XBEE_FRAME_MODEM_STATUS) frames – dumps modem status to STDOUT for debugging purposes. More... | |
Variables | |
const xbee_dispatch_table_entry_t | xbee_frame_handlers [] |
Static table used for dispatching frames. More... | |
#define | XBEE_DEV_FLAG_NONE 0x0000 |
#define | XBEE_RX_OPT_ACKNOWLEDGED 0x01 |
#define | XBEE_RX_OPT_BROADCAST 0x02 |
XBee Receive Options: broadcast packet [ZigBee, DigiMesh]. | |
#define | XBEE_RX_OPT_SENT_ENCRYPTED 0x10 |
XBee Receive Options: received encrypted via Secure Session [XBee3]. | |
#define | XBEE_RX_OPT_APS_ENCRYPT 0x20 |
XBee Receive Options: APS-encrypted packet [ZigBee]. | |
#define | XBEE_RX_OPT_FROM_END_DEVICE 0x40 |
XBee Receive Options: packet from end device (if known) [ZigBee]. | |
#define | XBEE_RX_OPT_MODE_MASK 0xC0 |
XBee Receive Options: Mask for transmission mode [DigiMesh]. | |
#define | XBEE_RX_OPT_MODE_NONE (0) |
XBee Receive Options: Mode not specified [DigiMesh]. | |
#define | XBEE_RX_OPT_MODE_POINT_MULTIPOINT (1<<6) |
XBee Receive Options: Point-Multipoint [DigiMesh]. | |
#define | XBEE_RX_OPT_MODE_REPEATER (2<<6) |
XBee Receive Options: Repeater Mode [DigiMesh]. | |
#define | XBEE_RX_OPT_MODE_DIGIMESH (3<<6) |
XBee Receive Options: DigiMesh (not available on 10k product) [DigiMesh]. | |
Function Pointer Prototypes | |
Function pointer prototypes, forward declaration using "struct xbee_dev_t" instead of "xbee_dev_t" since we use the types in the xbee_dev_t definition. | |
typedef int(* | xbee_frame_handler_fn) (struct xbee_dev_t *xbee, const void FAR *frame, uint16_t length, void FAR *context) |
Standard API for an XBee frame handler in xbee_frame_handlers global. More... | |
typedef int(* | xbee_is_awake_fn) (struct xbee_dev_t *xbee) |
Function to check the XBee device's AWAKE pin to see if it is awake. More... | |
typedef void(* | xbee_reset_fn) (struct xbee_dev_t *xbee, bool_t asserted) |
Function to toggle the /RESET pin to the XBee device. More... | |
typedef void(* | xbee_disc_node_id_fn) (struct xbee_dev_t *xbee, const struct xbee_node_id_t *rec) |
Function to process parsed Node ID messages. More... | |
XBEE_MODEM_STATUS_* | |
Values for | |
#define | XBEE_MODEM_STATUS_HW_RESET 0x00 |
XBee Modem Status: Hardware reset [ZigBee, DigiMesh, Wi-Fi]. | |
#define | XBEE_MODEM_STATUS_WATCHDOG 0x01 |
XBee Modem Status: Watchdog timer reset [ZigBee, DigiMesh, Wi-fi]. | |
#define | XBEE_MODEM_STATUS_JOINED 0x02 |
XBee Modem Status: Joined network (routers and end devices) [ZigBee, Wi-Fi]. | |
#define | XBEE_MODEM_STATUS_DISASSOC 0x03 |
XBee Modem Status: Disassociated (left network) [ZigBee, Wi-Fi]. | |
#define | XBEE_MODEM_STATUS_IP_CONFIG_ERROR 0x04 |
XBee Modem Status: IP configuration error [Wi-Fi]. | |
#define | XBEE_MODEM_STATUS_COORD_START 0x06 |
XBee Modem Status: Coordinator started [ZigBee]. | |
#define | XBEE_MODEM_STATUS_NETWORK_KEY_UPDATED 0x07 |
XBee Modem Status: Network security key was updated [ZigBee]. | |
#define | XBEE_MODEM_STATUS_WOKE_UP 0x0B |
XBee Modem Status: Network Woke Up [DigiMesh]. | |
#define | XBEE_MODEM_STATUS_SLEEPING 0x0C |
XBee Modem Status: Network Went To Sleep [DigiMesh]. | |
#define | XBEE_MODEM_STATUS_OVERVOLTAGE 0x0D |
XBee Modem Status: Voltage supply limit exceeded (XBee-PRO only) [ZigBee]. | |
#define | XBEE_MODEM_STATUS_CLOUD_CONNECTED 0x0E |
XBee Modem Status: Device Cloud connected [Wi-Fi]. | |
#define | XBEE_MODEM_STATUS_CLOUD_DISCONNECTED 0x0F |
XBee Modem Status: Device Cloud disconnected [Wi-Fi]. | |
#define | XBEE_MODEM_STATUS_KEY_ESTABLISHED 0x10 |
XBee Modem Status: Key establishment complete [Smart Energy]. | |
#define | XBEE_MODEM_STATUS_CONFIG_CHANGE_IN_JOIN 0x11 |
XBee Modem Status: Modem config changed while join in progress [ZigBee]. | |
#define | XBEE_MODEM_STATUS_SS_ESTABLISHED 0x3B |
XBee Modem Status: Secure Session Established. | |
#define | XBEE_MODEM_STATUS_SS_ENDED 0x3C |
XBee Modem Status: Secure Session Ended. | |
#define | XBEE_MODEM_STATUS_SS_AUTH_FAILED 0x3D |
XBee Modem Status: Secure Session Authentication Failed. | |
#define | XBEE_MODEM_STATUS_STACK_ERROR 0x80 |
XBee Modem Status: Network stack error [ZigBee]. | |
Macros related to the | |
#define | XBEE_HARDWARE_MASK 0xFF00 |
#define | XBEE_HARDWARE_S1 0x1700 |
#define | XBEE_HARDWARE_S1_PRO 0x1800 |
#define | XBEE_HARDWARE_S2 0x1900 |
#define | XBEE_HARDWARE_S2_PRO 0x1A00 |
#define | XBEE_HARDWARE_900_PRO 0x1B00 |
#define | XBEE_HARDWARE_868_PRO 0x1D00 |
#define | XBEE_HARDWARE_S2B_PRO 0x1E00 |
#define | XBEE_HARDWARE_S2C_PRO 0x2100 |
#define | XBEE_HARDWARE_S2C 0x2200 |
#define | XBEE_HARDWARE_S3B 0x2300 |
#define | XBEE_HARDWARE_S8 0x2400 |
#define | XBEE_HARDWARE_S6B 0x2700 |
#define | XBEE_HARDWARE_CELL_CAT1_VZW 0x4000 |
#define | XBEE_HARDWARE_XB3_MICRO 0x4100 |
#define | XBEE_HARDWARE_XB3_TH 0x4200 |
#define | XBEE_HARDWARE_CELL_3G 0x4400 |
Macros related to the | |
#define | XBEE_HW_SERIES_MASK 0xFF00 |
#define | XBEE_HW_SERIES_WIFI_S6 0x0600 |
#define | XBEE_HW_SERIES_CELLULAR 0x0B00 |
#define | XBEE_HW_SERIES_XBEE3_RF 0x0C00 |
Macros related to the | |
#define | XBEE_PROTOCOL_MASK 0xF000 |
#define | XBEE_PROTOCOL_ZNET 0x1000 |
#define | XBEE_PROTOCOL_ZB 0x2000 |
#define | XBEE_PROTOCOL_SMARTENERGY 0x3000 |
#define | XBEE_PROTOCOL_ZB_S2C 0x4000 |
#define | XBEE_PROTOCOL_SE_S2C 0x5000 |
#define | XBEE_PROTOCOL_MESHLESS 0x1000 |
#define | XBEE_PROTOCOL_DIGIMESH 0x8000 |
#define | XBEE_PROTOCOL_XB3_ZIGBEE 0x1000 |
#define | XBEE_PROTOCOL_XB3_802_15_4 0x2000 |
#define | XBEE_PROTOCOL_XB3_DIGIMESH 0x3000 |
#define | XBEE_NODETYPE_MASK 0x0F00 |
#define | XBEE_NODETYPE_COORD 0x0100 |
#define | XBEE_NODETYPE_ROUTER 0x0300 |
#define | XBEE_NODETYPE_ENDDEV 0x0900 |