aboutsummaryrefslogtreecommitdiff
path: root/include/stick10_commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/stick10_commands.h')
-rw-r--r--include/stick10_commands.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/stick10_commands.h b/include/stick10_commands.h
index d923d93..c8eda03 100644
--- a/include/stick10_commands.h
+++ b/include/stick10_commands.h
@@ -340,12 +340,28 @@ class GetUserPasswordRetryCount
CommandTransaction;
};
+ template <typename T, typename Q, int N>
+ void write_array(T &ss, Q (&arr)[N]){
+ ss << std::hex << std::setfill('0') << std::setw(2);
+ for (int i=0; i<N; i++){
+ ss << arr[i] << " ";
+ }
+ ss << std::endl;
+ };
+
+
class GetPasswordSafeSlotStatus : Command<CommandID::GET_PW_SAFE_SLOT_STATUS> {
public:
struct ResponsePayload {
uint8_t password_safe_status[PWS_SLOT_COUNT];
bool isValid() const { return true; }
+ std::string dissect() const {
+ std::stringstream ss;
+ ss << "password_safe_status\t";
+ write_array(ss, password_safe_status);
+ return ss.str();
+ }
} __packed;
typedef Transaction<command_id(), struct EmptyPayload, struct ResponsePayload>