Hi,
This is more of a bug report than a question, but not sure how to get in touch with engineers outside the forum.
In app_util.h (Using SDK 12.3.0) there are two functions for encoding a uint32_t to a byte array:
static __INLINE uint8_t uint32_encode(uint32_t value, uint8_t * p_encoded_data) { p_encoded_data[0] = (uint8_t) ((value & 0x000000FF) >> 0); p_encoded_data[1] = (uint8_t) ((value & 0x0000FF00) >> 8); p_encoded_data[2] = (uint8_t) ((value & 0x00FF0000) >> 16); p_encoded_data[3] = (uint8_t) ((value & 0xFF000000) >> 24); return sizeof(uint32_t); } static __INLINE uint8_t uint32_big_encode(uint32_t value, uint8_t * p_encoded_data) { *(uint32_t *)p_encoded_data = __REV(value); return sizeof(uint32_t); }
static __INLINE uint8_t uint32_big_encode(uint32_t value, uint8_t * p_encoded_data) { p_encoded_data[3] = (uint8_t) ((value & 0x000000FF) >> 0); p_encoded_data[2] = (uint8_t) ((value & 0x0000FF00) >> 8); p_encoded_data[1] = (uint8_t) ((value & 0x00FF0000) >> 16); p_encoded_data[0] = (uint8_t) ((value & 0xFF000000) >> 24); return sizeof(uint32_t); }