Skip to content
Snippets Groups Projects
README.rdoc 2.01 KiB

NFC

DESCRIPTION:

NFC is a ruby wrapper for the Near Field Communication library. The Near Field Communication library works with many USB RFID readers, so this gem lets you read RFID tags.

FEATURES/PROBLEMS:

  • Only supports ISO1443A (MIFARE) tags right now.

SYNOPSIS:

require 'nfc'

# Create a new context
ctx = NFC::Context.new

# Open the first available USB device
dev = ctx.open nil

# Block until a tag is available, then print tag info
p dev.select

# You can even run in an infinite loop if you'd like to continually find
# tags:

loop do
  p dev.select
end

REQUIREMENTS:

  • A USB RFID reader. I’m using the touchatag.

  • libnfc