简体   繁体   English

如何在 flutter nfc_manager 中找到 NXP 类型的 NFC 标签

[英]How to find NXP type of NFC Tag in flutter nfc_manager

I am using Flutter nfc_manager to read, write, and protect operations.我正在使用 Flutter nfc_manager 进行读取、写入和保护操作。

Now I need to find the type.现在我需要找到类型。 For example, I need to know that the scanned tag is NTAG213 or NTAG216.例如,我需要知道扫描的标签是 NTAG213 还是 NTAG216。

Any possibilities to check that using nfc_manager.使用 nfc_manager 检查的任何可能性。

There is no standard method to identify exactly a NFC Tag, there are some methods that can be used to help deduce which Tag you are dealing with but some of these are family specific methods to identify which member of a family of Tags it is.没有标准方法可以准确识别 NFC 标签,有一些方法可用于帮助推断您正在处理的标签,但其中一些是特定于家庭的方法,用于识别它是标签系列的哪个成员。

As these methods are a lower level type of access how to use them on iOS and Android are different.由于这些方法是较低级别的访问类型,因此在 iOS 和 Android 上使用它们是不同的。

At the low level the different Tag technologies have different methods getting more details about the Tag.在底层,不同的标签技术有不同的方法来获取关于标签的更多细节。

From the Flutter side you can use the from method at least narrow down which Tag Technology you are working with.从 Flutter 方面,您可以使用from方法至少缩小您正在使用的标签技术。 This from method will return null if the Tag is not the right type.如果标签的类型不正确,这个from方法将返回null

Then for example if it was an NfcA Tag hardware (as the NTAX21x Tags are) different NFC Tag families will quite often give different low level ATQA and SAK responses (This data is actually used work out some of the Tag Technologies but not all eg Mifare, etc).然后例如,如果它是一个NfcA标签硬件(如 NTAX21x 标签),不同的 NFC 标签系列通常会给出不同的低级ATQASAK响应(这些数据实际上用于解决一些标签技术,但不是全部,例如 Mifare , ETC)。 This ATQA and SAK responses are available in different method in Android and iOSATQASAK响应在 Android 和 iOS 中以不同的方法提供

Then from the Tag's UID the first byte is supposed to be Manufacturer identifier, so for NXP all UID's should begin with 04h然后从标签的 UID 开始,第一个字节应该是制造商标识符,因此对于 NXP,所有 UID 都应该以04h开头

Then there is things specific to a family of Tags, for example for the NTAX21x series you can transceive or sendMiFareCommand the "GET_VERSION" 60h command to get back product information and decode it as per the datasheet然后是特定于标签系列的东西,例如对于 NTAX21x 系列,您可以transceivesendMiFareCommand “GET_VERSION” 60h命令以获取产品信息并根据数据表对其进行解码

But is knowing the exact Tag type off any use?但是知道确切的标签类型有什么用吗? , are you just wanting to find out how much data you can store on it? ,你只是想知道你可以在上面存储多少数据吗?

So as well as using he NTAX21x "GET_VERSION" command there is the more generic method of using the NDEF size method to get this more useful info on how much data can this tag store.因此,除了使用 NTAX21x“GET_VERSION”命令之外,还有更通用的方法是使用 NDEF size方法来获取有关此标签可以存储多少数据的更有用的信息。 This NDEF size should work on any Tag that conforms to one of the NFC Forum Tag Standards eg Type 2 in the NTAX21x case.此 NDEF 大小应适用于符合 NFC 论坛标签标准之一的任何标签,例如 NTAX21x 案例中的类型 2。

(Also the size of any Type 2 Tag is stored in the capability container at page 03h in byte 02 and you can transceive or sendMiFareCommand a READ 03h command to any Type 2 tag to get this data) (此外,任何类型 2 标签的大小都存储在功能容器中的第03h页字节02中,您可以向任何类型 2 标签transceivesendMiFareCommand READ 03h命令以获取此数据)

NXP provides a library called TapLinx , which provides simple APIs to interact with NXP manufactured tags. NXP 提供了一个名为TapLinx的库,它提供了简单的 API 来与 NXP 制造的标签进行交互。 You can use that if you don't wanna get into the details.如果你不想深入细节,你可以使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM