Compare commits
2 commits
5618f52a0e
...
d38b534bbe
Author | SHA1 | Date | |
---|---|---|---|
d38b534bbe | |||
c92c8ce11f |
1 changed files with 11 additions and 1 deletions
12
src/RFID.cpp
12
src/RFID.cpp
|
@ -100,6 +100,15 @@ bool RFID::programTag(Com::TagInfoRecord *tagToProgram) {
|
|||
Serial.println("Failed to program tag.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Programming succeeded, update the tracked ID of the tag.
|
||||
for (uidNode* node = activeTags; node; node = node->next) {
|
||||
// The protocol does not support UIDs other than 4 bytes, so assume it
|
||||
// is the case here directly.
|
||||
if ( *(uint32_t*)(node->uid.uidByte) == tagToProgram->uid)
|
||||
node->tag_ID = tagToProgram->figId;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -161,7 +170,8 @@ bool RFID::writeBlock(MFRC522Constants::Uid &uidToRead, byte blockAddr, uint8_t
|
|||
return false;
|
||||
}
|
||||
|
||||
byte size = sizeof(comData);
|
||||
// Take into account the two bytes used only for the read commands.
|
||||
byte size = sizeof(comData) - 2;
|
||||
for (byte& bufferByte: comData)
|
||||
bufferByte = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue