|
#define | ZB_STDC_90 |
|
#define | ZB_32BIT_WORD |
|
#define | ZB_XDATA |
|
#define | ZB_CODE |
|
#define | ZB_IAR_CODE |
|
#define | ZB_REGISTER register |
|
#define | ZB_VOID_ARGLIST void |
|
#define | ZB_CONST const |
|
#define | ZB_INLINE |
|
#define | ZB_BITFIELD_CAST(x) (x) |
|
#define | ZB_CPP_STR2(x) #x |
|
#define | ZB_CPP_STR(x) ZB_CPP_STR2(x) |
|
#define | ZB_INT8_MIN (-127 - 1) |
|
#define | ZB_INT8_MAX 127 |
|
#define | ZB_UINT8_MIN 0 |
|
#define | ZB_UINT8_MAX 255 |
|
#define | ZB_INT16_MIN (-32767 - 1) |
|
#define | ZB_INT16_MAX 32767 |
|
#define | ZB_UINT16_MIN 0 |
|
#define | ZB_UINT16_MAX 65535 |
|
#define | ZB_INT32_MIN (-2147483647L - 1) |
|
#define | ZB_INT32_MAX 2147483647L |
|
#define | ZB_UINT32_MIN 0UL |
|
#define | ZB_UINT32_MAX 4294967295UL |
|
#define | ZB_UINT_MIN 0UL |
|
#define | ZB_SHORT_MIN ZB_INT32_MIN |
|
#define | ZB_SHORT_MAX ZB_INT32_MAX |
|
#define | ZB_USHORT_MAX ZB_UINT32_MAX |
|
#define | ZB_INT_MIN ZB_INT32_MIN |
|
#define | ZB_INT_MAX ZB_INT32_MAX |
|
#define | ZB_UINT_MAX ZB_UINT32_MAX |
|
#define | ZB_INT_MASK 0x7fffffff |
|
#define | ZB_PACKED_STRUCT |
|
#define | ZB_PACKED_PRE |
|
#define | ZB_WEAK_PRE |
|
#define | ZB_WEAK |
|
#define | ZB_ALIGNED_PRE |
|
#define | ZB_IS_64BIT_ADDR_UNKNOWN(addr) (!ZB_MEMCMP((addr), (void const*)g_unknown_ieee_addr, 8)) |
|
#define | ZB_64BIT_ADDR_UNKNOWN(addr) ZB_MEMSET((addr), -1, 8) |
|
#define | ZB_EXTPANID_IS_ZERO ZB_IS_64BIT_ADDR_ZERO |
|
#define | ZB_EXTPANID_ZERO ZB_64BIT_ADDR_ZERO |
|
#define | ZB_EXTPANID_COPY ZB_64BIT_ADDR_COPY |
|
#define | ZB_EXTPANID_CMP ZB_64BIT_ADDR_CMP |
|
#define | ZB_IEEE_ADDR_IS_ZERO ZB_IS_64BIT_ADDR_ZERO |
|
#define | ZB_IEEE_ADDR_IS_UNKNOWN ZB_IS_64BIT_ADDR_UNKNOWN |
|
#define | ZB_IEEE_ADDR_ZERO ZB_64BIT_ADDR_ZERO |
|
#define | ZB_IEEE_ADDR_UNKNOWN ZB_64BIT_ADDR_UNKNOWN |
|
#define | ZB_IEEE_ADDR_COPY ZB_64BIT_ADDR_COPY |
|
#define | ZB_IEEE_ADDR_CMP ZB_64BIT_ADDR_CMP |
|
#define | ZB_CCM_KEY_IS_ZERO(k) (ZB_IS_64BIT_ADDR_ZERO((zb_uint8_t*)(k)) && ZB_IS_64BIT_ADDR_ZERO(((zb_uint8_t*)(k)) + 8)) |
|
#define | ZB_IEEE_ADDR_IS_VALID(addr) !(ZB_IEEE_ADDR_IS_ZERO(addr)||ZB_IEEE_ADDR_IS_UNKNOWN(addr)) |
|
#define | ZB_ADDR_CMP(addr_mode, addr1, addr2) |
|
#define | ZB_INT8_C(c) c |
|
#define | ZB_UINT8_C(c) c ## U |
|
#define | ZB_INT16_C(c) c |
|
#define | ZB_UINT16_C(c) c ## U |
|
#define | ZB_INT32_C(c) c ## L |
|
#define | ZB_UINT32_C(c) c ## UL |
|
#define | ZB_OFFSETOF(t, f) ((zb_size_t)(&((t *)0)->f)) |
|
#define | ZB_OFFSETOF_VAR(s, f) (zb_size_t)(((zb_int8_t *)(&(s)->f)) - ((zb_int8_t *)(s))) |
|
#define | ZB_SIZEOF_FIELD(type, field) (sizeof(((type*)0)->field)) |
|
#define | ZB_ARRAY_SIZE(arr) (sizeof((arr))/sizeof((arr)[0])) |
|
#define | ZB_SIGNED_SHIFT(v, s) ((zb_int_t)(v) >> (s)) |
|
#define | ZB_ASSERT_IF_NOT_ALIGNED(data_type, length) ZB_ASSERT_COMPILE_DECL(((sizeof(data_type) % (length)) == 0)); |
|
#define | ZB_ASSERT_IF_NOT_ALIGNED_TO_4(data_type) ZB_ASSERT_IF_NOT_ALIGNED(data_type,4) |
|
#define | ZB_ASSERT_VALUE_ALIGNED(const_expr, length) ZB_ASSERT_COMPILE_DECL((((const_expr) % (length)) == 0)); |
|
#define | ZB_ASSERT_VALUE_ALIGNED_TO_4(const_expr) ZB_ASSERT_VALUE_ALIGNED(const_expr, 4) |
|
#define | ZB_GET_LOW_BYTE(val) ((val) & 0xFF) |
|
#define | ZB_GET_HI_BYTE(val) (((val) >> 8) & 0xFF) |
|
#define | ZB_SET_LOW_BYTE(res, val) (res) = (((res) & 0xFF00) | ((val) & 0xFF)) |
|
#define | ZB_SET_HI_BYTE(res, val) (res) = ((((val) << 8) & 0xFF00) | ((res) & 0xFF)) |
|
#define | ZB_PKT_16B_ZERO_BYTE 0 |
|
#define | ZB_PKT_16B_FIRST_BYTE 1 |
|
#define | ZB_ASSIGN_UINT16(ptr, vp) *((zb_uint16_t*)(ptr)) = *(zb_uint16_t*)(vp) |
|
#define | ZB_ASSIGN_INT16(ptr, vp) *((zb_int16_t*)(ptr)) = *(zb_int16_t*)(vp) |
|
#define | ZB_COPY_UINT24(ptr, vp) *((zb_uint24_t*)(ptr)) = *(zb_uint24_t*)(vp) |
|
#define | ZB_COPY_INT24(ptr, vp) *((zb_int24_t*)(ptr)) = *(zb_int24_t*)(vp) |
|
#define | ZB_ASSIGN_UINT32(ptr, vp) *((zb_uint32_t*)(ptr)) = *(zb_uint32_t*)(vp) |
|
#define | ZB_ASSIGN_INT32(ptr, vp) *((zb_int32_t*)(ptr)) = *(zb_int32_t*)(vp) |
|
#define | ZB_REVERSE16(ptr, val) |
|
#define | ZB_REVERSE64(ptr, val) |
|
#define | ZB_ARRAY_IDX_BY_ELEM(ar, el) ((el) - (ar)) |
|
#define | ZB_ARRAY_IDX_BY_STRUCT_ELEM(ar, el, el_size) ( ((zb_size_t)(el) - (zb_size_t)(ar)) / (el_size) ) |
|
#define | MIN_SIGNED_24BIT_VAL ((zb_int32_t)0xFF800001) /* FIXME: which value to prefer? Because 0x800000 is reserved in ZCL */ |
|
#define | MAX_SIGNED_24BIT_VAL ((zb_int32_t)0x7FFFFF) |
|
#define | MIN_SIGNED_48BIT_VAL ((zb_int32_t)0xFFFF800000000001) |
|
#define | MAX_SIGNED_48BIT_VAL ((zb_int32_t)0x7FFFFFFFFFFF) |
|
#define | ZB_S64_FROM_S48(x) ((x & 0xFFFFFFFFFFFF) | ((x & 0x800000000000) ? 0xFFFF000000000000 : 0x0)) |
|
#define | ZB_S64_TO_S48(x) ((zb_int64_t)(x & 0xFFFFFFFFFFFF)) |
|
#define | ZB_S32_FROM_S24(x) ((x & 0xFFFFFF) | ((x & 0x800000) ? 0xFF000000 : 0x0)) |
|
#define | ZB_S32_TO_S24(x) ((zb_int32_t)(x & 0xFFFFFF)) |
|
#define | ZB_INIT_UINT48(high_val, low_val) (high_val) |
|
#define | ZB_ASSIGN_UINT48(high_val, low_val) (high_val) |
|
#define | ZB_UINT48_ADD(val1, val2) ((val1) + (val2)) |
|
#define | ZB_UINT48_SUB(val1, val2) ((val1) - (val2)) |
|
#define | ZB_UINT48_ADD_INT24(uint48_val, int24_val) ((zb_uint48_t)((uint48_val) + (int24_val))) |
|
#define | ZB_ASSIGN_INT24_FROM_INT32(int32_val) (int32_val) |
|
#define | ZB_GET_INT32_FROM_INT24(int24_val) (int24_val) |
|
#define | ZB_ASSIGN_UINT24_FROM_UINT32(uint32_val) (uint32_val) |
|
#define | ZB_GET_UINT32_FROM_UINT24(uint24_val) (uint24_val) |
|
#define | ZB_HTOLE24(ptr, val) ZB_HTOLE32((ptr), (val)) |
|
#define | ZB_HTOLE48(ptr, val) ZB_HTOLE32((ptr), (val)) |
|
#define | ZB_UINT48_IS_EQUAL(val1, val2) ((val1) == (val2)) |
|
#define | ZB_UINT48_IS_GREAT(val1, val2) ((val1) > (val2)) |
|
#define | ZB_UINT48_IS_LESS(val1, val2) ((val1) < (val2)) |
|
#define | ZB_UINT48_IS_GREAT_OR_EQUAL(val1, val2) (!ZB_UINT48_IS_LESS(val1, val2)) |
|
#define | ZB_UINT48_IS_LESS_OR_EQUAL(val1, val2) (!ZB_UINT48_IS_GREAT(val1, val2)) |
|
#define | PUT_DATA24(ptr, val) (ZB_HTOLE24(ptr, val), (ptr) += ZB_24BIT_SIZE) |
|
#define | PUT_DATA24_VAL(ptr, val) |
|
#define | PUT_DATA48(ptr, val) (ZB_HTOLE48(ptr, val), (ptr) += ZB_48BIT_SIZE) |
|
#define | PUT_DATA48_VAL(ptr, val) |
|
#define | ZB_UINT8_MSB_NIBBLE(X) (((X) >> 4) & 0x0F) |
|
#define | ZB_UINT8_LSB_NIBBLE(X) ((X) & 0x0F) |
|
#define | ZB_UINT4x2_TO_UINT8(MSB_N, LSB_N) ((MSB_N << 4) | ZB_UINT8_LSB_NIBBLE(LSB_N)) |
|
|
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) |
|
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) |
|
#define | ZB_8BIT_SIZE 1 |
|
#define | ZB_16BIT_SIZE 2 |
|
#define | ZB_24BIT_SIZE 3 |
|
#define | ZB_32BIT_SIZE 4 |
|
#define | ZB_48BIT_SIZE 6 |
|
#define | ZB_64BIT_SIZE 8 |
|
#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, 4) |
|
#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 |
|
#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 |
|