diff --git a/Cargo.toml b/Cargo.toml index b806705..01017b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,13 +10,12 @@ edition = "2018" asn1derpy = "0.1.0" heapless = "0.5.5" heapless-bytes = { git = "https://github.com/ycrypto/heapless-bytes", branch = "main" } -# heapless-bytes = { path = "../../../heapless-bytes" } interchange = { path = "../interchange" } logging = { package = "logging", path = "../logging",version = "0.1.0" } -# logging-ccid = { package = "logging", path = "../logging",version = "0.1.0" } +apdu-dispatch = { path = "../apdu-dispatch" } iso7816 = { path = "../iso7816" } untrusted = "0.7.1" usb-device = { version = "0.2.3", features = ["control-buffer-256"] } diff --git a/src/class.rs b/src/class.rs index 4befe8b..a817fd6 100644 --- a/src/class.rs +++ b/src/class.rs @@ -2,11 +2,11 @@ use core::convert::TryFrom; use crate::logger::{blocking}; use interchange::Requester; +use apdu_dispatch::types::ContactInterchange; use crate::{ constants::*, types::{ - ApduInterchange, ClassRequest, packet::RawPacket, }, @@ -32,7 +32,7 @@ where { pub fn new( allocator: &'static UsbBusAllocator, - request_pipe: Requester, + request_pipe: Requester, ) -> Self { let read = allocator.bulk(PACKET_SIZE as _); let write = allocator.bulk(PACKET_SIZE as _); diff --git a/src/pipe.rs b/src/pipe.rs index 984cb7f..c2f10a8 100644 --- a/src/pipe.rs +++ b/src/pipe.rs @@ -1,12 +1,12 @@ use core::convert::TryFrom; +use apdu_dispatch::types::ContactInterchange; use interchange::Requester; use crate::logger::{blocking}; use crate::{ constants::*, types::{ - ApduInterchange, MessageBuffer, packet::{ Chain, @@ -55,7 +55,7 @@ where state: State, // TODO: remove, use interchange message: MessageBuffer, - interchange: Requester, + interchange: Requester, sent: usize, outbox: Option, @@ -72,7 +72,7 @@ where { pub(crate) fn new( write: EndpointIn<'static, Bus>, - request_pipe: Requester, + request_pipe: Requester, ) -> Self { assert!(MAX_MSG_LENGTH >= PACKET_SIZE); diff --git a/src/types.rs b/src/types.rs index b27d837..6236dfa 100644 --- a/src/types.rs +++ b/src/types.rs @@ -10,10 +10,6 @@ pub mod tlv; pub type MessageBuffer = ByteBuf; -interchange::interchange! { - ApduInterchange: (iso7816::Command, iso7816::Response) -} - #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum ClassRequest { Abort = 1,