Digi XBee(R) ANSI C Host Library
|
Files | |
file | types.h |
WPAN datatypes and support functions, valid for ZigBee and DigiMesh. | |
file | wpan_types.c |
Data types and macros used by all WPAN (802.15.4) devices. | |
Data Structures | |
union | addr64 |
Typedef used to hold a 64-bit IEEE address, represented as 8 bytes, 4 16-bit values or 2 32-bit values. More... | |
struct | wpan_address_t |
Single structure to hold an 802.15.4 device's 64-bit IEEE/MAC address and 16-bit network address. More... | |
Macros | |
#define | ADDR64_FORMAT_SEPARATOR '-' |
Separator used by addr64_format(), defaults to '-' unless specified at compile time. More... | |
#define | ADDR64_STRING_LENGTH (8 * 2 + 7 + 1) |
Size of character buffer to pass to addr64_format() (8 2-character bytes, 7 separators and 1 null). More... | |
Functions | |
char FAR * | addr64_format (char FAR *buffer, const addr64 FAR *address) |
Format a 64-bit address as a null-terminated, printable string (e.g., "00-13-A2-01-23-45-67"). More... | |
bool_t | addr64_equal (const addr64 FAR *addr1, const addr64 FAR *addr2) |
Compare two 64-bit addresses for equality. More... | |
bool_t | addr64_is_zero (const addr64 FAR *addr) |
Test a 64-bit address for zero. More... | |
int | addr64_parse (addr64 *address_be, const char FAR *str) |
Parse a text string into a 64-bit IEEE address. More... | |
Variables | |
const addr64 | _WPAN_IEEE_ADDR_UNDEFINED |
const addr64 | _WPAN_IEEE_ADDR_BROADCAST |
const addr64 | _WPAN_IEEE_ADDR_COORDINATOR |
Reserved/Special WPAN network (16-bit) addresses | |
#define | WPAN_NET_ADDR_BCAST_ALL_NODES 0xFFFF |
network broadcast address for all nodes | |
#define | WPAN_NET_ADDR_BCAST_NOT_ASLEEP 0xFFFD |
network broadcast address for non-sleeping devices | |
#define | WPAN_NET_ADDR_BCAST_ROUTERS 0xFFFC |
network broadcast address for all routers (and coordinators) | |
#define | WPAN_NET_ADDR_UNDEFINED 0xFFFE |
used to indicate 64-bit addressing (16-bit address is ignored) | |
#define | WPAN_NET_ADDR_COORDINATOR 0x0000 |
network coordinator always uses network address 0x0000 | |
Reserved/Special WPAN MAC (64-bit) addresses | |
const addr64 | _WPAN_IEEE_ADDR_UNDEFINED |
const addr64 | _WPAN_IEEE_ADDR_BROADCAST |
const addr64 | _WPAN_IEEE_ADDR_COORDINATOR |
#define | WPAN_IEEE_ADDR_UNDEFINED (&_WPAN_IEEE_ADDR_UNDEFINED) |
Pointer to addr64 representing an undefined IEEE address (all ones). More... | |
#define | WPAN_IEEE_ADDR_BROADCAST (&_WPAN_IEEE_ADDR_BROADCAST) |
Pointer to addr64 representing the broadcast IEEE address. | |
#define | WPAN_IEEE_ADDR_COORDINATOR (&_WPAN_IEEE_ADDR_COORDINATOR) |
Pointer to addr64 representing the coordinator's IEEE adddress (all zeros). More... | |
#define | WPAN_IEEE_ADDR_ALL_ZEROS (&_WPAN_IEEE_ADDR_COORDINATOR) |
Pointer to addr64 of all zeros. More... | |
#define ADDR64_FORMAT_SEPARATOR '-' |
Separator used by addr64_format(), defaults to '-' unless specified at compile time.
Referenced by addr64_format().
#define ADDR64_STRING_LENGTH (8 * 2 + 7 + 1) |
Size of character buffer to pass to addr64_format() (8 2-character bytes, 7 separators and 1 null).
Referenced by _zdo_process_ieee_addr_resp(), wpan_envelope_dump(), xbee_cmd_init_device(), xbee_dev_dump_settings(), xbee_frame_dump_ext_mod_status_ss(), xbee_frame_dump_secure_session_resp(), zdo_handler(), and zdo_send_nwk_addr_req().
#define WPAN_IEEE_ADDR_ALL_ZEROS (&_WPAN_IEEE_ADDR_COORDINATOR) |
Pointer to addr64
of all zeros.
Referenced by _zcl_comm_startup_control_set(), _zdo_envelope_create(), and addr64_parse().
#define WPAN_IEEE_ADDR_COORDINATOR (&_WPAN_IEEE_ADDR_COORDINATOR) |
Pointer to addr64
representing the coordinator's IEEE adddress (all zeros).
#define WPAN_IEEE_ADDR_UNDEFINED (&_WPAN_IEEE_ADDR_UNDEFINED) |
Pointer to addr64
representing an undefined IEEE address (all ones).
Referenced by zdo_send_ieee_addr_req().
Compare two 64-bit addresses for equality.
[in] | addr1 | address to compare |
[in] | addr2 | address to compare |
TRUE | addr1 and addr2 are not NULL and point to identical addresses |
FALSE | NULL parameter passed in, or addresses differ |
Referenced by _sxa_disc_handle_frame_0x95().
Format a 64-bit address as a null-terminated, printable string (e.g., "00-13-A2-01-23-45-67").
If the first two bytes are 0x00, assume a 48-bit MAC address and format as 00-40-9D-01-23-45.
To change the default separator ('-'), define ADDR64_FORMAT_SEPARATOR to any character. For example:
#define ADDR64_FORMAT_SEPARATOR ':'
[out] | buffer | Pointer to a buffer of at least ADDR64_STRING_LENGTH (8 2-character bytes + 7 separators + 1 null = 24) bytes. |
[in] | address | 64-bit address to format. |
add a parameter for other formats/flags - uppercase vs. lowercase hex - compact format (0013a200-405e0ef0) - format used by the Python framework (with [!]?)
References ADDR64_FORMAT_SEPARATOR, and FAR.
Referenced by _zdo_process_ieee_addr_resp(), wpan_envelope_dump(), xbee_cmd_init_device(), xbee_dev_dump_settings(), xbee_frame_dump_ext_mod_status_ss(), xbee_frame_dump_secure_session_resp(), zcl_print_attribute_value(), zdo_handler(), and zdo_send_nwk_addr_req().
Test a 64-bit address for zero.
[in] | addr | address to test |
TRUE | addr is NULL or points to an all-zero address |
FALSE | addr points to a non-zero address |
Parse a text string into a 64-bit IEEE address.
Converts a text string with eight 2-character hex values, with an optional separator between any two values. For example, the following formats are all valid:
[out] | address_be | converted address (stored big-endian) |
[in] | str | string to convert, starting with first hex character |
-EINVAL | invalid parameters passed to function; if address is not NULL, it will be set to all zeros |
0 | string converted |
References EINVAL, hexstrtobyte(), and WPAN_IEEE_ADDR_ALL_ZEROS.
const addr64 _WPAN_IEEE_ADDR_BROADCAST |
address pointed to by macro WPAN_IEEE_ADDR_BROADCAST
Referenced by zdo_send_match_desc().
const addr64 _WPAN_IEEE_ADDR_BROADCAST |
address pointed to by macro WPAN_IEEE_ADDR_BROADCAST
Referenced by zdo_send_match_desc().
const addr64 _WPAN_IEEE_ADDR_COORDINATOR |
address pointed to by macro WPAN_IEEE_ADDR_COORDINATOR
const addr64 _WPAN_IEEE_ADDR_COORDINATOR |
address pointed to by macro WPAN_IEEE_ADDR_COORDINATOR
const addr64 _WPAN_IEEE_ADDR_UNDEFINED |
address pointed to by macro WPAN_IEEE_ADDR_UNDEFINED
const addr64 _WPAN_IEEE_ADDR_UNDEFINED |
address pointed to by macro WPAN_IEEE_ADDR_UNDEFINED