I have char byte[0] = '1' (H'0x31)
and byte[1] = 'C'(H'0x43)
I am using one more buffer to more buff char hex_buff[0]
.i want to have hex content in this hex_buff[0] = 0x1C
(i.e combination of byte[0] and byte[1])
I was using below code but i realized that my code is valid for the hex values 0-9 only
char s_nibble1 = (byte[0]<< 4)& 0xf0;
char s_nibble2 = byte[1]& 0x0f;
hex_buff[0] = s_nibble1 | s_nibble2;
// here i want to have 0x1C
instead of 0x13