Skip to content

Commit

Permalink
Fixing an inverted timeout condition (#1871)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fadyanwar committed Jun 9, 2022
1 parent 324577f commit 68e50c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/devices/Mfrc522/Mfrc522.cs
Expand Up @@ -254,7 +254,7 @@ public bool ListenToCardIso14443TypeA(out Data106kbpsTypeA card, TimeSpan timeou
break;
}

if (dtTimeout > DateTime.Now)
if (dtTimeout < DateTime.Now)
{
return false;
}
Expand Down

0 comments on commit 68e50c9

Please sign in to comment.