diff options
Diffstat (limited to 'src/device.rs')
-rw-r--r-- | src/device.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/device.rs b/src/device.rs index 9f3d1a7..830fa93 100644 --- a/src/device.rs +++ b/src/device.rs @@ -94,15 +94,15 @@ impl Response { } } -pub struct Nitrokey { - crc: Crc, +pub struct Nitrokey<C: Crc> { + crc: C, request: Option<Request>, request_crc: u32, buf: [u8; REPORT_LEN], } -impl Nitrokey { - pub fn new(crc: Crc) -> Self { +impl<C: Crc> Nitrokey<C> { + pub fn new(crc: C) -> Self { Nitrokey { crc, request: None, @@ -112,7 +112,7 @@ impl Nitrokey { } } -impl HidDevice for Nitrokey { +impl<C: Crc> HidDevice for Nitrokey<C> { fn subclass(&self) -> Subclass { Subclass::BootInterface } |