1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/fmt: add print_bytes_hex()

This commit is contained in:
Benjamin Valentin 2022-11-11 13:54:59 +01:00 committed by Benjamin Valentin
parent e710b6f07c
commit 95e654f232
2 changed files with 17 additions and 0 deletions

View File

@ -550,6 +550,15 @@ void print_byte_hex(uint8_t byte)
print(buf, sizeof(buf));
}
void print_bytes_hex(const void *bytes, size_t num)
{
const uint8_t *b = bytes;
while (num--) {
print_byte_hex(*b++);
}
}
void print_u32_hex(uint32_t val)
{
char buf[8];

View File

@ -450,6 +450,14 @@ void print_s32_dec(int32_t val);
*/
void print_byte_hex(uint8_t byte);
/**
* @brief Print bytes as hex to stdout
*
* @param[in] bytes Byte array to print
* @param[in] n Number of bytes to print
*/
void print_bytes_hex(const void *bytes, size_t n);
/**
* @brief Print uint32 value as hex to stdout
*