aboutsummaryrefslogtreecommitdiff
path: root/include/dissect.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-05-13 15:54:00 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-05-13 15:54:00 +0200
commit06c0deb7935a9390a67bc02d6c323e64c785a026 (patch)
treec8343c0e1d504b2ae7d1ff5a727084f78a015f7e /include/dissect.h
parentbe0d677aa2e7eb87a309dc3927c0917380892641 (diff)
parent3b5f40a19ca6c6fde55fcdab4ff0a9f91a46a051 (diff)
downloadlibnitrokey-06c0deb7935a9390a67bc02d6c323e64c785a026.tar.gz
libnitrokey-06c0deb7935a9390a67bc02d6c323e64c785a026.tar.bz2
Merge branch 'do_not_log_volatile_data'
Diffstat (limited to 'include/dissect.h')
-rw-r--r--include/dissect.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/dissect.h b/include/dissect.h
index 8992c56..69a5129 100644
--- a/include/dissect.h
+++ b/include/dissect.h
@@ -20,8 +20,10 @@ class QueryDissector : semantics::non_constructible {
static std::string dissect(const HIDPacket &pod) {
std::stringstream out;
+#ifdef LOG_VOLATILE_DATA
out << "Raw HID packet:" << std::endl;
out << ::nitrokey::misc::hexdump((const char *)(&pod), sizeof pod);
+#endif
out << "Contents:" << std::endl;
out << "Command ID:\t" << commandid_to_string((CommandID)(pod.command_id))
@@ -83,8 +85,10 @@ class ResponseDissector : semantics::non_constructible {
// FIXME use values from firmware (possibly generate separate
// header automatically)
+#ifdef LOG_VOLATILE_DATA
out << "Raw HID packet:" << std::endl;
out << ::nitrokey::misc::hexdump((const char *)(&pod), sizeof pod);
+#endif
out << "Device status:\t" << pod.device_status + 0 << " "
<< status_translate_device(pod.device_status) << std::endl;