Make apdu-dispatch build standalone and fix tests

This commit is contained in:
Conor Patrick
2020-10-09 16:20:12 +02:00
committed by Nicolas Stalder
parent efc9cc3964
commit 05baf18e1f
4 changed files with 6 additions and 11 deletions
+1 -2
View File
@@ -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"] }
+2 -2
View File
@@ -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<Bus>,
request_pipe: Requester<ApduInterchange>,
request_pipe: Requester<ContactInterchange>,
) -> Self {
let read = allocator.bulk(PACKET_SIZE as _);
let write = allocator.bulk(PACKET_SIZE as _);
+3 -3
View File
@@ -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<ApduInterchange>,
interchange: Requester<ContactInterchange>,
sent: usize,
outbox: Option<RawPacket>,
@@ -72,7 +72,7 @@ where
{
pub(crate) fn new(
write: EndpointIn<'static, Bus>,
request_pipe: Requester<ApduInterchange>,
request_pipe: Requester<ContactInterchange>,
) -> Self {
assert!(MAX_MSG_LENGTH >= PACKET_SIZE);
-4
View File
@@ -10,10 +10,6 @@ pub mod tlv;
pub type MessageBuffer = ByteBuf<MAX_MSG_LENGTH_TYPE>;
interchange::interchange! {
ApduInterchange: (iso7816::Command, iso7816::Response)
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum ClassRequest {
Abort = 1,