summaryrefslogtreecommitdiff
path: root/device.cc
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2019-01-13 12:03:53 +0100
committerRobin Krahl <me@robin-krahl.de>2019-01-13 12:03:53 +0100
commit6772dcf38e275b2ab9f962a87e86f89541c13a92 (patch)
tree9586d42ef6cd7b78f7f24851ec0801c4c0484c90 /device.cc
parent71d4ecc04c23342f207e7f1133ea8824a1dcdd16 (diff)
downloadlibnitrokey-6772dcf38e275b2ab9f962a87e86f89541c13a92.tar.gz
libnitrokey-6772dcf38e275b2ab9f962a87e86f89541c13a92.tar.bz2
Extract vendor and product IDs into constants
Diffstat (limited to 'device.cc')
-rw-r--r--device.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/device.cc b/device.cc
index 506a68c..74de0b3 100644
--- a/device.cc
+++ b/device.cc
@@ -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();
}