Last active
March 31, 2017 00:33
-
-
Save paralleltree/398fa48a035d3713d912c06b068ea296 to your computer and use it in GitHub Desktop.
Reading IDm from a FeliCa card with libpafe-ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pasori' | |
begin | |
Pasori.open do |p| | |
warn 'Waiting for a card...' | |
begin | |
p.felica_polling do |f| | |
warn 'Reading...' | |
puts sprintf("%016X", f.idm.unpack('Q>').first) | |
end | |
break | |
rescue PasoriError | |
sleep 1 | |
end while true | |
end | |
rescue Interrupt | |
exit 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment