Skip to content

Instantly share code, notes, and snippets.

@anonoz
Created November 6, 2014 10:12
Show Gist options
  • Save anonoz/b80d118403e17bb76627 to your computer and use it in GitHub Desktop.
Save anonoz/b80d118403e17bb76627 to your computer and use it in GitHub Desktop.
Code to scan MMU card's UID, return the serial number
require 'nfc'
# Read
c = NFC::Context.new
d = c.open nil
puts "Put your card..."
e = d.select
# UID
uid = e.uid.collect! { |x| x.to_s(16) }.reverse!.join.to_i(16)
puts uid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment