Class: Rho::NFCTagTechnology

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

Constant Summary collapse

ISODEP =
'IsoDep'
MIFARE_CLASSIC =
'MifareClassic'
MIFARE_ULTRALIGHT =
'MifareUltralight'
NDEF =
'Ndef'
NDEF_FORMATABLE =
'NdefFormatable'
NFCA =
'NfcA'
NFCB =
'NfcB'
NFCF =
'NfcF'
NFCV =
'NfcV'

Instance Method Summary collapse

Constructor Details

#initialize(tech_name) ⇒ NFCTagTechnology

Returns a new instance of NFCTagTechnology.



230
231
232
# File 'lib/extensions/nfc/nfc.rb', line 230

def initialize(tech_name)
     @techname = tech_name
end

Instance Method Details

#closeObject

close connect - make it after your I/O operations



245
246
247
# File 'lib/extensions/nfc/nfc.rb', line 245

def close
    Nfc.tech_close(get_name)
end

#connectObject

connect - only after it you can make any I/O operation



240
241
242
# File 'lib/extensions/nfc/nfc.rb', line 240

def connect
    Nfc.tech_connect(get_name)
end

#get_nameObject

return string



235
236
237
# File 'lib/extensions/nfc/nfc.rb', line 235

def get_name
    return @techname
end

#is_connectedObject

return true if tech connected and ready for I/O operations



250
251
252
253
254
255
256
257
# File 'lib/extensions/nfc/nfc.rb', line 250

def is_connected
    res = Nfc.tech_is_connected(@techname)
    resb = false
    if res != 0
        resb = true
    end    
    return resb
end