I am doing socket communication using bluetooth in which I am getting hex values as a variables in string format.
I can write -
char char1= 0x7D;
But somehow if value 0x7D
is string then how to convert that to char.
For example, I can't do -
String string1 = "0x7D";
char char1 = (char)string1;
Any approach to do that ?
I want this because I can write to socket with -
char[] uploadCommand2 = {0x7d, 0x4d, 0x01, 0x00, 0x01, 0xcb};
But can't if 0x7d
is a string like --
char[] uploadCommand2 = {string1, 0x4d, 0x01, 0x00, 0x01, 0xcb};