0

I developed an application that consist of data exchanging over NFC from a phone to a NFC reader (pn532). The whole project works fine with android however on WP8 I am having problems to read from the Arduino.

I checked the LLCP protocol and seems to be correct. LLCP-SNEP is executed by the book however the NDEF message is never delivered to the phone, not even the default Operating System app handler. The wierd thing is that the phone transmit data perfectly to the pn532 but never in the opposite direction. Also I noticed that the phone reads perfect from an android device or from tags but fails with my controller. Bellow you can find the Output from the Arduino microcontroler as pn532 host controller.

-------Peer to Peer-------- Send a message to Lumia 620 on WP8 SAMConfig write: 14 1 14 1 read: 15 write: 8C 0 0 0 0 0 0 40 1 FE F BB BA A6 C9 89 0 0 0 0 0 0 0 0 FF FF 1 FE F BB BA A6 C9 89 0 0 6 46 66 6D 1 1 10 0 read: 8D 5 22 D4 0 E8 A4 8B 61 AF 9D 72 91 5F C3 0 0 0 32 46 66 6D 1 1 11 2 2 3 80 3 2 0 1 4 1 64 write: 86 read: 87 0 0 0 write: 8E 11 20 read: 8F 0 wait for a CC PDU write: 86 read: 87 0 5 20 2 2 3 80 5 1 5 6 F 75 72 6E 3A 6E 66 63 3A 73 6E 3A 73 6E 65 70 write: 8E 0 0 read: 8F 0 write: 86 read: 87 0 81 84 2 2 3 80 5 1 5 write: 8E 0 0 read: 8F 0 Leaving connect write: 86 read: 87 0 0 0 write: 8E 13 20 0 10 2 0 0 0 20 D1 1 1C 55 0 61 70 70 6C 69 63 61 74 69 6F 6E 2F 77 69 6E 64 6F 77 73 2E 63 6F 6D 2F 4E 46 43 read: 8F 0 write: 86 read: 87 0 83 44 1 write: 8E 0 0 read: 8F 0 write: 86 read: 87 0 83 4 1 10 81 0 0 0 0 write: 8E 13 60 10 read: 8F 0 Leaving writePablo Disconnecting write: 86 read: 87 0 0 0 write: 8E 11 60 read: 8F 0 wait for a DM PDU write: 86 read: 87 0 81 C4 0 Success

Any help would be welcome

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
Pablo Valdes
  • 734
  • 8
  • 19

1 Answers1

0

Two things that come to my mind:

  1. You are sending an invalid Receive Ready (RR) PDU:

    TgSetData, DSAP=4, PTYPE=1101 (RR), SSAP=32, N(S)=1, N(R)=0
    write:  8E 13 60 10
    read:   8F 0
    Success
    

    In an RR PDU, the field reserved for N(S) must always be 0 as there is no send sequence with RR PDUs. Moreover, you are acknowledging that you received one I PDU, so N(R) must be 1. Thus, the correct PDU should look like this:

    TgSetData, DSAP=4, PTYPE=1101 (RR), SSAP=32, N(R)=1
    write:  8E 13 60 01
    read:   8F 0
    Success
    
  2. Does your NDEF message contain the data you are expecting? Currently your NDEF message contains one URI RTD record with the URI application/windows.com/NFC (note that a relative URI does not make much sense here).

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
  • Michael I fixed the RR PDU issue that you pointed above and still the same issueread: **`ead: 87 0 83 4 1 10 81 0 0 0 0 write: 8E 13 60 1`**. Also I send a MIME type as **` 8E 13 20 0 10 2 0 0 0 12 D2 A 5 74 65 78 74 2F 70 6C 61 69 6E 70 61 62 6C 6F`** But nothing change. I am going to try other SAPs to see what happen. – Pablo Valdes Mar 06 '14 at 19:45
  • The SAPs look fine, particularly as the SNEP server returns an acknowledgement in response to the PUT command. Though, you should use service discovery using the SNEP URI urn:nfc:sn:snep to connect instead of directly using DSAP=4. – Michael Roland Mar 06 '14 at 21:19