diff --git a/src/btstack_util.c b/src/btstack_util.c index 0ff1e7327..c93430739 100644 --- a/src/btstack_util.c +++ b/src/btstack_util.c @@ -104,6 +104,12 @@ void big_endian_store_16(uint8_t *buffer, uint16_t pos, uint16_t value){ buffer[pos++] = value; } +void big_endian_store_24(uint8_t *buffer, uint16_t pos, uint32_t value){ + buffer[pos++] = value >> 16; + buffer[pos++] = value >> 8; + buffer[pos++] = value; +} + void big_endian_store_32(uint8_t *buffer, uint16_t pos, uint32_t value){ buffer[pos++] = value >> 24; buffer[pos++] = value >> 16; diff --git a/src/btstack_util.h b/src/btstack_util.h index 89fd72717..cf1eeb641 100644 --- a/src/btstack_util.h +++ b/src/btstack_util.h @@ -126,6 +126,7 @@ uint32_t big_endian_read_32( const uint8_t * buffer, int pos); * @param value */ void big_endian_store_16(uint8_t *buffer, uint16_t pos, uint16_t value); +void big_endian_store_24(uint8_t *buffer, uint16_t pos, uint32_t value); void big_endian_store_32(uint8_t *buffer, uint16_t pos, uint32_t value);