Closed arthurChennetier closed 5 years ago
Hi, you are welcome. I was planning to update the library but I didn't have much time.
I think it's because I didn't throw any errors for unsuccessful reading in that function. Instead, I put null string value. Did you try another card? You get ? because it's undefined error.
Please try another card and reply your findings. If there is a problem, I am gonna check it
Hi,
So I finally managed to make it work. This was due to a bad impementation from my side. Making a Connection before getting the UID fixed the problem .
public void onCardInserted()
{
Console.WriteLine("Inserted");
NFC.Connect();
Console.WriteLine(NFC.GetCardUID());
}
Sorry for the inconvenience.
I didn't provide and extensive guide and that's because these mistakes can occur. I will try to make it soon with some fixes and features. For now, I should give you an event usage example
public void Card_Inserted()
{
try
{
if (NFC.Connect())
{
//Do stuff...
}
else
{
//Give error message about connection...
}
}
catch (Exception ex)
{
//Give error message
}
}
public void Card_Ejected()
{
//Do stuff...
NFC.Disconnect();
}
Hey, first of all thanks you for your package, it will be really usefull for me.
I manage to make it work but I have only one problem wih getCardUID(). Actually it returns nothing when I use it. Perhaps I'm not using it like I should do ? Here is my code.
``
I tried to understand the nature of the error by using :
Console.WriteLine(Card.GetScardErrMsg(status));
This returned me the string : "?"