PN5180 ListenToCardIso14443TypeA hangup
See original GitHub issueDon’t know if this is the place to post problems with device bindings. Please let me know if it should be posted somewhere else.
PN5180 ListenToCardIso14443TypeA hangup I am looking into the device binding with the PN5180 to read and write some Mifare 1k classic cards. I noticed that when a Mifare classic card is put in and out of the field the PN5180 stops working and the Busy line of the PN5180 stays high.
Steps to reproduce Call the ListenToCardIso14443TypeA in a loop and hold a Mifare classic 1k card with a UID4 in front of the reader and away again. Repeat this until the hang-up occurs.
Possible fix at line 1036 in Pn5180.cs the anticollision is done.
for (int i = 0; i < 3; i++)
{
// Select SL1
uidSak[0] = (byte)(0x93 + i * 2);
// NVB = Number of valid bits
uidSak[1] = 0x20;
SendDataToCard(uidSak.Slice(0, 2));
// Read 5 bytes sak. Byte 1 will tell us if we have the full UID or if we need to read more
ReadDataFromCard(sakInterm.Slice(0, 5));
To prevent the hang-up a check if 5 bytes are received would be enough.
for (int i = 0; i < 3; i++)
{
// Select SL1
uidSak[0] = (byte)(0x93 + i * 2);
// NVB = Number of valid bits
uidSak[1] = 0x20;
SendDataToCard(uidSak.Slice(0, 2));
(numBytes, _) = GetNumberOfBytesReceivedAndValidBits();
if (numBytes != 5)
{
return false; //this will prevent a hangup
}
// Read 5 bytes sak. Byte 1 will tell us if we have the full UID or if we need to read more
ReadDataFromCard(sakInterm.Slice(0, 5));
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
PN5180 | NFC IC for POS Solutions
The PN5180 is a high-performance full NFC Forum-compliant frontend IC for various contactless communication methods and protocols.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Ellerbach I am using a copy of the binding and renamed the namesspace. This made it possible for me to experiment and check the behavior in the original version and the local version. I have used it now for a while and have not yett noticed any hangs anymore, while reading mifare classic 1k cards or connecting to my phone. So I am very pleased with the available binding. 😃
@arnoud-koolecontrols is this issue already fixed by your PR? Please close it if so… (note: you can put something like
Fixes #1139
in first line of PR description, that will auto-close the issue when PR is merged)