1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 06:38:17 +00:00

Add first page to clean_tag

This commit is contained in:
Spencer Owen 2024-12-09 22:08:09 -07:00
parent 59004bf569
commit 422e699aa6
No known key found for this signature in database

View File

@ -494,7 +494,13 @@ void PN532::write_mode(nfc::NdefMessage *message) {
}
bool PN532::clean_tag_(std::vector<uint8_t> &uid) {
uint8_t type = nfc::guess_tag_type(uid.size());
std::vector<uint8_t> first_page(16);
if (!this->ntag2xx_read_page(4, first_page)) {
ESP_LOGE(TAG, "Failed to read first page");
return false;
}
uint8_t type = nfc::guess_tag_type(uid.size(), first_page);
if (type == nfc::TAG_TYPE_MIFARE_CLASSIC) {
return this->format_mifare_classic_mifare_(uid);
} else if (type == nfc::TAG_TYPE_2) {