aboutsummaryrefslogtreecommitdiff
path: root/src/device.rs
blob: ea732e6b72508089b2d6f07b95c96b617d95382f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()
}