Topic: JAVA LIBRARY for P2P over NFC (SNEP PROTOCOL)

I've developed (and published as open source) a new library for peer-to-peer over NFC implementing, this time, SNEP (the NFC Forum official protocol for peer-to-peer).

The advantage of using SNEP, instead of NPP, is about interoperability: NPP is the protocol developed by Google and is, only, available on Android devices. Instead, SNEP is the official specification of the NFC Forum for peer-to-peer and we have the hope it will become the definitive standard for peer-to-peer over NFC.

SNEP, as you know is, in fact, already available in the main mobile platforms (Android, Blackberry, Nokia) and, consequently the ismb-snep-library is, now, able to enable the peer-to-peer communication not only with Android mobile devices but with every NFC capable device.
 
if you're interested, the library is available at the following url:
http://code.google.com/p/ismb-snep-java/

If it sounds like it may be of interest, please let me know and I can get you more information/support.

If you're interested in a possible cooperation please do not hesitate to contact me.

Obviously, any feedback is welcome.

Cheers,
Antonio
mailto: antonio.lotito@ismb.it

2 (edited by duanguyuan 2013-03-20 06:51:19)

Re: JAVA LIBRARY for P2P over NFC (SNEP PROTOCOL)

Hi, I have downloaded the source code, thanks for your contribution. But when I operated my devices(Sony MT27i & ACR122U) as the guide(http://code.google.com/p/ismb-snep-java … ND_RECEIVE), I got the error as follow:

Get factory
Get terminals
Terminal name: ACS ACR122 0
Available Commands: receive, send and quit
receive
card: PC/SC card in ACS ACR122 0, protocol T=0, state OK
Protocol:T=0
Called new Procedure to receive data .. TARGET MODE
[DEBUG] {sending   [56 bytes]} 0xFF 0x00 0x00 0x00 0x33 0xD4 0x8C 0x02 0x00 0x00 0x00 0x00 0x00 0x40 0x01 0xFE 0x0F 0xBB 0xBA 0xA6 0xC9 0x89 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0x01 0xFE 0x0F 0xBB 0xBA 0xA6 0xC9 0x89 0x00 0x00 0x0F 0x46 0x66 0x6D 0x01 0x01 0x10 0x03 0x02 0x00 0x01 0x04 0x01 0x96
[DEBUG] {receiving [2 bytes]} 0x63 0x00
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
    at it.ismb.snep.Util.appendToByteArray(Util.java:98)
    at it.ismb.snep.Util.subByteArray(Util.java:119)
    at it.ismb.snep.IsmbSnepConnectionTarget.transceive(IsmbSnepConnectionTarget.java:129)
    at it.ismb.snep.IsmbSnepConnectionTarget.receivingProcedure(IsmbSnepConnectionTarget.java:303)
    at it.ismb.snep.NfcReader.<init>(NfcReader.java:87)
    at it.ismb.snep.NfcReader.main(NfcReader.java:39)

Could you please help me,thank you! smile

3 (edited by j3p2w1 2013-03-26 21:50:16)

Re: JAVA LIBRARY for P2P over NFC (SNEP PROTOCOL)

Hello
I have written a small program, taking inspirations from SNEP and ISMB (because none of the existing  programs was working with my configuration: AVR122U 102 ). It uses target mode for the ACR, and it works for pushing a message from mobile to PC. Mobile is galaxy S2 or S3 or ACER liquid glow
Problem is that it works only once if I don't disconnect the ACR. If I disconnect and reconnect the ACR, it works again.
I have tried to send different forms of reset to the ACR, but nothing works.
Here is a trace.
____________________________
Get factory
Get terminals
Terminal name: ACS ACR122 0
card: PC/SC card in ACS ACR122 0, protocol Unknown protocol 0, state OK
Protocol:Unknown protocol 0
Firmeware: ACR122U210
cde = 0xFF 0x00 0x00 0x00 0x33 0xD4 0x8C 0x02 0x00 0x00 0x00 0x00 0x00 0x40 0x01 0xFE 0x0F 0xBB 0xBA 0xA6 0xC9 0x89 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0x01 0xFE 0x0F 0xBB 0xBA 0xA6 0xC9 0x89 0x00 0x00 0x0F 0x46 0x66 0x6D 0x01 0x01 0x10 0x03 0x02 0x00 0x01 0x04 0x01 0x96
rep = 0xD5 0x8D 0x25 0x1E 0xD4 0x00 0x65 0x9E 0x5C 0x5B 0xA3 0x9C 0xD1 0xA7 0x89 0x7A 0x00 0x00 0x00 0x32 0x46 0x66 0x6D 0x01 0x01 0x10 0x03 0x02 0x00 0x01 0x04 0x01 0x96 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x86
rep = 0xD5 0x87 0x00 0x00 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x8E 0x00 0x00
rep = 0xD5 0x8F 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x86
rep = 0xD5 0x87 0x00 0x00 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x8E 0x00 0x00
rep = 0xD5 0x8F 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x86
rep = 0xD5 0x87 0x00 0x00 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x8E 0x00 0x00
rep = 0xD5 0x8F 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x86
rep = 0xD5 0x87 0x00 0x11 0x20 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x8E 0x00 0x00
rep = 0xD5 0x8F 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x8E 0x81 0x84
rep = 0xD5 0x8F 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x86
rep = 0xD5 0x87 0x00 0x00 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x8E 0x00 0x00
rep = 0xD5 0x8F 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x86
rep = 0xD5 0x87 0x00 0x13 0x20 0x00 0x10 0x02 0x00 0x00 0x00 0x47 0xD2 0x24 0x20 0x61 0x70 0x70 0x6C 0x69 0x63 0x61 0x74 0x69 0x6F 0x6E 0x2F 0x63 0x6F 0x6D 0x2E 0x65 0x78 0x61 0x6D 0x70 0x6C 0x65 0x2E 0x61 0x6E 0x64 0x72 0x6F 0x69 0x64 0x2E 0x62 0x65 0x61 0x6D 0x42 0x65 0x61 0x6D 0x20 0x6D 0x65 0x20 0x75 0x70 0x21 0x0A 0x0A 0x42 0x65 0x61 0x6D 0x20 0x54 0x69 0x6D 0x65 0x3A 0x20 0x32 0x32 0x3A 0x34 0x32 0x3A 0x54 0xD4 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x0B 0xD4 0x8E 0x83 0x04 0x01 0x10 0x81 0x00 0x00 0x00 0x00 // ack du push
rep = 0xD5 0x8F 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x52 0x00 0x00 0x00 0x00 // reset target  ????
rep = 0xD5 0x53 0x00 0x90 0x00
cde = 0xFF 0x00 0x00 0x00 0x04 0xD4 0x32 0x01 0x03 // antenna off  ????
rep = 0xD5 0x33 0x90 0x00
_________________________________________________
Get factory
Get terminals
Terminal name: ACS ACR122 0
card: PC/SC card in ACS ACR122 0, protocol Unknown protocol 0, state OK
Protocol:Unknown protocol 0
Firmeware: ACR122U210
cde = 0xFF 0x00 0x00 0x00 0x33 0xD4 0x8C 0x02 0x00 0x00 0x00 0x00 0x00 0x40 0x01 0xFE 0x0F 0xBB 0xBA 0xA6 0xC9 0x89 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0x01 0xFE 0x0F 0xBB 0xBA 0xA6 0xC9 0x89 0x00 0x00 0x0F 0x46 0x66 0x6D 0x01 0x01 0x10 0x03 0x02 0x00 0x01 0x04 0x01 0x96
rep = 0x63 0x00!!!!!!!!!!!!!!!!!!!!! abnormal!  why????????????????????

Any Idea?? T You!