Skip to content
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

No Errors will Not Read or Right #15

Open
247comfort opened this issue Mar 26, 2021 · 4 comments
Open

No Errors will Not Read or Right #15

247comfort opened this issue Mar 26, 2021 · 4 comments

Comments

@247comfort
Copy link

Hi,
The library connects fine no issues.
But it will not read or write. When i read i get "0"

var t = NFC.ReadBlock("0");

i am using the ACR122

Thank You
Gary

@h4kbas
Copy link
Owner

h4kbas commented May 29, 2021

Please state your OS version and similar specs to clarify the issue. Also, did you try to start your app in administrator mode?

@Acpek23
Copy link

Acpek23 commented Nov 30, 2021

Hey man this library is great, but I'm having issues reading the blocks this I'm getting a byte like this:
byte[2]
[0]99
[1]0
my conversion from byte to sting is: "c\0"
My os is windows 10, I'm forcing the application to run as admin and this is the NFC model acr1255u-j1
any suggestios why I'm getting only that?
this is my code:
public void read_sector(string sector)
{

        NFCReader NFC = new NFCReader();
        try
        {
            if (NFC.Connect())
            {
                //Autorizamos el sector
              Boolean autorizacion =  NFC.AuthBlock(sector); //returns boolean

                //Leemos el sector
                byte[] resultadodelsector = NFC.ReadBlock(sector);
                            
               
                string result2 = BytesToStringConverted(resultadodelsector);
                //string resultadodelsector = Encoding.UTF8.GetString(NFC.ReadBlock(sector));
                 Console.WriteLine(result2);
            }
            else {

                MessageBox.Show("Falle al realizar la conexion");
            }
        }
        catch (Exception e)
        {

            MessageBox.Show("Falle al leer el sector 2: "+ e.Message.ToString());
        }


    }

@h4kbas
Copy link
Owner

h4kbas commented Nov 30, 2021

99 00 means OK in NFC language

@Acpek23
Copy link

Acpek23 commented Nov 30, 2021

thanks for the response but I'm still not getting any text from the block I checked the manual documentation:
https://www.manualslib.com/manual/1436214/Acs-Acr1255u-J1.html?page=55#manual
6.5.3 and I try to adjust the code to this specifications changing the CLA, INS,P1 and LE
Debugging the application the authorization looks good I get a 90h 00h response that looks on this documentation that is okay
https://www.manualslib.com/manual/1436214/Acs-Acr1255u-J1.html?page=58#manual
but when I try to read I get the 63h 00h code that looks meaning the operation is failed.
I get that info from SendAPDUandDisplay method.
Any suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants