diff --git a/src/class.rs b/src/class.rs index bb49670..93c9f52 100644 --- a/src/class.rs +++ b/src/class.rs @@ -13,19 +13,19 @@ use crate::{ use usb_device::class_prelude::*; type Result = core::result::Result; -pub struct Ccid +pub struct Ccid<'bus, Bus, I, const N: usize> where Bus: 'static + UsbBus, I: 'static + Interchange, RESPONSE = Vec>, { interface_number: InterfaceNumber, string_index: StringIndex, - read: EndpointOut<'static, Bus>, + read: EndpointOut<'bus, Bus>, // interrupt: EndpointIn<'static, Bus>, - pipe: Pipe, + pipe: Pipe<'bus, Bus, I, N>, } -impl Ccid +impl<'bus, Bus, I, const N: usize> Ccid<'bus, Bus, I, N> where Bus: 'static + UsbBus, I: 'static + Interchange, RESPONSE = Vec>, @@ -36,7 +36,7 @@ where /// and allows personalizing the Answer-to-Reset, for instance by /// ASCII-encoding vendor or model information. pub fn new( - allocator: &'static UsbBusAllocator, + allocator: &'bus UsbBusAllocator, request_pipe: Requester, card_issuers_data: Option<&[u8]>, ) -> Self { @@ -84,7 +84,7 @@ where } } -impl UsbClass for Ccid +impl<'bus, Bus, I, const N: usize> UsbClass for Ccid<'bus, Bus, I, N> where Bus: 'static + UsbBus, I: 'static + Interchange, RESPONSE = Vec>, diff --git a/src/pipe.rs b/src/pipe.rs index 5758df6..e8ec914 100644 --- a/src/pipe.rs +++ b/src/pipe.rs @@ -35,12 +35,12 @@ enum Error { CommandNotSupported = 0x00, } -pub struct Pipe +pub struct Pipe<'bus, Bus, I, const N: usize> where Bus: 'static + UsbBus, I: 'static + Interchange, RESPONSE = Vec>, { - pub(crate) write: EndpointIn<'static, Bus>, + pub(crate) write: EndpointIn<'bus, Bus>, // pub(crate) rpc: TransportEndpoint<'rpc>, seq: u8, state: State, @@ -58,13 +58,13 @@ where atr: Vec, } -impl Pipe +impl<'bus, Bus, I, const N: usize> Pipe<'bus, Bus, I, N> where Bus: 'static + UsbBus, I: 'static + Interchange, RESPONSE = Vec>, { pub(crate) fn new( - write: EndpointIn<'static, Bus>, + write: EndpointIn<'bus, Bus>, request_pipe: Requester, card_issuers_data: Option<&[u8]>, ) -> Self { @@ -128,7 +128,7 @@ where } } -impl Pipe +impl<'bus, Bus, I, const N: usize> Pipe<'bus, Bus, I, N> where Bus: 'static + UsbBus, I: 'static + Interchange, RESPONSE = Vec>,