aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NitrokeyManager.cc2
-rw-r--r--device.cc4
-rw-r--r--libnitrokey/device.h1
3 files changed, 6 insertions, 1 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index d874dca..71d156f 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -230,7 +230,7 @@ using nitrokey::misc::strcpyT;
misc::Option<DeviceModel> model;
while (info_ptr && !model.has_value()) {
if (path == std::string(info_ptr->path)) {
- model = product_id_to_model(vendor_id, info_ptr->product_id);
+ model = product_id_to_model(info_ptr->vendor_id, info_ptr->product_id);
}
info_ptr = info_ptr->next;
}
diff --git a/device.cc b/device.cc
index 5f89f2c..9cf4dc3 100644
--- a/device.cc
+++ b/device.cc
@@ -48,6 +48,10 @@ const uint16_t nitrokey::device::NITROKEY_STORAGE_PID = 0x4109;
const uint16_t nitrokey::device::PURISM_VID = 0x316d;
const uint16_t nitrokey::device::LIBREM_KEY_PID = 0x4c4b;
+Option<DeviceModel> nitrokey::device::product_id_to_model(uint16_t product_id) {
+ return product_id_to_model(NITROKEY_VID, product_id);
+}
+
Option<DeviceModel> nitrokey::device::product_id_to_model(uint16_t vendor_id, uint16_t product_id) {
switch (vendor_id) {
case NITROKEY_VID:
diff --git a/libnitrokey/device.h b/libnitrokey/device.h
index d39310a..917e0d0 100644
--- a/libnitrokey/device.h
+++ b/libnitrokey/device.h
@@ -81,6 +81,7 @@ extern const uint16_t LIBREM_KEY_PID;
* Convert the given USB product ID to a Nitrokey model. If there is no model
* with that ID, return an absent value.
*/
+misc::Option<DeviceModel> product_id_to_model(uint16_t product_id);
misc::Option<DeviceModel> product_id_to_model(uint16_t vendor_id, uint16_t product_id);
/**