mirror of
https://gitlab.com/fabinfra/fabhardware/fabreader.git
synced 2025-03-12 22:51:43 +01:00
Running NFC Transceive
This commit is contained in:
parent
2e9b11afc4
commit
23527a674a
@ -100,6 +100,11 @@ bool NFC::testCard()
|
||||
|
||||
MFRC522::StatusCode NFC::Transceive(byte* command, byte command_len, byte* response, byte* response_len)
|
||||
{
|
||||
if(command_len >= 0xFF - 4)
|
||||
{
|
||||
return MFRC522::STATUS_NO_ROOM;
|
||||
}
|
||||
|
||||
MFRC522::StatusCode state;
|
||||
byte request_buffer[APDU_BUFFER_SIZE + 4]; // APDU Size + PCB + CID + 2x CRC
|
||||
byte request_buffer_size = command_len + 4;
|
||||
@ -122,8 +127,8 @@ MFRC522::StatusCode NFC::Transceive(byte* command, byte command_len, byte* respo
|
||||
return state;
|
||||
}
|
||||
|
||||
byte response_buffer[APDU_BUFFER_SIZE + 4]; // APDU Size + PCB + CID + 2x CRC
|
||||
byte response_buffer_size;
|
||||
byte response_buffer[APDU_BUFFER_SIZE + 4] = {0}; // APDU Size + PCB + CID + 2x CRC
|
||||
byte response_buffer_size = 0xFF;
|
||||
|
||||
printbytes(request_buffer, request_buffer_size);
|
||||
state = rfid->PCD_TransceiveData(request_buffer, request_buffer_size, response_buffer, &response_buffer_size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user