/// Debug dump bytes in hexadecimal format 16-bytes per row /// /// \param source /// \param length /// /// Example Output: /// \code /// 0000 bd 7a 32 13 08 1c 1e d9 - c9 48 48 0b 5f 23 1a f5 /// 0010 72 3d 8f 7a e6 2c 07 e4 - 6e 45 79 0f cb 18 13 6f /// \endcode void debugDumpHexBytes(const char* source, int length) { qDebug("------------------------"); int offset = 0; int row = 0; QString line; while(length > offset ) { line = QString::asprintf("%04x ", offset); for(int i = 0; i < 16; ++i) { if(8 == i) { line.append(" - "); } uint8_t value = source[offset++]; line.append(QString::asprintf("%02x ", value)); if(length == offset) { break; } } qDebug("%s", qPrintable(line)); ++row; } qDebug("........................"); }