-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PN532 binding does not work correctly when configured "AsTarget" #2029
Comments
I've finally found a bit of time and adjusted a bit the code, played with it. If you adjust it like this: (modeInitialized, retData) = pn532.InitAsTarget(
TargetModeInitialization.PiccOnly | TargetModeInitialization.PassiveOnly,
new TargetMifareParameters()
{
NfcId3 = new byte[] { 0x01, 0x02, 0x03 },
Atqa = new byte[] { 0x04, 0x00 },
Sak = 0x20
},
new TargetFeliCaParameters()
{
NfcId2 = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
Pad = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
SystemCode = new byte[] { 0x00, 0x00 }
},
new TargetPiccParameters()); You'll get it to work and you'll get the following answer:
In this case: So, it's about implementing properly the ISO7816 protocole or at least a minimum but all up, it does work as expected I may continue to look at this a bit. |
The physical device is a PN532 board from Elechouse similar to this one
The code used to test the device (with a Raspberry PI) is the one published at the binding page
The nuget packages in the test project are the following:
I made the tests using both the I2C and the RS232 connections. In both cases the communication breaks:
Log using the I2C
Log using the RS232
The logs have been instrumented with additional
Console.WriteLine
. This caused the slow to exhibit some delays and caused some improvements (the exception was visible after a while) but did not resolve the issue.I already discussed the issue with @Ellerbach (the original author) and made multiple tests with him to verify what was going on.
The text was updated successfully, but these errors were encountered: