Topic: Using Libnfc-llcp as initiator for p2p with nexus S

Hello,

I am trying to send a message via p2p to a nexus S with Arygon desktop reader. Receive works (when argyon in target mode), however, when I try to place the reader in initiator mode, the phone does not detect it.

This is my code:
http://pastebin.com/R0Ucq4Kx

This is the log on the libnfc side:
LLCP initialized
NFC device found
Connected to NFC device
[stderr] 20110910 10:36:14.507 TRACE    libnfc-llcp.llc.link- service 0x88037f0 bound to SAP 1
[stderr] 20110910 10:36:14.507 TRACE    libnfc-llcp.llc.link- service 0x8802118 bound to SAP 24
MAC link created
[stderr] 20110910 10:36:14.508 INFO     libnfc-llcp.mac.link- (Arygon (/dev/ttyUSB0) 00V6.5 - PN532 v1.6 (0x07)) Attempting to activate LLCP Link as initiator
[stderr] 20110910 10:36:14.636 DEBUG    libnfc-llcp.mac.link- (Arygon (/dev/ttyUSB0) 00V6.5 - PN532 v1.6 (0x07)) nfc_initiator_init() succeeded


(NOTE: message to send is NOT NPP formatted, but I should atleast see something happening on the android stack. I see nothing in the logs though)

Also, I would like to have a 2 way exchange with "one tap". Now, unless I remove the phone from the field of the reader, the connection does not drop. How do I force a stop of the connection?

Re: Using Libnfc-llcp as initiator for p2p with nexus S

Updates;
I managed to initiate a connection:

LLCP initialized
NFC device found
Connected to NFC device
[stderr] 20110910 10:58:36.115 TRACE    libnfc-llcp.llc.link- service 0x9aa37f0 bound to SAP 1
[stderr] 20110910 10:58:36.116 TRACE    libnfc-llcp.llc.link- service 0x9a9f410 bound to SAP 24
MAC link created
[stderr] 20110910 10:58:36.116 INFO     libnfc-llcp.mac.link- (Arygon (/dev/ttyUSB0) 00V6.5 - PN532 v1.6 (0x07)) Attempting to activate LLCP Link as initiator
[stderr] 20110910 10:58:36.244 DEBUG    libnfc-llcp.mac.link- (Arygon (/dev/ttyUSB0) 00V6.5 - PN532 v1.6 (0x07)) nfc_initiator_init() succeeded
[stderr] 20110910 10:59:02.016 DEBUG    libnfc-llcp.mac.link- (Arygon (/dev/ttyUSB0) 00V6.5 - PN532 v1.6 (0x07)) nfc_initiator_select_dep_target() succeeded
[stderr] 20110910 10:59:02.016 INFO     libnfc-llcp.mac.link- (Arygon (/dev/ttyUSB0) 00V6.5 - PN532 v1.6 (0x07)) LLCP Link activated (initiator)
[stderr] 20110910 10:59:02.016 TRACE    libnfc-llcp.llc.link- llc_link_configure (0x9aa3df8, (nil), 0)
[stderr] 20110910 10:59:02.016 DEBUG    libnfc-llcp.llc.link- mq_open (/libnfc-llcp-11242-0x9aa3df8-up)
[stderr] 20110910 10:59:02.016 DEBUG    libnfc-llcp.llc.link- mq_open (/libnfc-llcp-11242-0x9aa3df8-down)
[stderr] 20110910 10:59:02.016 INFO     libnfc-llcp.llc.link- LLC Link started successfully
mac link activated
connection created
[stderr] 20110910 10:59:02.016 INFO     libnfc-llcp.llc.llc- (0xb70a7b70) Link activated
connected
[stderr] 20110910 10:59:02.016 TRACE    libnfc-llcp.llc.llc- (0xb70a7b70) mq_receive+
[stderr] 20110910 10:59:02.017 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20110910 10:59:07.017 INFO     libnfc-llcp.llc.link- Deactivating LLC Link
[stderr] 20110910 10:59:07.017 DEBUG    libnfc-llcp.llc.link- The LLC Link has an active MAC link
[stderr] 20110910 10:59:07.017 INFO     libnfc-llcp.mac.link- MAC Link deactivation requested (reason: 0)
[stderr] 20110910 10:59:24.097 FATAL    libnfc-llcp.mac.link- Could not send 2 bytes
lt-npp: ERROR: Unable to receive data. (RX)
[stderr] 20110910 10:59:25.133 ERROR    libnfc-llcp.mac.link- MAC Link deactivation failed
[stderr] 20110910 10:59:25.133 DEBUG    libnfc-llcp.llc.link- Back to LLC Link deactivation
[stderr] 20110910 10:59:25.143 INFO     libnfc-llcp.llc.link- Stopping Data Link Connection [244 -> 248]
[stderr] 20110910 10:59:25.143 TRACE    libnfc-llcp.llc.connection- Stopping Data Link Connection [24 -> 1]

Re: Using Libnfc-llcp as initiator for p2p with nexus S

But most of the time, the libnfc sort of hangs at nfc_initiator_succeeded. it does not initiate a connection with the android device.

-Earlence

Re: Using Libnfc-llcp as initiator for p2p with nexus S

Hello,

You could now try the latest libnfc with log4c as logger (like libnfc-llcp), you should configure log4rc file to enable libnfc's traces. (have a look to log4rc file in libnfc's trunk).

After that, could you post a full trace ? (using pastebin or similar if its too long).

Romuald Conty