K KMurphy Golden Member May 16, 2000 1,014 0 0 Dec 29, 2000 #1 I need to know if there is a function or class that can display data packets taken from a serial port in hexadecimal. Currently, all my data is coming out ASCII and I can't re-convert to hex. The data must be initially output in hex.
I need to know if there is a function or class that can display data packets taken from a serial port in hexadecimal. Currently, all my data is coming out ASCII and I can't re-convert to hex. The data must be initially output in hex.
P PowerJoe Senior member Oct 9, 1999 887 0 0 Dec 30, 2000 #2 Converting ASCII to hex is not that difficult: char HexDigits[]="0123456789ABCDEF"; void PrintHex(char x) { printf("%c%c", HexDigits[x >> 4], HexDigits[x & 0x0F]); } -PJ
Converting ASCII to hex is not that difficult: char HexDigits[]="0123456789ABCDEF"; void PrintHex(char x) { printf("%c%c", HexDigits[x >> 4], HexDigits[x & 0x0F]); } -PJ