Arduino + MFRC522 + Mifare Desfire

Hello;

We want to use Mifare Desfire cards on arduino with MFRC522 rf reader.

We are using RFID-DESFire library. GitHub - JPG-Consulting/rfid-desfire: Arduino RFID Library for MFRC522 for DESFire

and getting errors. How we can solve this problem?

Thank you.

In file included from C:\Users\flsft\Desktop\testrf\testrf.ino:32:0:

C:\Users\flsft\Documents\Arduino\libraries\rfid-desfire-master/Desfire.h: In constructor 'DESFire::DESFire(byte)':

C:\Users\flsft\Documents\Arduino\libraries\rfid-desfire-master/Desfire.h:132:70: error: no matching function for call to 'MFRC522::MFRC522(byte&)'

  explicit DESFire(byte resetPowerDownPin) : MFRC522(resetPowerDownPin) {};

                                                                      ^

C:\Users\flsft\Documents\Arduino\libraries\rfid-desfire-master/Desfire.h:132:70: note: candidates are:

In file included from C:\Users\flsft\Desktop\testrf\testrf.ino:31:0:

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:337:2: note: MFRC522::MFRC522()

  MFRC522() : MFRC522(UNUSED_PIN, UNUSED_PIN) {};

  ^

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:337:2: note:   candidate expects 0 arguments, 1 provided

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:333:2: note: MFRC522::MFRC522(byte, byte, SPIClass*, SPISettings)

  MFRC522(const byte chipSelectPin, const byte resetPowerDownPin,

  ^

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:333:2: note:   candidate expects 4 arguments, 1 provided

In file included from C:\Users\flsft\Desktop\testrf\testrf.ino:31:0:

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:139:7: note: constexpr MFRC522::MFRC522(const MFRC522&)

 class MFRC522 {

       ^

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:139:7: note:   no known conversion for argument 1 from 'byte {aka unsigned char}' to 'const MFRC522&'

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:139:7: note: constexpr MFRC522::MFRC522(MFRC522&&)

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:139:7: note:   no known conversion for argument 1 from 'byte {aka unsigned char}' to 'MFRC522&&'

In file included from C:\Users\flsft\Desktop\testrf\testrf.ino:32:0:

C:\Users\flsft\Documents\Arduino\libraries\rfid-desfire-master/Desfire.h: In member function 'virtual const __FlashStringHelper* DESFire::GetStatusCodeName(MFRC522::StatusCode)':

C:\Users\flsft\Documents\Arduino\libraries\rfid-desfire-master/Desfire.h:166:119: error: 'code' was not declared in this scope

  virtual const __FlashStringHelper *GetStatusCodeName(MFRC522::StatusCode status) { return MFRC522::GetStatusCodeName(code);  };

                                                                                                                       ^

exit status 1
Error compiling for board Arduino Nano.

How we can solve this problem?

With a text editor.

You forgot to post your code. You forgot to post links to the non-standard libraries you are using. So, you get to fix the issues by yourself.

Hello , we are using library example code.
Or when we open new empty ino file and include desfire.h, we are getting same errors. so code not important.

The code IS important.

The DESFire class derives from the MFRC522 class. The example code fails to compile for me because I do not have the same version of the MFRC522 library that the DESFire class needs. Apparently, you have the same problem.

There is a link on the DESFire page to a version of the MFRC522 library. Presumably, that is the required version for the DESFire example to compile and link.

Ok Paul i will test linked mfrc522 library. Thanks.

I downloaded linked library MFRC522 and tested but nothing changed. (Desfire library error.)
I think desfire library want special version of MFRC522 library.

my code

#include <MFRC522.h>
#include <Desfire.h>

void setup() {

}

void loop() {

}

ERROR
In file included from C:\Users\flsft\Desktop\testrf\testrf.ino:4:0:

C:\Users\flsft\Documents\Arduino\libraries\rfid-desfire-master/Desfire.h: In constructor 'DESFire::DESFire(byte)':

C:\Users\flsft\Documents\Arduino\libraries\rfid-desfire-master/Desfire.h:132:70: error: no matching function for call to 'MFRC522::MFRC522(byte&)'

explicit DESFire(byte resetPowerDownPin) : MFRC522(resetPowerDownPin) {};

^

C:\Users\flsft\Documents\Arduino\libraries\rfid-desfire-master/Desfire.h:132:70: note: candidates are:

In file included from C:\Users\flsft\Desktop\testrf\testrf.ino:3:0:

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:337:2: note: MFRC522::MFRC522()

MFRC522() : MFRC522(UNUSED_PIN, UNUSED_PIN) {};

^

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:337:2: note: candidate expects 0 arguments, 1 provided

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:333:2: note: MFRC522::MFRC522(byte, byte, SPIClass*, SPISettings)

MFRC522(const byte chipSelectPin, const byte resetPowerDownPin,

^

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:333:2: note: candidate expects 4 arguments, 1 provided

In file included from C:\Users\flsft\Desktop\testrf\testrf.ino:3:0:

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:139:7: note: constexpr MFRC522::MFRC522(const MFRC522&)

class MFRC522 {

^

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:139:7: note: no known conversion for argument 1 from 'byte {aka unsigned char}' to 'const MFRC522&'

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:139:7: note: constexpr MFRC522::MFRC522(MFRC522&&)

C:\Users\flsft\Documents\Arduino\libraries\rfid-master\src/MFRC522.h:139:7: note: no known conversion for argument 1 from 'byte {aka unsigned char}' to 'MFRC522&&'

You need to take this up directly with the author of that POS library. He/she does NOT create an instance of the MFRC522 properly.