Android NFC: SNEP and P2P Response

I am trying to implement a P2P connection between two Android phones (one of them will be replaced by an independent device at the end). I have seen that Android 4 supports SNEP, which is published on the NFC forum and should be available on non-android devices.

I have a Google manual for NFC P2P (http://developer.android.com/guide/topics/nfc/nfc.html#p2p) and I can send some information from one phone to another, but I ask a few questions:

  • Is Android Beam just a name for NFC or is it Android protocol working on SNEP / NPP? If this is a protocol, how to make NFC P2P without a beam?
  • How to install using SNEP?
  • How to send a response to another device when initializing a connection (received first message)?

Thank you for your help !!!

+6
source share
3 answers

Android Beam is just a name, right. Devices use SNEP by default, if this fails, it tries the NPP. You cannot send a response from the receiving device to the sender. You can use the callback to notify you of a successful click:

http://developer.android.com/reference/android/nfc/NfcAdapter.OnNdefPushCompleteCallback.html

+2
source

ismb-snep-java The google code page explains communication and data transfer using SNEP, and I tested it and it works. After searching in PDF format with both ACR and Android, I believe that you just need to make a few tweaks so that they work the way you want.

0
source

To give a clearer explanation:

Is Android Beam just a name for NFC or is it Android protocol working on SNEP / NPP? If this is a protocol, how to make NFC P2P without a beam?

Android beam is a feature of the Android OS. It is a high-level NDEF messaging engine on top of SNEP / NPP. So far, peer-to-peer mode (on Android) is only available through Android Beam, which cannot be used for bidirectional communication.

How to install using SNEP?

If you want to use SNEP on Android, (I think), the only way is to program your own SNEP implementation on top of the ISO-DEP protocol. Since SNEP sits on top of LLCP, you also need to create your own LLCP implementation. It is not simple..

How to send a response to another device during connection initialization (received first message)

With SNEP you cannot. As @robertly said it is possible to create a callback message. If you need true bi-directional communication, use the reader / writer and card emulation modes.

0
source

Source: https://habr.com/ru/post/905077/


All Articles