mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 07:08:20 +00:00
Add first page to clean_tag
This commit is contained in:
parent
59004bf569
commit
422e699aa6
@ -494,7 +494,13 @@ void PN532::write_mode(nfc::NdefMessage *message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PN532::clean_tag_(std::vector<uint8_t> &uid) {
|
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) {
|
if (type == nfc::TAG_TYPE_MIFARE_CLASSIC) {
|
||||||
return this->format_mifare_classic_mifare_(uid);
|
return this->format_mifare_classic_mifare_(uid);
|
||||||
} else if (type == nfc::TAG_TYPE_2) {
|
} else if (type == nfc::TAG_TYPE_2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user