rc522 rfid apdu command

Hi all
I'm a novice who solves some trivial tasks. I sometimes find it difficult to understand the description in English.
My task is to send the apdu command to the smart card and get a response from the card using the rfid rc522 module.
As I understood for the sending of such commands, the function MFRC522::PCD_TransceiveData.
I was looking for a lot of examples of working with this function but I did not find any. Whether there is at whom any be the elementary example how to send a command a command for example here such kind A0 A4 00 00 02 3F 00.
Or if it's hard for you or laziness to write to me about this, then please give me a link to an manual where my question is described in detail so that I can figure it out myself.

any body can halp me?

why my code not work7777

#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN 9 // Configurable, see typical pin layout above
#define SS_PIN 10 // Configurable, see typical pin layout above
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
//*****************************************************************************************//

void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println(F(“Awaiting you Card…”)); //shows in serial that it is ready to read
}

//*****************************************************************************************//

void loop() {
// ждем новую карту
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}
byte sendData[255] = {0x00, 0xA4, 0x04, 0x00, 0x0e, 0x32, 0x50, 0x41, 0x59, 0x2e, 0x53, 0x59, 0x53, 0x2e, 0x44, 0x44, 0x46, 0x30, 0x31, 0x00};
byte sendLen = sizeof(sendData);
byte backData[255] = { 0 };
byte backLen = 255;
byte validBits = NULL;
byte rxAlign = 0;
bool checkCRC = false;
mfrc522.PCD_TransceiveData(sendData,sendLen,backData,backLen,validBits,rxAlign,checkCRC);
{
byte waitIRq = 0x30; // RxIRq and IdleIRq
return mfrc522.PCD_CommunicateWithPICC(mfrc522.PCD_Transceive, waitIRq, sendData, sendLen, backData, backLen, validBits, rxAlign, checkCRC);
if (mfrc522.StatusCode::STATUS_OK){
Serial.write(backData,sizeof(backData));
}
}
return;
}
//*****************************************************************************************//

Don't know. What's it supposed to do that it is not doing?

There are funny things:
You define a 255 byte array, but only put data in 20 bytes of it:
byte sendData[255] = {0x00, 0xA4, 0x04, 0x00, 0x0e, 0x32, 0x50, 0x41, 0x59, 0x2e, 0x53, 0x59, 0x53, 0x2e, 0x44, 0x44, 0x46, 0x30, 0x31, 0x00};

You define a 2nd 255 byte array but only put 1 byte in it:
byte backData[255] = { 0 };

You call out SPI.begin() but don't do any SPI.transfer()s. Maybe mfrc522 uses the interface for you.

CrossRoads:
You define a 255 byte array, but only put data in 20 bytes of it:
byte sendData[255] = {0x00, 0xA4, 0x04, 0x00, 0x0e, 0x32, 0x50, 0x41, 0x59, 0x2e, 0x53, 0x59, 0x53, 0x2e, 0x44, 0x44, 0x46, 0x30, 0x31, 0x00};

So what? All other elements of the array are zero.

CrossRoads:
You define a 2nd 255 byte array but only put 1 byte in it:
byte backData[255] = { 0 };

This is done so that all elements of the array are zero and do not contain any garbage

CrossRoads:
You call out SPI.begin() but don't do any SPI.transfer()s. Maybe mfrc522 uses the interface for you.

Here do not understand! I initialize the SPI data exchange protocol and work on it in the same way?

CrossRoads:
Don't know. What's it supposed to do that it is not doing?

The code should send an apdu command to the smart card, and receive a response from it to the serial port

But you as a moderator could understand this from the title of the topic))))

This is done so that all elements of the array are zero and do not contain any garbage

The real question, that you ignored, is why are the arrays so damned big.

bro Thank you very much I realized my mistake! Now I get a response from the map when the size of my array matches the bytes in the command! It turns out that for this purpose I need to use dynamic arrays if I do not know the size of my command in advance?

Dynamic array sizing has been discussed in the forum a lot, I don’t think you can change sizes in loop() (but I’m not really a programmer and could certainly be wrong). If you don’t know their size, I think you have to declare them as big as you might need at the start.

CrossRoads:
Dynamic array sizing has been discussed in the forum a lot, I don't think you can change sizes in loop() (but I'm not really a programmer and could certainly be wrong). If you don't know their size, I think you have to declare them as big as you might need at the start.

I did not read the card's answer, but the garbage contained in the array ((((my question is still open ... how to use the function mfrc522.PCD_TransceveData help please