Beginning NFC: Near Field Communication with Arduino, Android, and PhoneGap
Tom Igoe, Don Coleman, Brian Jepson
Language: English
Pages: 246
ISBN: 1449372066
Format: PDF / Kindle (mobi) / ePub
You’ll learn how to write apps using the Nfc Data Exchange Format (Ndef) in PhoneGap, Arduino, and node.js that help devices read messages from passive Nfc tags and exchange data with other Nfc-enabled devices. If you know Html and JavaScript, you’re ready to start with Nfc.
- Dig into Nfc’s architecture, and learn how it’s related to Rfid
- Write sample apps for Android with PhoneGap and its Nfc plugin
- Dive into Ndef: examine existing tag-writer apps and build your own
- Listen for and filter Ndef messages, using PhoneGap event listeners
- Build a full Android app to control lights and music in your home
- Create a hotel registration app with Arduino, from check-in to door lock
- Write peer-to-peer Nfc messages between two Android devices
- Explore embedded Linux applications, using examples on Raspberry Pi and BeagleBone
Computers and Intractability: A Guide to the Theory of NP-Completeness
The Hacker Playbook 2: Practical Guide To Penetration Testing
Microsoft PowerPoint 2010: Comprehensive (Shelly Cashman Series)
provides some more details about the binary format of the record header’s first byte. You will hopefully never need to use this information, since any well-written NDEF library should handle all of this for you. If you’re using the software libraries in this book, this is true. The finer details of the binary formatting will be taken care of for you, and can safely skip ahead to “NDEF in Practice” on page 56. If you want to under‐ stand more of the structure of messages and records, read on.
function(message) { var label = document.createTextNode(message), lineBreak = document.createElement("br"); messageDiv.appendChild(lineBreak); // add a line break messageDiv.appendChild(label); // add the text }, /* clears the message div: */ clear: function() { messageDiv.innerHTML = ""; }, The methods for the makeMessage() and writeTag() functions that follow make use of functions from two objects defined by the NFC plug-in. These are the NFC object, which gives you access to your device’s NFC
you can use to check it. Include the libraries you need and set up an NfcAdapter object. Then add some constants to name your output pins and a string for serial input, and a variable to track when you turn the indicator LEDs on, as you’ll see in the following sketch. Then in the setup, initialize serial communications and the NfcAdapter object, and set the two indicator LED pins to be outputs. A Microcontroller NFC Application: Hotel Key Cards | 151 // If you're using an SPI-based shield,
Express.js lets you construct web server appli‐ cations with a RESTful structure. Each element of a URI can be used to determine the functionality of your program. Serialport lets you read from and write to your com‐ puter’s serial ports. Node.js Application Specification: package.json Node and npm use a file called package.json to describe the dependencies of a given node application. This file describes the application, its dependencies, and the engines it relies on. This file lives in the
method="post"> Name:
Room:
Checkin time:
Number of days: