XBee Firmware Library
1.6.0
|
Files | |
file | types.h |
file | wpan_types.c |
Data Structures | |
struct | _wpan_address_t |
union | addr64 |
Typedefs | |
typedef struct _wpan_address_t | wpan_address_t |
Functions | |
bool_t | addr64_equal (const addr64 FAR *addr1, const addr64 FAR *addr2) |
Compare two 64-bit addresses for equality. More... | |
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_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_BROADCAST |
const addr64 | _WPAN_IEEE_ADDR_COORDINATOR |
const addr64 | _WPAN_IEEE_ADDR_UNDEFINED |
uint8_t | b [8] |
addr64 | ieee |
uint32_t | l [2] |
uint16_t | network |
uint16_t | u [4] |
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 |
typedef struct _wpan_address_t wpan_address_t |
Single structure to hold an 802.15.4 device's 64-bit IEEE/MAC address and 16-bit network address.
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 |
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").
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. |
@to_do Add a parameter to indicate big or little endian and update code to work with either. (for little-endian, b starts at address->b + 8 and is decremented) add a parameter for other formats/flags - uppercase vs. lowercase hex - compact format (0013a200-405e0ef0) - format used by the Python framework (with [!]?)
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 |
int addr64_parse | ( | addr64 * | address_be, |
const char FAR * | str | ||
) |
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 | 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 |
const addr64 _WPAN_IEEE_ADDR_BROADCAST |
const addr64 _WPAN_IEEE_ADDR_BROADCAST |
const addr64 _WPAN_IEEE_ADDR_COORDINATOR |
const addr64 _WPAN_IEEE_ADDR_COORDINATOR |
const addr64 _WPAN_IEEE_ADDR_UNDEFINED |
const addr64 _WPAN_IEEE_ADDR_UNDEFINED |
uint8_t b[8] |
addr64 ieee |
uint32_t l[2] |
uint16_t network |
uint16_t u[4] |