Author Topic: SNEP API  (Read 2622 times)

JFultz

  • Guest
SNEP API
« on: November 05, 2012, 04:39:59 PM »
Hello,

I did up some sample code to send SNEP UDP packets. The following message is sent:

string message = "text/vcard\n" +
                "BEGIN:VCARD\n" +
                "VERSION:4.0\n" +
                "TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212\n" +
                "CELL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212\n" +
                "EMAIL:forrestgump@example.com\n" +
                "END:VCARD";

Questions:

1) Is this the correct format for SNEP message that sets the telephone, cell phone, and email address for a receipt?

2) What port on local host should this message be sent to?



Green Support

  • Administrator
  • Newbie
  • *****
  • Posts: 6
Re: SNEP API
« Reply #1 on: November 05, 2012, 11:56:43 PM »
1) Almost. As per the API guide we support the TEL;CELL:

However, the most important part is that this message has to be encoded as an NDEF message and wrapped with SNEP transport. Refer to NFC specs. on how to encode the v-card message as NDEF.

Instead of encoding as v-card, it would be easier to use the well-known NDEF messages. The example in the Appendix shows encoding on either e-mail or mobile numbers using well-known NDEF messages.

We know this is quite a bit to send a mobile number but we are trying to use stardard message and transport instead of creating our own proprietary.

2) The port is defined in the "Reader" configuration page. Please note the SNEP over UDP is our proprietary transport since the NFC standard does not define a transport other than LLCP.

Again, please refer to the Appendix for sample SNEP client code.

JFultz

  • Guest
Re: SNEP API
« Reply #2 on: November 08, 2012, 08:48:38 PM »
I have compiled the sample code and configured SNEP on the Reader configuration page. SNEP is configured to use the default port 3516. The computer is configured to use 192.168.7.244. The email works but the phone fails.

C:\Development>snep_udp_client.exe
Usage: snep_udp_client server_address port type data
         type - 5 (mobile) or 6 (email)
         data - mobile number or email address

C:\Development>snep_udp_client.exe 192.168.7.244 3516 5 1-404-555-1212
SNEP PUT error (ff) !

C:\Development>snep_udp_client.exe 192.168.7.244 3516 6 forrestgump@example.com
SNEP PUT Success!

Any ideas?

Green Support

  • Administrator
  • Newbie
  • *****
  • Posts: 6
Re: SNEP API
« Reply #3 on: November 24, 2012, 12:45:51 AM »
Sorry for the delayed response.

It is working as expected. The mobile number will not be accepted since the system is configured to accept one or the other but not the both.

Switch to mobile as following:

General Configuration -> Customer Type -> Switch to mobile.