简体   繁体   English

Android:持续读取自修改的NFC标签(NXP NT3H2211)

[英]Android: Reading a self-modifying NFC tag continuously (NXP NT3H2211)

I'm currently working on a project, trying out NXP's NT3H2211 IC which is an NFC tag, containing a 64 Byte SRAM, which can be mapped into the address space visible from the NFC interface. 我目前正在研究一个项目,尝试使用NXP的NT3H2211 IC,它是一个NFC标签,包含一个64字节的SRAM,可以映射到NFC接口可见的地址空间中。 The IC is contained within this development kit: NTAG I²C plus Explorer Kit ( http://www.nxp.com/demoboard/OM5569 ). 该IC包含在以下开发套件中:NTAGI²C加上Explorer套件( http://www.nxp.com/demoboard/OM5569 )。

This SRAM can be used to enable dynamically changing data being read/written with any standard NFC reader, without wearing out the EEPROM area in a few hours (eg reading sensor data or streaming data for processing; reading live data from a machine as a contactless debugging interface, etc.). 该SRAM可用于动态更改任何标准NFC读取器读取/写入的数据,而不会在几个小时内耗尽EEPROM区域(例如,读取传感器数据或流数据进行处理;以非接触方式从机器读取实时数据)调试界面等)。

I'm still very new to Android programming (in Android Studio), and with the help of a tutorial video series, I have managed to build an App which reads the tag a single time, once the phone is tapped to it. 我对Android编程(在Android Studio中)还是很陌生,并且在一个视频教程的帮助下,我设法构建了一个App,该App可以在手机被点击后一次读取标签。 To my understanding, the app does this by waiting for an intent which contains some kind of information that an NFC tag has been found. 据我了解,该应用程序通过等待一个意图来执行此操作,该意图包含已找到NFC标签的某种信息。

I'm continuously updating the Tag's SRAM with a valid, auto-generated NDEF plaintext message (at the moment, just containing the uptime of my board in seconds), so therefore I'd like to be able to read the tag continuously as well. 我正在使用有效的,自动生成的NDEF纯文本消息不断地更新标签的SRAM(目前,仅包含以秒为单位的电路板的正常运行时间),因此我也希望能够连续读取标签。

The supplied demo app from NXP (NTAG I²C DEMO) can do this; 恩智浦提供的演示应用程序(NTAGI²CDEMO)可以执行此操作; there's a section for reading NDEF records. 有一个部分用于读取NDEF记录。 The NDEF reader can be set to read continuously, by checking the "Enable NDEF read loop" check box. 通过选中“启用NDEF读取循环”复选框,可以将NDEF阅读器设置为连续读取。 With this, I can see my data updating. 这样,我可以看到我的数据正在更新。 The app also does not rely on having to remove the phone and re-tapping it to the tag to perform actions - once the tag is on the phone's reader, every feature can be used without re-tapping. 该应用程序还无需依赖于将手机取下并重新轻按标签即可执行操作-标签一旦贴在手机的阅读器上,无需重新轻按即可使用所有功能。

I'd like to incorporate a feature-set like this in my own app as well; 我也想在自己的应用程序中加入这样的功能集; having to re-tap every time I want to update my on-screen data can be very frustrating after a while. 每次要更新屏幕数据时都必须重新轻按一下,这可能会在一段时间后让您非常沮丧。

I'm not entirely sure on how to re-use the intent that was originally used to detect and then read the tag; 我不确定如何重用最初用于检测然后读取标签的意图; maybe that's the key. 也许那是关键。

If you need the code, just say so. 如果您需要代码,请这样说。 I really appreciate you taking your time and helping me out! 非常感谢您抽出宝贵的时间帮助我!

The source code of the demo app is available at http://www.nxp.com/documents/software/SW3648.zip . 该演示应用程序的源代码可从http://www.nxp.com/documents/software/SW3648.zip获得

You should be able to read continuously after the event, by setting an appropriate flag. 通过设置适当的标志,您应该能够在事件发生后连续读取。

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

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