如何确定在 NTAG216 中可以写入的最大页数?我找不到任何方法 in the documentation这将让我检查最大可用内存。同样根据文档:
The next 36 pages are the user read/write area.
这是否意味着我只能写到第 36 页?我试着写到第 50 页,它没有给出任何错误。
我正在使用 NFC 工具检查最大内存,但是一旦我从第 4 页开始写入字节,关于最大内存的数据就变得不可用了。
最佳答案
如何确定在 NTAG216 中可以写入的最大页数?
如果您知道标签是 NXP NTAG216 标签,那么您可以通过查看 the datasheet 来确定标签的大小。 . datasheet告诉你一个NTAG216标签分为231页,其中第4到225页是用户内存(即你可以自由使用数据的内存)。
根据文档,“接下来的 36 页是用户读/写区域。”这是否意味着我只能写到第 36 页?
仔细阅读that documentation .它告诉您“前 4 页用于 OTP、制造商数据和锁定位”。并且“接下来的 36 页是用户读/写区域。”因此,这意味着用户内存的页编号从 4 到 40 (= 4 + 36)。但是,该文档还明确指出,这仅适用于 MIFARE Ultralight C (MF0ICU2),这是一种完全不同的标签类型。
如何确定标签是否真的是 NTAG216 标签?
您可以使用 GET_VERSION 命令来检查这一点。如果GET_VERSION命令成功,并显示了NTAG216的特征版本信息,则可以认为该标签实际为NTAG216标签。
byte[] GET_VERSION = new byte[] { (byte)0x60 };
byte[] result = nfca.transceive(GET_VERSION);
if ((result != null) && (result.length == 8)) {
// GET_VERSION command successful
if ((result[0] == 0) && (result[1] == (byte)0x04) && (result[2] == (byte)0x04)) {
// tag is NTAG
if ((result[3] == (byte)0x02) && (result[4] == (byte)0x01) && (result[5] == (byte)0x00) && (result[7] == (byte)0x03)) {
if (result[6] == (byte)0x13) {
// tag is NTAG216
} else if (result[6] == (byte)0x11) {
// tag is NTAG215
} else if (result[6] == (byte)0x0F) {
// tag is NTAG213
}
}
}
}
关于android - 如何检查 NTAG216 中的最大可用内存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34849495/