class Mifare::Tag
Public Class Methods
match?(target)
click to toggle source
# File lib/ruby-nfc/tags/mifare/tag.rb, line 62 def self.match?(target) SAKS.values.include?(target[:nti][:nai][:btSak]) end
new(target, reader)
click to toggle source
Calls superclass method
NFC::Tag::new
# File lib/ruby-nfc/tags/mifare/tag.rb, line 37 def initialize(target, reader) super(target, reader) @pointer = Mifare.freefare_tag_new(reader.ptr, target) raise Mifare::Error, "Unknown mifare tag" if @pointer.null? end
Public Instance Methods
disconnect()
click to toggle source
frees memory allocated for mifare tag
# File lib/ruby-nfc/tags/mifare/tag.rb, line 54 def disconnect Mifare.freefare_free_tag(@pointer) end
name()
click to toggle source
# File lib/ruby-nfc/tags/mifare/tag.rb, line 45 def name Mifare.freefare_get_tag_friendly_name(@pointer) end
sak()
click to toggle source
# File lib/ruby-nfc/tags/mifare/tag.rb, line 58 def sak target.sak end
to_s()
click to toggle source
# File lib/ruby-nfc/tags/mifare/tag.rb, line 49 def to_s "#{uid_hex} #{name} SAK: 0x#{@target.sak.to_s(16)}" end