From 02a46831a552d443adfbd3c61542cf6925675349 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Wed, 20 Jul 2016 12:25:19 +0200 Subject: Show CRC in hex Signed-off-by: Szczepan Zalega --- include/dissect.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/dissect.h b/include/dissect.h index ab94e62..c83e648 100644 --- a/include/dissect.h +++ b/include/dissect.h @@ -26,9 +26,11 @@ class QueryDissector : semantics::non_constructible { out << "Contents:" << std::endl; out << "Command ID:\t" << commandid_to_string((CommandID)(pod.command_id)) << std::endl; - out << "CRC:\t" << pod.crc << std::endl; + out << "CRC:\t" + << std::hex << std::setw(2) << std::setfill('0') + << pod.crc << std::endl; - out << "Payload:" << std::endl; + out << "Payload:" << std::endl; out << pod.payload.dissect(); return out.str(); } @@ -67,11 +69,14 @@ class ResponseDissector : semantics::non_constructible { << status[pod.device_status] << std::endl; out << "Command ID:\t" << commandid_to_string((CommandID)(pod.command_id)) << std::endl; - out << "Last command CRC:\t" << std::hex << std::setw(2) << std::setfill('0') + out << "Last command CRC:\t" + << std::hex << std::setw(2) << std::setfill('0') << pod.last_command_crc << std::endl; out << "Last command status:\t" << pod.last_command_status + 0 << " " << cmd[pod.last_command_status] << std::endl; - out << "CRC:\t" << pod.crc << std::endl; + out << "CRC:\t" + << std::hex << std::setw(2) << std::setfill('0') + << pod.crc << std::endl; out << "Payload:" << std::endl; out << pod.payload.dissect(); -- cgit v1.2.1