From b14d0ad2792d3f76ec21e141229840c736a2f23c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 12 Feb 2012 15:37:14 +0100 Subject: [PATCH] simtrace: Add print-out of PPS (Fi/Di change). simtrace firmware 4f7ca20bf40b911c035264d86ef0359d20e7ac88 and later includes an indication of PPS-induced Fi/Di changes. We now print the such indications to the user. --- host/main.c | 4 ++++ host/simtrace_usb.h | 1 + 2 files changed, 5 insertions(+) diff --git a/host/main.c b/host/main.c index 21d82ba..8ab7d2d 100644 --- a/host/main.c +++ b/host/main.c @@ -97,6 +97,10 @@ static int process_usb_msg(uint8_t *buf, int len) apdu_out_cb(payload, payload_len, NULL); break; } + if (sh->flags & SIMTRACE_FLAG_PPS_FIDI) { + printf("PPS(Fi=%u/Di=%u) ", + sh->res[0], sh->res[1]); + } /* everything else goes into APDU splitter */ apdu_split_in(as, payload, payload_len); #if 0 diff --git a/host/simtrace_usb.h b/host/simtrace_usb.h index c020093..b8b62d3 100644 --- a/host/simtrace_usb.h +++ b/host/simtrace_usb.h @@ -20,5 +20,6 @@ enum simtrace_usb_msgt { /* flags for MSGT_DATA */ #define SIMTRACE_FLAG_ATR 0x01 /* ATR immediately after reset */ #define SIMTRACE_FLAG_WTIME_EXP 0x04 /* work waiting time expired */ +#define SIMTRACE_FLAG_PPS_FIDI 0x08 /* Fi/Di values in res[2] */ #endif /* SIMTRACE_USB_H */