Can't resolve com.android.npp

Asked by André Cruz

In order to implement the NPP protocol on top of LLCP to achieve P2P communication with the Nexus S the first step is to resolve the "com.android.npp" service, but it seems it is not working. I modified the llcp-test-client for this:

$ ./llcp-test-client.py --quirks android -t 9
searching for a usb tty reader
searching for a usb bus reader
trying reader at usb port 029:002
chipset is a PN533 version 2.07
ATR_RES(nfcid3=2051b3bcf0a00d220eea, did=00, bs=00, br=00, to=0e, pp=32, gb=46666d01011003020001040196)
running on Initiator
recv-lto: 1500
recv-miu: 1024
recv-wks: 3
send-agf: False
send-lsc: 3
send-lto: 1000
send-miu: 128
send-wks: 1
Test 9: service name lookup
shutdown on link disruption
FAIL: no answer for 'com.android.npp' lookup
I was the Initiator

Am I doing something wrong or is it another Android bug?

Also, I've noticed that after running the LLCP test my reader seems to disappear from the USB bus. If I run this again:

$ ./llcp-test-client.py --quirks android -t 9
searching for a usb tty reader
searching for a usb bus reader
Traceback (most recent call last):
  File "./llcp-test-client.py", line 658, in <module>
    main()
  File "./llcp-test-client.py", line 541, in main
    clf = nfc.ContactlessFrontend(options.device)
  File "/Users/andre/work/nfcpy/nfc/clf.py", line 50, in __init__
    raise LookupError("couldn't find any usable nfc reader")
LookupError: couldn't find any usable nfc reader

I then have to remove and insert the USB reader to have it detected.

Question information

Language:
English Edit question
Status:
Answered
For:
nfcpy Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :
#1

This is not a bug of Android LLCP but due to nfpy's inattentiveness to the peer's LLCP version number. Android implements LLCP 1.0 which does not define the service name lookup feature. Service name lookup comes with LLCP 1.1 and nfcpy, due to it being used for LLCP validation, is a bit ahead in terms of feature set.

You can connect ot the NPP service using connect-by-service-name as in test 7: nfc.llcp.connect(socket, "com.android.npp"). Please note that the service name "com.android.npp" is not well-formed, it should actually be a URI (and not a relative one).

Regarding the disappearing reader after one use, I cannot test that at the moment but expect to get SCL3711 readers soon. I'm sure I'll then get a fix for that problem. Would you mind to file a bug report for this, so that I won't forget.

Can you help with this problem?

Provide an answer of your own, or ask André Cruz for more information if necessary.

To post a message you must log in.