RFID: Track ID changes
We keep track of the detected tag UUIDs and their figurine ID, but we don't update it when a programming request succeeds. Search through the tracked tags for the programmed UUID and update the stored ID when the change suceeds.
This commit is contained in:
parent
c92c8ce11f
commit
d38b534bbe
1 changed files with 9 additions and 0 deletions
|
@ -100,6 +100,15 @@ bool RFID::programTag(Com::TagInfoRecord *tagToProgram) {
|
||||||
Serial.println("Failed to program tag.");
|
Serial.println("Failed to program tag.");
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue