Class: Rho::NFCTagTechnology_Ndef
- Inherits:
-
NFCTagTechnology
- Object
- NFCTagTechnology
- Rho::NFCTagTechnology_Ndef
- Defined in:
- lib/extensions/nfc/nfc.rb
Constant Summary collapse
- MIFARE_CLASSIC =
'com.nxp.ndef.mifareclassic'
- NFC_FORUM_TYPE_1 =
'org.nfcforum.ndef.type1'
- NFC_FORUM_TYPE_2 =
'org.nfcforum.ndef.type2'
- NFC_FORUM_TYPE_3 =
'org.nfcforum.ndef.type3'
- NFC_FORUM_TYPE_4 =
'org.nfcforum.ndef.type4'
Constants inherited from NFCTagTechnology
Rho::NFCTagTechnology::ISODEP, 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
-
#can_make_read_only ⇒ Object
return bool.
-
#get_max_size ⇒ Object
return int.
-
#get_type ⇒ Object
return string.
-
#initialize ⇒ NFCTagTechnology_Ndef
constructor
A new instance of NFCTagTechnology_Ndef.
-
#is_writable ⇒ Object
return bool.
-
#make_read_only ⇒ Object
return bool.
-
#read_NdefMessage ⇒ Object
return NdefMessage.
-
#write_NdefMessage(msg) ⇒ Object
msg - NdefMessage.
Methods inherited from NFCTagTechnology
#close, #connect, #get_name, #is_connected
Constructor Details
#initialize ⇒ NFCTagTechnology_Ndef
Returns a new instance of NFCTagTechnology_Ndef.
294 295 296 |
# File 'lib/extensions/nfc/nfc.rb', line 294 def initialize super(NFCTagTechnology::NDEF) end |
Instance Method Details
#can_make_read_only ⇒ Object
return bool
309 310 311 |
# File 'lib/extensions/nfc/nfc.rb', line 309 def can_make_read_only return (Nfc.tech_Ndef_can_make_read_only != 0) end |
#get_max_size ⇒ Object
return int
299 300 301 |
# File 'lib/extensions/nfc/nfc.rb', line 299 def get_max_size return Nfc.tech_Ndef_get_max_size end |
#get_type ⇒ Object
return string
319 320 321 |
# File 'lib/extensions/nfc/nfc.rb', line 319 def get_type return Nfc.tech_Ndef_get_type end |
#is_writable ⇒ Object
return bool
304 305 306 |
# File 'lib/extensions/nfc/nfc.rb', line 304 def is_writable return (Nfc.tech_Ndef_is_writable != 0) end |
#make_read_only ⇒ Object
return bool
314 315 316 |
# File 'lib/extensions/nfc/nfc.rb', line 314 def make_read_only return (Nfc.tech_Ndef_make_read_only != 0) end |
#read_NdefMessage ⇒ Object
return NdefMessage
324 325 326 327 328 329 |
# File 'lib/extensions/nfc/nfc.rb', line 324 def read_NdefMessage msg_ar = Nfc. msg = NdefMessage.new msg.init_from_byte_array(msg_ar) return msg end |
#write_NdefMessage(msg) ⇒ Object
msg - NdefMessage
332 333 334 |
# File 'lib/extensions/nfc/nfc.rb', line 332 def write_NdefMessage(msg) Nfc.(msg.get_byte_array) end |