From 75bbfc7d9e3d0f26a507c494b1e94fe71fa26ad0 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 21 Mar 2016 08:46:27 +0100 Subject: fixed device status logging --- include/dissect.h | 4 ++-- include/stick10_commands.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/dissect.h b/include/dissect.h index f552950..993d348 100644 --- a/include/dissect.h +++ b/include/dissect.h @@ -63,12 +63,12 @@ class ResponseDissector : semantics::non_constructible { out << ::nitrokey::misc::hexdump((const char *)(&pod), sizeof pod); out << "Device status:\t" << pod.device_status + 0 << " " - << cmd[pod.device_status] << std::endl; + << status[pod.device_status] << std::endl; out << "Command ID:\t" << commandid_to_string((CommandID)(pod.command_id)) << std::endl; out << "Last command CRC:\t" << pod.last_command_crc << std::endl; out << "Last command status:\t" << pod.last_command_status + 0 << " " - << status[pod.last_command_status] << std::endl; + << cmd[pod.last_command_status] << std::endl; out << "CRC:\t" << pod.crc << std::endl; out << "Payload:" << std::endl; diff --git a/include/stick10_commands.h b/include/stick10_commands.h index 13aa24f..1c21eee 100644 --- a/include/stick10_commands.h +++ b/include/stick10_commands.h @@ -139,6 +139,11 @@ class GetHOTP : Command { uint8_t code[18]; bool isValid() const { return true; } + std::string dissect() const { + std::stringstream ss; + ss << "code:\t" << (code) << std::endl; + return ss.str(); + } } __packed; typedef Transaction -- cgit v1.2.1