Topic: [P2P : NFC board & Nexus S] use of libnfc-llcp and libndef
Hello everyone !
I am currently working on Peer to peer mode between a NFC reader (PN532 and not a ACR122) and a Nexus S.
I have seen, thanks to this forum, that I have to use LLCP and send NDEF message but I don't really understand how to use it.
What I have understood is that I have to implement applications on the phone and on the computer (linked to the NFC reader) to send NDef message. I have found some examples for the Nexus S appplication but most of these examples are a communication between 2 Nexus S and not with a Nexus S + NFC Reader.
I have also understood (thanks to Emanuele Bertoldi and Romuald Conty) the use of libnfc-llcp and libndef but now, I have some problems to "link" the two libraries.
In fact, I have linked the 2 devices with a MAC link and LLCP link and I have created a NDEF message but I do not know what method used to send this NDEF message with libnfc-llcp because in this library, methods with "send" word (as "llc_connection_send" or "llc_link_send_data") wait for uint8_t whereas libndef creates NDEF messages. Maybe I can convert this messages in uint8_t ?
I have tried to send a uint8_t message with the method "llc_connection_send" but I have an error :
Application_name: llc_connection.c:347: llc_connection_send_pdu: Assertion `connection->status == DLC_CONNECTED' failed.I have seen that the status "DLC_CONNECTED" is attributes with the function "llc_connection_accept" but I have also an error :
Application_name: llc_connection.c:322: llc_connection_accept: Assertion `connection->thread == pthread_self ()' failed.Do you know why ? And is it the right way to send NDEF message ?
From the topic http://www.libnfc.org/community/topic/4 c-reader/, I have seen that the "com.android.npp" service is usefull to send message but I don't know how do it. Could you explain me how it works ? If someone could explain me the main step to send NDEF message, it will be very nice.
Last question, is it possible ? Is there someone who has already succeeded it ?
Thank you very much for any help because I do not know how to do and I know that this forum is very helpful !
Mylene