Warning Unreleased Docs! - You may be viewing documentation that reflects an upcoming release and the functionality described may not be in the current version you are using. Change the version above to the most recent version.

Record

NFC Record

This class representative Record object

In order to use this API you must include the following extension in your build.yml

extensions: ["nfc"]

If you are building a Windows Mobile or Windows CE app with this API, you must set your app_type as “rhoelements” in your build.yml as shown here.

Methods

close()

Release resources.

Synchronous Return:

  • Void

Method Access:

  • Instance Method: This method can be accessed via an instance object of this class:
    • myObject.close()

create()

Creates record.

Synchronous Return:

  • Rho.NFC.Record :

    Record object.

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Record.create()
    • Ruby: Rho::Record.create()

Properties

ID : STRING Read Only

Object ID.

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.ID

payload : STRING

Record payload(data buffer).

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.payload

recordId : STRING

Optional field for NFC_NDEF_RTD_GENERAL record type.

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.recordId

textCharEncoding : INTEGER

Use if record type is NFC_NDEF_RTD_TEXT. Values see NFC Forum. For example UTF-8 is 2 and it will be set by default. This property will be ignored in read tag mode, you should find it in a payload.

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.textCharEncoding

textLanguage : STRING

Use if record type is NFC_NDEF_RTD_TEXT. This property will be ignored in read tag mode. This property will be ignored in read tag mode, you should find it in a payload.

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.textLanguage

tnf : INTEGER

When you create a new record then this field is needed for NFC_NDEF_RTD_GENERAL, for another types it will be set automatically.

Possible Values (false):

Constant: Rho.Record.NDEF_TNF_EMPTY (For Ruby use "::" for all "." when referencing constants)
String: 1
Constant: Rho.Record.NDEF_TNF_WELL_KNOWN (For Ruby use "::" for all "." when referencing constants)
String: 2
Constant: Rho.Record.NDEF_TNF_MEDIA (For Ruby use "::" for all "." when referencing constants)
String: 3
Constant: Rho.Record.NDEF_TNF_ABSOLUTE_URI (For Ruby use "::" for all "." when referencing constants)
String: 4
Constant: Rho.Record.NDEF_TNF_EXTERNAL (For Ruby use "::" for all "." when referencing constants)
String: 5
Constant: Rho.Record.NDEF_TNF_UNKNOWN (For Ruby use "::" for all "." when referencing constants)
String: 6
Constant: Rho.Record.NDEF_TNF_UNCHANGED (For Ruby use "::" for all "." when referencing constants)
String: 7
Constant: Rho.Record.NDEF_TNF_ANY_TYPE (For Ruby use "::" for all "." when referencing constants)
String: 8

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.tnf

type : INTEGER

Record type. This property will be ignored in read tag mode. If you create a record you should set this property firstly.

Possible Values (false):

Constant: Rho.Record.NDEF_RTD_TEXT (For Ruby use "::" for all "." when referencing constants)
String: 1

A text type record.

Constant: Rho.Record.NDEF_RTD_URI (For Ruby use "::" for all "." when referencing constants)
String: 2

A URI type record.

Constant: Rho.Record.NDEF_RTD_GENERAL (For Ruby use "::" for all "." when referencing constants)
String: 3

A generic type record.

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.type

typeName : STRING

When you create a new record then this field is needed for NFC_NDEF_RTD_GENERAL, for another types it will be set automatically. For values see NFC Forum.

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.typeName

uriProtocol : INTEGER

Use if record type is NFC_NDEF_RTD_URI. For values please see NFC Forum. This property will be ignored in read tag mode, you should find it in a payload.

Property Access:

  • Instance: This property can be accessed via an instance object of this class:
    • myObject.uriProtocol