Warning Older Docs! - You are viewing documentation for a previous released version of RhoMobile Suite.

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 "::" instead of ".")
String: 1
Constant: Rho.Record.NDEF_TNF_WELL_KNOWN (For Ruby use "::" instead of ".")
String: 2
Constant: Rho.Record.NDEF_TNF_MEDIA (For Ruby use "::" instead of ".")
String: 3
Constant: Rho.Record.NDEF_TNF_ABSOLUTE_URI (For Ruby use "::" instead of ".")
String: 4
Constant: Rho.Record.NDEF_TNF_EXTERNAL (For Ruby use "::" instead of ".")
String: 5
Constant: Rho.Record.NDEF_TNF_UNKNOWN (For Ruby use "::" instead of ".")
String: 6
Constant: Rho.Record.NDEF_TNF_UNCHANGED (For Ruby use "::" instead of ".")
String: 7
Constant: Rho.Record.NDEF_TNF_ANY_TYPE (For Ruby use "::" instead of ".")
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 "::" instead of ".")
String: 1

A text type record.

Constant: Rho.Record.NDEF_RTD_URI (For Ruby use "::" instead of ".")
String: 2

A URI type record.

Constant: Rho.Record.NDEF_RTD_GENERAL (For Ruby use "::" instead of ".")
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