Digi XBee(R) ANSI C Host Library
|
Files | |
file | register_device.h |
Frame definitions and support functions for Register Joining Device (0x24) and Register Device Status (0xA4) frames used on XBee3 Zigbee modules. | |
file | xbee_register_device.c |
Frame definitions and support functions for Register Joining Device (0x24) and Register Device Status (0xA4) frames used on XBee3 Zigbee modules. | |
Data Structures | |
struct | xbee_header_register_device_t |
< XBEE_FRAME_REGISTER_DEVICE (0x24) ID to match REGISTER_DEVICE_STATUS frame 64-bit address of destination devices set to WPAN_NET_ADDR_UNDEFINED (0xFFFE) options for join, XBEE_REG_DEV_OPT_xxx More... | |
struct | xbee_frame_register_device_status_t |
< XBEE_FRAME_REGISTER_DEVICE_STATUS (0xA4) ID of REGISTER_DEVICE frame result of operation More... | |
Macros | |
#define | XBEE_ZIGBEE_INSTALL_KEY_LEN 18 |
length of an install code | |
#define | XBEE_ZIGBEE_LINK_KEY_MAXLEN 16 |
maximum length of a link key | |
#define | XBEE_FRAME_REGISTER_DEVICE 0x24 |
#define | XBEE_FRAME_REGISTER_DEVICE_STATUS 0xA4 |
#define | XBEE_REGISTER_DEVICE_STR_BUF_SIZE 40 |
Buffer size used for xbee_register_device_status_str(). | |
Functions | |
int | xbee_register_device (xbee_dev_t *xbee, addr64 device_addr_be, const void *key, unsigned key_len) |
Send a Register Joining Device frame to a local XBee3 Zigbee module. More... | |
const char * | xbee_register_device_status_str (uint8_t status, char buffer[XBEE_REGISTER_DEVICE_STR_BUF_SIZE]) |
Get a description of an XBEE_REG_DEV_STATUS_xxx value (returned in an XBEE_FRAME_REGISTER_DEVICE_STATUS) for error messages. More... | |
int | xbee_dump_register_device_status (xbee_dev_t *xbee, const void FAR *rawframe, uint16_t length, void FAR *context) |
Debugging frame handler to print Register Device Status (0xA4) frames. More... | |
int xbee_dump_register_device_status | ( | xbee_dev_t * | xbee, |
const void FAR * | rawframe, | ||
uint16_t | length, | ||
void FAR * | context | ||
) |
Debugging frame handler to print Register Device Status (0xA4) frames.
View the documentation of xbee_frame_handler_fn() for this function's parameters and return value.
References xbee_register_device_status_str(), and XBEE_REGISTER_DEVICE_STR_BUF_SIZE.
int xbee_register_device | ( | xbee_dev_t * | xbee, |
addr64 | device_addr_be, | ||
const void * | key, | ||
unsigned | key_len | ||
) |
Send a Register Joining Device frame to a local XBee3 Zigbee module.
[in] | xbee | Trust Center to register device with. |
[in] | device_addr_be | Address of device to register. |
[in] | key | Device key or NULL to deregister a device. |
[in] | key_len | 0 to deregister, 18 if key is an install code, 1 to 16 if key is a link key. |
>0 | ID of frame sent to XBee module. |
-EINVAL | Invalid parameter. |
-EBUSY | Transmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal). |
References EINVAL, htobe16, WPAN_NET_ADDR_UNDEFINED, xbee_frame_write(), xbee_next_frame_id(), XBEE_ZIGBEE_INSTALL_KEY_LEN, and XBEE_ZIGBEE_LINK_KEY_MAXLEN.
const char * xbee_register_device_status_str | ( | uint8_t | status, |
char | buffer[XBEE_REGISTER_DEVICE_STR_BUF_SIZE] | ||
) |
Get a description of an XBEE_REG_DEV_STATUS_xxx value (returned in an XBEE_FRAME_REGISTER_DEVICE_STATUS) for error messages.
Referenced by xbee_dump_register_device_status().