diff options
-rw-r--r-- | device.cc | 8 | ||||
-rw-r--r-- | libnitrokey/device.h | 13 |
2 files changed, 19 insertions, 2 deletions
@@ -38,6 +38,10 @@ using namespace nitrokey::device; using namespace nitrokey::log; using namespace std::chrono; +const uint16_t nitrokey::device::NITROKEY_VID = 0x20a0; +const uint16_t nitrokey::device::NITROKEY_PRO_PID = 0x4108; +const uint16_t nitrokey::device::NITROKEY_STORAGE_PID = 0x4109; + std::atomic_int Device::instances_count{0}; std::chrono::milliseconds Device::default_delay {0} ; @@ -246,14 +250,14 @@ void Device::set_retry_delay(const std::chrono::milliseconds delay){ } Stick10::Stick10(): - Device(0x20a0, 0x4108, DeviceModel::PRO, 100ms, 5, 100ms) + Device(NITROKEY_VID, NITROKEY_PRO_PID, DeviceModel::PRO, 100ms, 5, 100ms) { setDefaultDelay(); } Stick20::Stick20(): - Device(0x20a0, 0x4109, DeviceModel::STORAGE, 40ms, 55, 40ms) + Device(NITROKEY_VID, NITROKEY_STORAGE_PID, DeviceModel::STORAGE, 40ms, 55, 40ms) { setDefaultDelay(); } diff --git a/libnitrokey/device.h b/libnitrokey/device.h index 1a84402..477640f 100644 --- a/libnitrokey/device.h +++ b/libnitrokey/device.h @@ -51,6 +51,19 @@ enum class DeviceModel{ }; /** + * The USB vendor ID for Nitrokey devices. + */ +extern const uint16_t NITROKEY_VID; +/** + * The USB product ID for the Nitrokey Pro. + */ +extern const uint16_t NITROKEY_PRO_PID; +/** + * The USB product ID for the Nitrokey Storage. + */ +extern const uint16_t NITROKEY_STORAGE_PID; + +/** * Information about a connected device. * * This struct contains the information about a connected device returned by |