Android NFC : SNEP protocol and P2P response
Asked Answered
B

3

6

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

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

  1. Android Beam is just a name for NFC or it is an Android protocol working over SNEP/NPP ? If it's a protocol, how to do NFC P2P without Beam ?
  2. How to set the use of SNEP ?
  3. How to send a response to the other device when the connection is initialized (first message received) ?

Thank you for your help !!!

Barque answered 4/1, 2012 at 10:28 Comment(0)
L
2

Android Beam is just a name, correct. Devices use SNEP by default, if that fails, it tries NPP. You can't send a response really from the receiving device to the sender. You can only use a callback to be notified of a successful push:

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

Lyda answered 10/1, 2012 at 19:49 Comment(0)
M
0

ismb-snep-java's Google Code page explains communication and data transfer using SNEP protocol and I have tested it and it works. After searching through the PDF's from both ACR and Android, I believe you would just have to make some tweeks to make it work the way you desire.

Malacology answered 14/9, 2012 at 9:30 Comment(1)
I'm trying to send get snep request but I can't figure out how to do send it from android. Do you know something about it?Toiletry
N
0

To give a more clear explanation:

Android Beam is just a name for NFC or it is an Android protocol working over SNEP/NPP ? If it's a protocol, how to do NFC P2P without Beam ?

Android beam is a feature of the Android OS. It's a high level NDEF message exchange mechanism on top of SNEP/NPP. For now, peer-to-peer mode (on Android) is only accessible through Android Beam, which can't be used for bi-directional communication.

How to set the use of 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. Because SNEP is on top of LLCP you also need to create your own LLCP implementation. That's not easy..

How to send a response to the other device when the connection is initialized (first message received)

With SNEP, you can't. As @robertly said it's only possible to create a callback message. If you want true bi-directional communication, use the reader/writer and card-emulation operation modes.

Nick answered 26/9, 2014 at 11:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.