fnDebugHex()

void fnDebugHex(unsigned long ulValue, unsigned char uLen);

ulValue is an unsigned long value to be sent as an ASCII HEX string to the present debug output.
The conversion style is defined by uLen, which can be a mixture of following flags:
The length of the hexadecimal input is also included in the ucStyle parameter, with valid values of 1, 2 or 4 (the number of bytes in the value).

Examples

Example of displaying a MAC address in formatted hex at the debug output

// Convert a MAC address to a string
//
extern void fnMACStr(unsigned char *ptrMAC)
{
    int i = MAC_LENGTH;

    while (--i) {
        fnDebugHex(*ptrMAC++, (unsigned char)(1 | NO_LEADIN | NO_TERMINATOR));
        fnDebugMsg('-');
    }
    fnDebugHex(*ptrMAC++, (unsigned char)(1 | NO_LEADIN | WITH_TERMINATOR));
}

Related functions

fnDebugDec();
fnBufferHex();
fnHexStrHex();
fnDecStrHex();




Please use the µTasker forum to ask specific questions.