XBee Firmware Library  1.6.0
Files | Data Structures | Typedefs | Functions | Variables
Datatypes and support functions

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
 

Detailed Description

Typedef Documentation

Single structure to hold an 802.15.4 device's 64-bit IEEE/MAC address and 16-bit network address.

Function Documentation

bool_t addr64_equal ( const addr64 FAR *  addr1,
const addr64 FAR *  addr2 
)

Compare two 64-bit addresses for equality.

Parameters
[in]addr1address to compare
[in]addr2address to compare
Return values
TRUEaddr1 and addr2 are not NULL and point to identical addresses
FALSENULL 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 ':'
Parameters
[out]bufferPointer to a buffer of at least #ADDR64_STRING_LENGTH (8 2-character bytes + 7 separators + 1 null = 24) bytes.
[in]address64-bit address to format.
Returns
address as a printable string (stored in buffer).
    @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 [!]?)
bool_t addr64_is_zero ( const addr64 FAR *  addr)

Test a 64-bit address for zero.

Parameters
[in]addraddress to test
Return values
TRUEaddr is NULL or points to an all-zero address
FALSEaddr points to a non-zero address
See also
WPAN_IEEE_ADDR_ALL_ZEROS
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:

  • 01-23-45-67-89-ab-cd-ef
  • 01234567-89ABCDEF
  • 01:23:45:67:89:aB:Cd:EF
  • 0123 4567 89AB cdef
Parameters
[out]addressconverted address (stored big-endian)
[in]strstring to convert, starting with first hex character
Return values
-EINVALinvalid parameters passed to function; if address is not NULL, it will be set to all zeros
0string converted

Variable Documentation

const addr64 _WPAN_IEEE_ADDR_BROADCAST
Initial value:
=
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF } }
const addr64 _WPAN_IEEE_ADDR_BROADCAST
const addr64 _WPAN_IEEE_ADDR_COORDINATOR
Initial value:
=
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
const addr64 _WPAN_IEEE_ADDR_COORDINATOR
const addr64 _WPAN_IEEE_ADDR_UNDEFINED
Initial value:
=
{ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } }
const addr64 _WPAN_IEEE_ADDR_UNDEFINED
uint8_t b[8]
addr64 ieee
uint32_t l[2]
uint16_t network
uint16_t u[4]