I've a function that can convert an hexadecimal string (ex. "02AFA1253...ecc.") into an uint8_t array. I would need to do the opposite, which is to convert the uint8_t array to a string of hexadecimal characters. How to do it? Here is the code of the function that converts hex string to uint8_t array: Thank you everybody for your help!
size_t convert_hex(uint8_t *dest, size_t count, const char *src) {
size_t i = 0;
int value;
for (i = 0; i < count && sscanf(src + i * 2, "%2x", &value) == 1; i++) {
dest[i] = value;
}
return i;
}
sprintf. Either will get you where you need to be.