
Data Structures | |
| union | zb_addr_u |
| Union to address either long or short address. More... | |
Macros | |
| #define | ZB_CPP_STR(x) ZB_CPP_STR2(x) |
| Creates a string at compile time, like 0 - "0". More... | |
| #define | ZB_FALSE 0U |
| False value literal. More... | |
| #define | ZB_TRUE 1U |
| True value literal. More... | |
Enumerations | |
| enum | zb_param_e |
| General purpose parameter type. More... | |
Error codes | |
| enum | zb_ret_e |
| Error codes for non-void stack functions. More... | |
| typedef zb_int_t | zb_ret_t |
| Type for ZB functions returning non-void values. More... | |
Endian change API | |
Macros to change words endian and access words at potentially non-aligned pointers. Zigbee uses little endian, see ZB spec, subclause 1.2.1.3. | |
| void | zb_htole16 (zb_uint8_t ZB_XDATA *ptr, zb_uint8_t ZB_XDATA *val) |
| void | zb_htole32 (zb_uint8_t ZB_XDATA *ptr, zb_uint8_t ZB_XDATA *val) |
| void * | zb_put_next_htole16 (zb_uint8_t *dst, zb_uint16_t val) |
| Puts next 2-bite value into buffer, moves pointer. More... | |
| void * | zb_put_next_htole32 (zb_uint8_t *dst, zb_uint32_t val1) |
| void | zb_get_next_letoh16 (zb_uint16_t *dst, zb_uint8_t **src) |
| void * | zb_put_next_2_htole16 (zb_uint8_t *dst, zb_uint16_t val1, zb_uint16_t val2) |
| void * | zb_put_next_2_htole32 (zb_uint8_t *dst, zb_uint32_t val1, zb_uint32_t val2) |
| void | zb_memcpy8 (void *vptr, void *vsrc) |
| #define | ZB_8BIT_SIZE 1U |
| #define | ZB_16BIT_SIZE 2U |
| #define | ZB_24BIT_SIZE 3U |
| #define | ZB_32BIT_SIZE 4U |
| #define | ZB_48BIT_SIZE 6U |
| #define | ZB_64BIT_SIZE 8U |
| #define | ZB_HTOLE16(ptr, val) zb_htole16((zb_uint8_t*)(ptr), (zb_uint8_t*)(val)) |
| #define | ZB_HTOLE16_ONPLACE(val) |
| #define | ZB_HTOLE32_ONPLACE(val) { zb_uint32_t _v = (val); ZB_HTOLE32(&(val), &_v); } |
| #define | ZB_HTOLE32(ptr, val) zb_htole32((zb_uint8_t*)(ptr), (zb_uint8_t*)(val)) |
| #define | ZB_HTOBE32(ptr, val) ZB_MEMCPY(ptr, val, 4U) |
| #define | ZB_HTOBE16(ptr, val) (*(zb_uint16_t *)(ptr)) = *((zb_uint16_t *)(val)) |
| #define | ZB_HTOBE16_VAL(ptr, val) ((zb_uint16_t *)(ptr))[0] = (val) |
| #define | ZB_HTOLE64(ptr, val) zb_memcpy8(ptr, val) |
| #define | ZB_HTOLE32_VAL(ptr, val) |
| #define | ZB_HTOLE16_VAL(ptr, val) |
| #define | ZB_PUT_NEXT_HTOLE16(ptr, val) |
| #define | ZB_PUT_NEXT_HTOLE32(ptr, val) (ptr) = zb_put_next_htole32((ptr), (val)) |
| #define | ZB_LETOH64(dst, src) zb_memcpy8((zb_uint8_t*)dst, (zb_uint8_t*)src) |
| #define | ZB_LETOH16 ZB_HTOLE16 |
| Converts 16-bits integer from the little endian to the host endian. More... | |
| #define | ZB_LETOH24 ZB_HTOLE24 |
| #define | ZB_LETOH48 ZB_HTOLE48 |
| #define | ZB_LETOH32 ZB_HTOLE32 |
| #define | ZB_BETOH16 ZB_HTOBE16 |
| #define | ZB_BETOH32 ZB_HTOBE32 |
| #define | ZB_LETOH16_ONPLACE ZB_HTOLE16_ONPLACE |
| #define | ZB_LETOH32_ONPLACE ZB_HTOLE32_ONPLACE |
Base types | |
| typedef char | zb_char_t |
| Project-local char type. More... | |
| typedef unsigned char | zb_uchar_t |
| Project-local unsigned char type. More... | |
| typedef unsigned char | zb_uint8_t |
| Project-local 1-byte unsigned int type. More... | |
| typedef signed char | zb_int8_t |
| Project-local 1-byte signed int type. More... | |
| typedef unsigned short | zb_uint16_t |
| Project-local 2-byte unsigned int type. More... | |
| typedef signed short | zb_int16_t |
| Project-local 2-byte signed int type. More... | |
| typedef unsigned int | zb_uint32_t |
| Project-local 4-byte unsigned int type. More... | |
| typedef signed int | zb_int32_t |
| Project-local 4-byte signed int type. More... | |
| typedef zb_uint32_t | zb_bitfield_t |
| Type to be used for unsigned bit fields inside structure. More... | |
| typedef zb_int32_t | zb_sbitfield_t |
| Type to be used for signed bit fields inside structure. More... | |
| typedef zb_uint32_t | zb_size_t |
| Project-local size_t type. More... | |
| typedef int | zb_short_t |
| Short int (can fit into single CPU register). More... | |
| typedef unsigned int | zb_ushort_t |
| Short unsigned int (can fit into single CPU register). More... | |
| typedef int | zb_int_t |
| Int (at least 2 bytes). More... | |
| typedef unsigned int | zb_uint_t |
| Unsigned int (at least 2 bytes). More... | |
| typedef zb_int_t | zb_long_t |
| Long int (at least 4 bytes). More... | |
| typedef zb_uint_t | zb_ulong_t |
| Unsigned long int (at least 4 bytes). More... | |
| typedef zb_uint8_t | zb_bool_t |
| General purpose boolean type. More... | |
| typedef zb_bitfield_t | zb_bitbool_t |
| Type to be used for boolean bit fields inside structure. More... | |
Address types and API | |
| typedef zb_uint8_t | zb_64bit_addr_t[8] |
| 8-bytes address (xpanid or long device address) base type. More... | |
| typedef zb_64bit_addr_t | zb_ieee_addr_t |
| Long (64-bit) device address. More... | |
| typedef zb_64bit_addr_t | zb_ext_pan_id_t |
| Long (64-bit) extended Pan ID. More... | |
| #define | ZB_IS_64BIT_ADDR_ZERO(addr) (ZB_MEMCMP((addr), (void const*)g_zero_addr, 8) == 0) |
| Checks that long address is a zero one. More... | |
| #define | ZB_64BIT_ADDR_ZERO(addr) ZB_MEMSET((addr), 0, 8) |
| Clears long address. More... | |
| #define | ZB_64BIT_ADDR_COPY(dst, src) ZB_MEMCPY(dst, src, sizeof(zb_64bit_addr_t)) |
| Copies long address. More... | |
| #define | ZB_64BIT_ADDR_CMP(one, two) (ZB_MEMCMP((one), (two), 8) == 0) |
| Checks if two long addresses are equal. More... | |
| #define ZB_CPP_STR | ( | x | ) | ZB_CPP_STR2(x) |
Creates a string at compile time, like 0 - "0".
| #define ZB_FALSE 0U |
False value literal.
Referenced by zb_mac_set_ieee_addr(), and zb_nwk_frame_prepare().
| #define ZB_TRUE 1U |
True value literal.
Referenced by zb_mac_set_ieee_addr(), and zb_nwk_frame_prepare().
| #define ZB_IS_64BIT_ADDR_ZERO | ( | addr | ) | (ZB_MEMCMP((addr), (void const*)g_zero_addr, 8) == 0) |
Checks that long address is a zero one.
| addr | Address to check |
| #define ZB_64BIT_ADDR_ZERO | ( | addr | ) | ZB_MEMSET((addr), 0, 8) |
Clears long address.
| addr | Address to clear |
| #define ZB_64BIT_ADDR_COPY | ( | dst, | |
| src | |||
| ) | ZB_MEMCPY(dst, src, sizeof(zb_64bit_addr_t)) |
Copies long address.
| dst | Destination address |
| src | Source address |
| #define ZB_64BIT_ADDR_CMP | ( | one, | |
| two | |||
| ) | (ZB_MEMCMP((one), (two), 8) == 0) |
Checks if two long addresses are equal.
| one | Address to be compared |
| two | Address to compare to |
| #define ZB_LETOH16 ZB_HTOLE16 |
Converts 16-bits integer from the little endian to the host endian.
| ptr | Destination pointer. It is ok if it not aligned to 2. |
| val | Source pointer. It is ok if it not aligned to 2. |
Referenced by zb_parse_mhr().
Project-local char type.
Project-local unsigned char type.
Project-local 1-byte unsigned int type.
Project-local 1-byte signed int type.
Project-local 2-byte unsigned int type.
Project-local 2-byte signed int type.
Project-local 4-byte unsigned int type.
Project-local 4-byte signed int type.
Type to be used for unsigned bit fields inside structure.
Type to be used for signed bit fields inside structure.
Project-local size_t type.
Short int (can fit into single CPU register).
Short unsigned int (can fit into single CPU register).
Int (at least 2 bytes).
Unsigned int (at least 2 bytes).
Long int (at least 4 bytes).
Unsigned long int (at least 4 bytes).
General purpose boolean type.
Boolean type can be ZB_TRUE or ZB_FALSE.
For C90, 'zb_bool_t' is an alias of 'zb_uint8_t'. For C99, the availability of the 'stdbool.h' standard header is expected and 'zb_bool_t' is an alias of 'bool'. ZB_FALSE and ZB_TRUE are defined as macros for both standards.
To ensure that zb_bool_t always has the same size of one byte, static compile time assertions were added. See 'zb_common.h'.
Type to be used for boolean bit fields inside structure.
| zb_64bit_addr_t |
8-bytes address (xpanid or long device address) base type.
Long (64-bit) device address.
Long (64-bit) extended Pan ID.
| enum zb_ret_e |
Error codes for non-void stack functions.
Typically, functions can return OK, BLOCKED or some error. Errors are represented as negative numbers.
Error can be either "generic" or an additional error code.
| enum zb_param_e |
General purpose parameter type.
| void* zb_put_next_htole16 | ( | zb_uint8_t * | dst, |
| zb_uint16_t | val | ||
| ) |
Puts next 2-bite value into buffer, moves pointer.
To be used for headers composing.
| dst | (in/out) address of the buffer pointer. As a side effect it will be incremented by 2. |
| val | Value |