From a1e081303dc7f7329e5452dad7e6cedf7efe3699 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 26 Feb 2018 15:37:13 +0100 Subject: Add to device's ID USB path. Convert ID to hex. Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index f2518b1..fa69ac6 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -113,6 +113,7 @@ using nitrokey::misc::strcpyT; } std::vector NitrokeyManager::list_devices_by_cpuID(){ + using misc::toHex; //disconnect default device disconnect(); @@ -139,9 +140,9 @@ using nitrokey::misc::strcpyT; std::string id; try { const auto status = get_status_storage(); - const auto sc_id = status.ActiveSmartCardID_u32; - const auto sd_id = status.ActiveSD_CardID_u32; - id = std::to_string(sc_id) + ":" + std::to_string(sd_id); + const auto sc_id = toHex(status.ActiveSmartCardID_u32); + const auto sd_id = toHex(status.ActiveSD_CardID_u32); + id = sc_id + ":" + sd_id + "_p_" + p; } catch (const LongOperationInProgressException &e) { LOGD1(std::string("Long operation in progress, setting ID to: ") + p); -- cgit v1.2.1