From 2412961411cd823058b1a4c495a4f988d5649ed4 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 15 Jan 2020 12:47:40 +0100 Subject: [PATCH 1/3] only set new timeout if its faster :) --- armsrc/mifareutil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index cfd8f4b35d..e115e965f8 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -194,7 +194,8 @@ int mifare_classic_authex(struct Crypto1State *pcs, uint32_t uid, uint8_t blockN uint32_t save_timeout = iso14a_get_timeout(); // set timeout for authentication response - iso14a_set_timeout(106); + if (save_timeout > 106) + iso14a_set_timeout(106); // Receive 4 byte tag answer len = ReaderReceive(receivedAnswer, receivedAnswerPar); From 2de3a756cc56f881b6a09ba5eb0f639c061461f9 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 15 Jan 2020 13:07:51 +0100 Subject: [PATCH 2/3] chg: 'data samples' - colors --- client/cmddata.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/cmddata.c b/client/cmddata.c index ddd87fdb88..613ce11e50 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -1599,7 +1599,7 @@ int getSamples(uint32_t n, bool verbose) { if (n == 0 || n > sizeof(got)) n = sizeof(got); - if (verbose) PrintAndLogEx(NORMAL, "Reading %d bytes from device memory\n", n); + if (verbose) PrintAndLogEx(INFO, "Reading " _YELLOW_("%u") "bytes from device memory", n); PacketResponseNG response; if (!GetFromDevice(BIG_BUF, got, n, 0, NULL, 0, &response, 10000, true)) { @@ -1607,20 +1607,20 @@ int getSamples(uint32_t n, bool verbose) { return PM3_ETIMEOUT; } - if (verbose) PrintAndLogEx(NORMAL, "Data fetched"); + if (verbose) PrintAndLogEx(SUCCESS, "Data fetched"); uint8_t bits_per_sample = 8; //Old devices without this feature would send 0 at arg[0] if (response.oldarg[0] > 0) { sample_config *sc = (sample_config *) response.data.asBytes; - if (verbose) PrintAndLogEx(NORMAL, "Samples @ %d bits/smpl, decimation 1:%d ", sc->bits_per_sample, sc->decimation); + if (verbose) PrintAndLogEx(INFO, "Samples @ " _YELLOW_("%d") "bits/smpl, decimation 1:%d ", sc->bits_per_sample, sc->decimation); bits_per_sample = sc->bits_per_sample; } if (bits_per_sample < 8) { - if (verbose) PrintAndLogEx(NORMAL, "Unpacking..."); + if (verbose) PrintAndLogEx(INFO, "Unpacking..."); BitstreamOut bout = { got, bits_per_sample * n, 0}; int j = 0; @@ -1630,7 +1630,7 @@ int getSamples(uint32_t n, bool verbose) { } GraphTraceLen = j; - if (verbose) PrintAndLogEx(NORMAL, "Unpacked %d samples", j); + if (verbose) PrintAndLogEx(INFO, "Unpacked %d samples", j); } else { for (int j = 0; j < n; j++) { From 33033612bcc311fe9780381ff3794f136382e89c Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 15 Jan 2020 15:03:35 +0100 Subject: [PATCH 3/3] Fix delay in acquisition and DoAcquisition_config usage. Fixes #524 --- armsrc/lfops.c | 2 +- armsrc/lfsampling.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/armsrc/lfops.c b/armsrc/lfops.c index ed23e75ea2..1cb8406bf4 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -2550,7 +2550,7 @@ void Cotag(uint32_t arg0) { doCotagAcquisitionManchester(); break; case 2: - DoAcquisition_config(true, true); + DoAcquisition_config(false, 0); break; } diff --git a/armsrc/lfsampling.c b/armsrc/lfsampling.c index 3378a9f94d..5808fff070 100644 --- a/armsrc/lfsampling.c +++ b/armsrc/lfsampling.c @@ -115,7 +115,8 @@ void initSampleBuffer(uint32_t *sample_size) { // use a bitstream to handle the output data.buffer = BigBuf_get_addr(); - memset(data.buffer, 0, *sample_size); +// We can't erase the buffer now, it would drastically delay the acquisition +// memset(data.buffer, 0, *sample_size); // samples.dec_counter = 0;