diff --git a/src/RFID.cpp b/src/RFID.cpp index 1c4eb2a..2b15851 100644 --- a/src/RFID.cpp +++ b/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; }