Class: Mifare::DESFire::FILE_PERMISSION
- Inherits:
-
Struct
- Object
- Struct
- Mifare::DESFire::FILE_PERMISSION
- Defined in:
- lib/mifare/des_fire.rb
Overview
value 0x00 ~ 0x0D are key numbers, 0x0E grants free access, 0x0F always denies access
Instance Attribute Summary collapse
-
#change_access ⇒ Object
Returns the value of attribute change_access.
-
#read_access ⇒ Object
Returns the value of attribute read_access.
-
#read_write_access ⇒ Object
Returns the value of attribute read_write_access.
-
#write_access ⇒ Object
Returns the value of attribute write_access.
Instance Method Summary collapse
Instance Attribute Details
#change_access ⇒ Object
Returns the value of attribute change_access
121 122 123 |
# File 'lib/mifare/des_fire.rb', line 121 def change_access @change_access end |
#read_access ⇒ Object
Returns the value of attribute read_access
121 122 123 |
# File 'lib/mifare/des_fire.rb', line 121 def read_access @read_access end |
#read_write_access ⇒ Object
Returns the value of attribute read_write_access
121 122 123 |
# File 'lib/mifare/des_fire.rb', line 121 def read_write_access @read_write_access end |
#write_access ⇒ Object
Returns the value of attribute write_access
121 122 123 |
# File 'lib/mifare/des_fire.rb', line 121 def write_access @write_access end |
Instance Method Details
#import(byte) ⇒ Object
122 123 124 125 126 127 128 |
# File 'lib/mifare/des_fire.rb', line 122 def import(byte) self[:change_access] = byte & 0x0F self[:read_write_access] = (byte >> 4) & 0x0F self[:write_access] = (byte >> 8) & 0x0F self[:read_access] = (byte >> 12) & 0x0F self end |
#to_uint ⇒ Object
130 131 132 |
# File 'lib/mifare/des_fire.rb', line 130 def to_uint (read_access << 12) | (write_access << 8) | (read_write_access << 4) | change_access end |