Class: Rho::NFCTagTechnology_MifareUltralight

Inherits:
NFCTagTechnology show all
Defined in:
lib/extensions/nfc/nfc.rb

Constant Summary collapse

TYPE_ULTRALIGHT =
1
TYPE_ULTRALIGHT_C =
2
TYPE_UNKNOWN =
-1

Constants inherited from NFCTagTechnology

Rho::NFCTagTechnology::ISODEP, Rho::NFCTagTechnology::MIFARE_CLASSIC, Rho::NFCTagTechnology::MIFARE_ULTRALIGHT, Rho::NFCTagTechnology::NDEF, Rho::NFCTagTechnology::NDEF_FORMATABLE, Rho::NFCTagTechnology::NFCA, Rho::NFCTagTechnology::NFCB, Rho::NFCTagTechnology::NFCF, Rho::NFCTagTechnology::NFCV

Instance Method Summary collapse

Methods inherited from NFCTagTechnology

#close, #connect, #get_name, #is_connected

Constructor Details

#initializeNFCTagTechnology_MifareUltralight

Returns a new instance of NFCTagTechnology_MifareUltralight.



446
447
448
# File 'lib/extensions/nfc/nfc.rb', line 446

def initialize
    super(NFCTagTechnology::MIFARE_ULTRALIGHT)
end

Instance Method Details

#get_typeObject

return int



451
452
453
# File 'lib/extensions/nfc/nfc.rb', line 451

def get_type
   return Nfc.tech_MifareUltralight_get_type
end

#read_pages(index) ⇒ Object

index - integer return 16 byte array



463
464
465
# File 'lib/extensions/nfc/nfc.rb', line 463

def read_pages(index)
    return Nfc.tech_MifareUltralight_read_pages(index)
end

#transceive(data) ⇒ Object

send data (byte array) to Tag and receive result - byte array



468
469
470
# File 'lib/extensions/nfc/nfc.rb', line 468

def transceive(data)
    return Nfc.tech_MifareUltralight_transceive(data)
end

#write_page(index, block) ⇒ Object

index - integer block - 4 byte array



457
458
459
# File 'lib/extensions/nfc/nfc.rb', line 457

def  write_page(index, block)
    Nfc.tech_MifareUltralight_write_page(index, block)
end