given the following string:
char *hexa_string= "ab010210000000000000000000000a0040890080006400950000920050050900300c3b811504a0ff2c8cf5e91740e466b219c2a3318ce80b66e1c43ba65ade66"
how can I convert it to buffer so that any cell in the buffer will be the value of any two digits from the above string ?
I tried to do something like that:
char *hexa_string= "ab010210000000000000000000000a0040890080006400950000920050050900300c3b811504a0ff2c8cf5e91740e466b219c2a3318ce80b66e1c43ba65ade66";
int hexa_string_size = strlen(hexa_string);
uint8_t hexa_buffer[64];
char *temp = hexa_string;
for(int i = 0; i < hexa_string_size; i++){
sscanf(temp, "%02hhx", &hexa_buffer[i]);
temp += 2;
}
but while I trying to printf the hexa_buffer
I see nothing..
I want to get the following buffer:
hexa_buffer[0] = 0xab
hexa_buffer[1] = 0x01
hexa_buffer[2] = 0x02
..