欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > Android >内容正文

Android

android nfc peer to peer 实例,NFC Peer2Peer Mode - Android Beam - ISO 18092

发布时间:2024/10/12 Android 50 豆豆
生活随笔 收集整理的这篇文章主要介绍了 android nfc peer to peer 实例,NFC Peer2Peer Mode - Android Beam - ISO 18092 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

问题

I need to find out how in Android Beam the P2P mode is managed.

I found some general information about P2P:

There is an active P2P mode (not recommended by NFC Forum) and a passive one (recommended by NFC Forum) where the passive device works like a smartcard (card emulation mode).

I also know that an NFC reader device does usually the following steps:

Field on

Check for a card or a P2P passive device

If found then communicate with the device, if not then field off

Field off

Check for external field for around 500ms-1s at least

If external field detected act as a card or P2P passive target. Receive commands and perform the transaction as a target

Wait until no more field detected

Goto 1

Now my question is, in Android Beam what happens when the 2 phones are put together?

I think they both create the field for scanning, and they both recognize them, by showing then the Android Beam interface (the smaller windows with the information for sending)

Then, the user types on the screen, and gets the iniator, while the other one goes to the passive receiver.

They pair by P2P passive and change the information over LLCP

The callback is sent to the iniator and the end.

I don't know if this is correct, does someone have information herefore?

What happens in Android Beam when the 2 smartphones/devices are put together, in which mode are they, and who gets when active/passive and which mode is used (P2P active or passive)?

In LLCP there is no master/slave so both are master and slave what exactly means this?

Thanks for your help!

回答1:

As far as I remember it is as follows:

The initiator initiates the transmission, i.e., it is the one that begins the communication - comparable with first come first serve - independent of the direction of the data flow.

In a second step, the initiator dictates the kind of transmission mode, i.e., passive or active in peer-to-peer mode, or RFID mode (reader/writer mode). The chosen mode depends what kind of modes the initiator and/or the target supports. The passive mode is used when the initiator has enough power to drive both devices (itself and target). Whereas the active mode can be used if power should be shared among initiator and target device.

When two NFC devices are put together, the device which wants to communicate first, will be the initiator. Therefore, passive devices like tags are always targets. However, there is no peer-to-peer mode between NFC devices and RFID tags.

LLCP is just a top level protocol to transmit data in either way. Therefore, the initiator asks the target to transmit or receive data. The good thing about the NFC peer-to-peer mode is, that the NFC devices can swap its roles after each successful communication.

来源:https://stackoverflow.com/questions/14082178/nfc-peer2peer-mode-android-beam-iso-18092

总结

以上是生活随笔为你收集整理的android nfc peer to peer 实例,NFC Peer2Peer Mode - Android Beam - ISO 18092的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。