From 68e50c9712c07c17ba6058ae28444ed3cddfa4b0 Mon Sep 17 00:00:00 2001 From: Fady Anwar Date: Thu, 9 Jun 2022 17:38:40 +0100 Subject: [PATCH] Fixing an inverted timeout condition (#1871) Card reading timeout should happen when dtTimeout < DateTime.Now not the other way around, otherwise ListenToCardIso14443TypeA(out Data106kbpsTypeA card, TimeSpan timeout) will always return false. i.e. since dtTimeout is in the future it will be always greater than DateTime.Now --- src/devices/Mfrc522/Mfrc522.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/Mfrc522/Mfrc522.cs b/src/devices/Mfrc522/Mfrc522.cs index 0e3642c9f0..23b48f0316 100644 --- a/src/devices/Mfrc522/Mfrc522.cs +++ b/src/devices/Mfrc522/Mfrc522.cs @@ -254,7 +254,7 @@ public bool ListenToCardIso14443TypeA(out Data106kbpsTypeA card, TimeSpan timeou break; } - if (dtTimeout > DateTime.Now) + if (dtTimeout < DateTime.Now) { return false; }