User manual
NXP Semiconductors
AN11480
Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi
AN11480
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2013. All rights reserved.
Application note
COMPANY PUBLIC
Rev. 1.0 — 17 December 2013
279710
22 of 30
Now the message gets sent to the NFC application that has been executed on the
Raspberry Pi previously.
8. P2P SNEP client project
Imagine you receive an image via e-mail and want to upload it to your mobile phone. If
you have no cable at hand, you need to fiddle about with Bluetooth or WiFi.
That is the point where NFC – P2P makes the game. With the P2P SNEP client you can
easily transfer the image by just touching the NFC antenna with your mobile phone. No
need to set up the connection before. No fiddling with cables or configuration. Because
the NFC reach range is limited to only a few centimeters, the NFC app assumes that it is
the user’s intention to establish a data connection and transfer the data.
The main purpose of P2P is to exchange a large amount of data between two devices
over NFC in a contactless way, e.g. the Raspberry Pi with the EXPLORE-NFC board and
an NFC enabled mobile phone. In P2P mode you can exchange all kinds of data. In the
example this guide refers to, we are using P2P with the PUT command to send an image
file from the Raspberry Pi to an NFC enabled mobile phone. Before sending the image it
is being encapsulated into an NDEF message of the type image/jpeg.
8.1 How does the SNEP client software work
It sends an NDEF message encapsulated in a SNEP message to the mobile device,
which must be capable of performing NFC and the peer to peer standard. Compliance
with the LLCP and ISO18092 protocols are ensured by the P2P Library. Execution of the
SNEP client software can be summarized in the following steps:
1. Hardware initialization
2. Detecting the RF field for an NFC peer of the tag type F.
The software checks the RF field whether there is tag type F capable of
performing the P2P communication
3. Once such device is found, the LLC link is activated in compliance with the
procedure defined by the NFC forum [11.].
4. LLCP socket creation and establishing connection with other peer – SNEP
server.
5. Transmission of a given image file to the SNEP server:
The SNEP client sends an initial fragment 128 bytes long. Then it waits for a
response from the server. Because in SNEP header it is declared longer
SNEP message than one fragment, the server should response with the
Continue response. The SNEP client can go on with sending the rest of the
SNEP message. As soon as the entire SNEP message has been transmitted,
the SNEP client shall receive the SNEP Success response from the mobile
device and the transmitted picture should be displayed on the mobile’s
screen.
Obtaining of the