diff options
| author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-07-20 12:25:19 +0200 | 
|---|---|---|
| committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-01 13:54:56 +0200 | 
| commit | 02a46831a552d443adfbd3c61542cf6925675349 (patch) | |
| tree | a676a2f3efca58417f8ddf04271973995211a504 | |
| parent | 58b36d43ebdef29399e76d82313ede89c2a838fd (diff) | |
| download | libnitrokey-02a46831a552d443adfbd3c61542cf6925675349.tar.gz libnitrokey-02a46831a552d443adfbd3c61542cf6925675349.tar.bz2 | |
Show CRC in hex
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
| -rw-r--r-- | include/dissect.h | 13 | 
1 files 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(); | 
