aboutsummaryrefslogtreecommitdiff
path: root/src/device.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/device.rs')
-rw-r--r--src/device.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/device.rs b/src/device.rs
new file mode 100644
index 0000000..ea732e6
--- /dev/null
+++ b/src/device.rs
@@ -0,0 +1,16 @@
+// Copyright 2019 Robin Krahl <robin.krahl@ireas.org>
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+use usb_device::bus::{UsbBus, UsbBusAllocator};
+use usb_device::device::{UsbDevice, UsbDeviceBuilder, UsbVidPid};
+
+const VID_CLAY_LOGIC: u16 = 0x20a0;
+const PID_NITROKEY_PRO: u16 = 0x4108;
+
+pub fn create_usb_device<B: UsbBus>(alloc: &UsbBusAllocator<B>) -> UsbDevice<'_, B> {
+ UsbDeviceBuilder::new(alloc, UsbVidPid(VID_CLAY_LOGIC, PID_NITROKEY_PRO))
+ .manufacturer("Nitrokey/ntw")
+ .product("Nitrokey Pro/ntw")
+ .serial_number("?")
+ .build()
+}