Class: PICC

Inherits:
Object
  • Object
show all
Defined in:
lib/picc.rb

Direct Known Subclasses

ISO144434, Mifare::Classic, Mifare::Ultralight

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pcd, uid, sak) ⇒ PICC

Returns a new instance of PICC.



5
6
7
8
9
10
# File 'lib/picc.rb', line 5

def initialize(pcd, uid, sak)
  @pcd = pcd
  @uid = uid
  @sak = sak
  @halted = false
end

Instance Attribute Details

#sakObject (readonly)

Returns the value of attribute sak.



3
4
5
# File 'lib/picc.rb', line 3

def sak
  @sak
end

#uidObject (readonly)

Returns the value of attribute uid.



2
3
4
# File 'lib/picc.rb', line 2

def uid
  @uid
end

Instance Method Details

#haltObject



21
22
23
24
25
26
27
# File 'lib/picc.rb', line 21

def halt
  if @pcd.picc_halt
    @halted = true
  else
    @halted = false
  end
end

#resume_communicationObject



12
13
14
15
16
17
18
19
# File 'lib/picc.rb', line 12

def resume_communication
  if @pcd.reestablish_picc_communication(@uid)
    @halted = false
    true
  else
    false
  end
end