aboutsummaryrefslogtreecommitdiff
path: root/include/dissect.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-10-14 13:49:24 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-10-19 16:34:11 +0200
commite235664cdac283d2dd08059f09cc0ac141146fe8 (patch)
treeb90a0e610050035d8f88efce490a7dc21afc8317 /include/dissect.h
parentfe62a51c052dfa13b91b760188cd57e73971ddbf (diff)
downloadlibnitrokey-e235664cdac283d2dd08059f09cc0ac141146fe8.tar.gz
libnitrokey-e235664cdac283d2dd08059f09cc0ac141146fe8.tar.bz2
Show NK Storage status on response packet dissection (regardless of connected device)
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include/dissect.h')
-rw-r--r--include/dissect.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/dissect.h b/include/dissect.h
index c83e648..56c1403 100644
--- a/include/dissect.h
+++ b/include/dissect.h
@@ -67,7 +67,7 @@ class ResponseDissector : semantics::non_constructible {
out << "Device status:\t" << pod.device_status + 0 << " "
<< status[pod.device_status] << std::endl;
- out << "Command ID:\t" << commandid_to_string((CommandID)(pod.command_id))
+ out << "Command ID:\t" << commandid_to_string((CommandID)(pod.command_id)) << " hex: " << std::hex << (int)pod.command_id
<< std::endl;
out << "Last command CRC:\t"
<< std::hex << std::setw(2) << std::setfill('0')
@@ -77,6 +77,14 @@ class ResponseDissector : semantics::non_constructible {
out << "CRC:\t"
<< std::hex << std::setw(2) << std::setfill('0')
<< pod.crc << std::endl;
+ out << "Storage stick status:" << std::endl;
+#define d(x) out << " "#x": \t"<< std::hex << std::setw(2) \
+ << std::setfill('0')<< static_cast<int>(x) << std::endl;
+ d(pod.StorageStatus.CommandCounter_u8);
+ d(pod.StorageStatus.LastCommand_u8);
+ d(pod.StorageStatus.Status_u8);
+ d(pod.StorageStatus.ProgressBarValue_u8);
+#undef d
out << "Payload:" << std::endl;
out << pod.payload.dissect();