Browse files

updating to_s and docs

  • Loading branch information...
1 parent c29d8a3 commit 23cdfc381b904855206a03cd448052ba89840cc0 @tenderlove committed Sep 19, 2009
Showing with 14 additions and 8 deletions.
  1. +6 −0 CHANGELOG.rdoc
  2. +1 −1 lib/nfc.rb
  3. +7 −3 lib/nfc/iso14443a.rb
  4. +0 −4 test/test_nfc.rb
View
6 CHANGELOG.rdoc
@@ -1,3 +1,9 @@
+=== 2.0.1 / 2009-09-19
+
+* 1 Bugfix
+
+ * Raising an exception when a reader cannot be found.
+
=== 2.0.0 / 2009-08-07
* 2 major enhancements
View
2 lib/nfc.rb
@@ -9,7 +9,7 @@
# library will read RFID tags from an RFID reader. You should start by reading
# NFC#find
class NFC
- VERSION = '2.0.0'
+ VERSION = '2.0.1'
include Singleton
View
10 lib/nfc/iso14443a.rb
@@ -19,14 +19,18 @@ def atqa
end
###
+ # Get the UID as a hex string
+ def to_s join_string = ''
+ sprintf((['%02x'] * uiUidLen).join(join_string), * uid).upcase
+ end
+
+ ###
# Inspect this tag
def inspect
- uid = sprintf((['%02x'] * uiUidLen).join(' '), *self.uid)
-
string_ary =
[ "(NFC) ISO14443A Tag",
" ATQA (SENS_RES): #{sprintf("%02x %02x", *atqa)}",
- " UID (NFCID1): #{uid}",
+ " UID (NFCID1): #{to_s ' '}",
" SAK (SEL_RES): #{sprintf("%02x", btSak)}"
]
if uiAtsLen > 0
View
4 test/test_nfc.rb
@@ -32,8 +32,4 @@ def test_infinite_list_passive=
@nfc.infinite_list_passive = true
@nfc.infinite_list_passive = false
end
-
- def test_poll_mifare
- thing = @nfc.poll_mifare
- end
end

0 comments on commit 23cdfc3

Please sign in to comment.