使用NFC设备的NFC标签 [英] Use NFC device as NFC tag

查看:495
本文介绍了使用NFC设备的NFC标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的Andr​​oid设备作为NFC标签。是否可以使用NFC设备的NFC标签?我怎样才能做到这一点?我已经做了读/写标签,束数据设备之间。

I want my android device to act as NFC tag. Is it possible to use NFC device as NFC tag? How can I achieve that? I have done read/write tag, beam data between devices.

推荐答案

根据您的NFC设备上,这是可能的。不过,我不 kamituel 同意,这是由多个应用程序通过Android Beam功能正在做。

Depending on your NFC device, this may be possible. However, I do not agree with kamituel that this is being done by multiple applications through Android Beam.

Android Beam的使用NFC的的对等网络模式的哪个(虽然它可能产生类似的效果)是的不一样的为使用一台计算机作为一个读者(读/写器模式的)和一个设备作为标记。对等网络模式使用比读/写器模式进行通信的不同的协议栈。即NDEF对用于对等模式通信和NDEF在标签操作规格为读/写器模式访问NFC标签之一的顶部LLCP顶部SNEP的顶

Android Beam uses NFC's peer-to-peer mode which (while it may have a similar effect) is not the same as using one device as a reader (reader/writer mode) and one device as a tag. Peer-to-peer mode uses a different protocol stack for communication than reader/writer mode. I.e. NDEF on top of SNEP on top of LLCP for peer-to-peer mode communication and NDEF on top of one of the Tag Operation specifications for reader/writer mode accessing NFC tags.

因此​​,只有数据presentation层(NDEF)是两个协议栈相同。在的NFC环境下,NDEF(NFC数据交换格式)提取实际的通信部,并可能潜在地使independed使用的数据传输的应用程序。 Android的只是有点失败,使这个可用通过引入自己的束UI。

So only the data presentation layer (NDEF) is the same for both protocol stacks. In an NFC environment, the NDEF (NFC data exchange format) abstracts the actual communication part and could potentially make applications independed of the used data transport. Android just somewhat failed to make this usable by introducing their Beam UI.

如果您要模仿标签与NFC设备是Android设备,你有一定的要求和限制,当涉及到模拟的NFC的标签

If the NFC device that you want to emulate a tag with is an Android device, you have some requirements and limitations when it comes to emulating an NFC tag:


  • 的模拟设备需要运行的是Android 4.4或更高版本。

  • 的模拟设备需要支持基于主机的卡仿真。这是的的与恩智浦PN544 NFC控制器许多设备的情况。

  • 您可以根据NFC论坛类型4标签操作规范只模拟一个NFC标签。这是由于在Android中HCE一个限制,即仅允许在ISO / IEC 14443-4的顶级ISO / IEC 7816-4机应用结构的仿真。

  • The emulating device needs to run Android 4.4 or later.
  • The emulating device needs to support host-based card emulation. This is not the case for many devices with NXP's PN544 NFC controller.
  • You can only emulate an NFC tag according to the NFC Forum Type 4 Tag Operation specification. This is due to a limitation in Android HCE that only permits emulation of ISO/IEC 7816-4 appliction structures on top of ISO/IEC 14443-4.

在平行于HCE能力的Andr​​oid设备也将宣布其对等网络模式功能的其它设备。因此,如果你想访问一个Android HCE模拟NFC标签与其他Android设备,这其他Android设备将代替看到对等网络模式的功能和不会自动处理来自仿真标签NDEF消息。

In parallel to the HCE capabilities an Android device will also announce its peer-to-peer mode capabilities to other devices. As a consequence, if you want to access an Android HCE emulated NFC tag with another Android device, this other Android device will instead see the peer-to-peer mode capabilities and won't automatically process NDEF messages from the emulated tag.

为了克服这个限制,阅读的Andr​​oid设备还需要具备的是Android 4.4或更高版本。与该平台版本开始,您可以通过禁用对等网络模式的发现<一个href=\"http://developer.android.com/reference/android/nfc/NfcAdapter.html#enableReaderMode%28android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle%29\"相对=nofollow>阅读器模式API 。只有当你这样做,你可以从第二个Android设备访问仿真NFC标签。

In order to overcome this limitation, the reading Android device would also need to have Android 4.4 or later. Starting with that platform version, you can disable peer-to-peer mode discovery by using the reader mode API. Only when you do that, you can access the emulated NFC tag from the second Android device.

这篇关于使用NFC设备的NFC标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆