简体   繁体   English

双工NFC消息交换支持

[英]Duplex NFC message exchange support

I am new to NFC protocol. 我是NFC协议的新手。 Can someone let me know whether it is possible to exchange NDEF/SNEP messages BOTH ways in one session? 有人可以让我知道是否可以在一个会话中以两种方式交换NDEF / SNEP消息吗? I mean from NFC protocol point of view. 我的意思是从NFC协议的角度来看。

I know using Beam feature you can send one-way message [eg Phone->PC] but to send other way [eg PC->Phone] using Beam you need to tap phone again [ie trigger another session]. 我知道使用Beam功能可以发送单向消息[例如,电话> PC],但是要使用Beam发送其他方式[例如,PC>电话],则需要再次轻按电话[即触发另一个会话]。 I want to exchange messages withing one session. 我想与一个会话交换消息。

With SNEP under Android this is currently not possible. 使用Android下的SNEP,目前无法实现。 Android offers no way for applications to send or receive a second message. Android无法让应用程序发送或接收第二条消息。 From the SNEP and LLCP (basis of SNEP) protocol point of view this would be possible. 从SNEP和LLCP(SNEP的基础)协议的角度来看,这是可能的。 (That said: Android should really open up LLCP for everyone!). (也就是说:Android应该真的为所有人开放LLCP!)。

If you want to communicate back and forth and you have control over the PC side your only option is to switch from SNEP to card emulation on the PC side. 如果要来回通信并且可以控制PC端,则唯一的选择是从SNEP切换到PC端的卡仿真。

If your hardware allows you to run a ISO14443-A or ISO14443-B card emulation on the PC you can just emulate a tag containing the NDEF message and then do any bidirectional data-exchange using the IsoDep Tag interface. 如果您的硬件允许您在PC上运行ISO14443-A或ISO14443-B卡仿真,则只需仿真包含NDEF消息的标签,然后使用IsoDep标签接口进行任何双向数据交换。

As an alternative to using software card emulation on the PC side, you could also use a library like ISMB-SNEP . 除了在PC端使用软件卡仿真之外,还可以使用ISMB-SNEP之类的库。 This library enables somewhat(*) bi-directional data exchange over LLCP/SNEP on Android. 该库可以在Android上通过LLCP / SNEP进行某种程度的(*)双向数据交换。

(*) somewhat: It automates the tapping by turning the reader on the PC side off and on for every message exchange so that the user does not need to re-tap. (*):在每次消息交换时,通过打开和关闭PC端上的阅读器来自动执行敲击,因此用户无需重新敲击。

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

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