![]() |
NFC / NDEF Library for Proximity APIs
4.1.0
Easily parse and create NDEF records with the Windows Proximity APIs / Near Field Communication NFC.
|
An NDEF record contains a payload described by a type, a length, and an optional identifier. More...
Public Types | |
| enum | TypeNameFormatType { TypeNameFormatType.Empty = 0x00, TypeNameFormatType.NfcRtd = 0x01, TypeNameFormatType.Mime = 0x02, TypeNameFormatType.Uri = 0x03, TypeNameFormatType.ExternalRtd = 0x04, TypeNameFormatType.Unknown = 0x05, TypeNameFormatType.Unchanged = 0x06, TypeNameFormatType.Reserved = 0x07 } |
| Standardized type name formats, as defined by the NDEF record specification from the Nfc Forum. More... | |
Public Member Functions | |
| NdefRecord () | |
| Create an empty record, not setting any information. More... | |
| NdefRecord (TypeNameFormatType tnf, byte[] type) | |
| Create a new record with the specified type name format and type. Doesn't set the payload and ID. More... | |
| NdefRecord (NdefRecord other) | |
| Create a new record, copying the information of the record sent through the parameter. More... | |
| Type | CheckSpecializedType (bool checkForSubtypes) |
| Checks the type name format and type of this record and returns the appropriate specialized class, if one is available and known for this record type. More... | |
| virtual bool | CheckIfValid () |
| Checks if the contents of the record are valid; throws an exception if a problem is found, containing a textual description of the issue. More... | |
Protected Attributes | |
| byte [] | _type |
| Byte array storing raw contents of the type. Use Type property to access it whenever possible. More... | |
| byte [] | _payload |
| Byte array storing raw contents of the payload. Use Payload property to access it whenever possible. More... | |
Properties | |
| TypeNameFormatType | TypeNameFormat [get, set] |
| Indicates the structure of the value of the TYPE field. More... | |
| virtual byte [] | Type [get, set] |
| An identifier describing the type of the payload. More... | |
| byte [] | Id [get, set] |
| An identifier in the form of a URI reference. More... | |
| virtual byte [] | Payload [get, set] |
| The application data carried within an NDEF record. More... | |
An NDEF record contains a payload described by a type, a length, and an optional identifier.
This class is generic and can hold the data of any kind of record. It follows the specification from the NFC forum for the data format.
Ndef Records should usually be placed within an Ndef Message, which will make sure that for example the message begin / end flags are set correctly.
While the NdefRecord class only offers access to the payload as a byte array, you should rather use specialized sub classes, which offer convenient ways to handle data stored in the payload through easy access methods. Such classes are provided for several standardized types.
|
strong |
Standardized type name formats, as defined by the NDEF record specification from the Nfc Forum.
| NdefLibrary.Ndef.NdefRecord.NdefRecord | ( | ) |
Create an empty record, not setting any information.
| NdefLibrary.Ndef.NdefRecord.NdefRecord | ( | TypeNameFormatType | tnf, |
| byte [] | type | ||
| ) |
Create a new record with the specified type name format and type. Doesn't set the payload and ID.
| tnf | Type name format to use, based on the tnf's standardized by the Nfc Forum. |
| type | Type string. |
| NdefLibrary.Ndef.NdefRecord.NdefRecord | ( | NdefRecord | other | ) |
Create a new record, copying the information of the record sent through the parameter.
| other | Record to copy. |
|
virtual |
Checks if the contents of the record are valid; throws an exception if a problem is found, containing a textual description of the issue.
| NdefException | Thrown if no valid NDEF record can be created based on the record's current contents. The exception message contains further details about the issue. |
Reimplemented in NdefLibrary.Ndef.NdefLaunchAppRecord, NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord, NdefLibrary.Ndef.NdefSpRecord, NdefLibrary.Ndef.NdefGeoRecord, NdefLibrary.Ndef.NdefMailtoRecord, NdefLibrary.Ndef.NdefSmsRecord, NdefLibrary.Ndef.NdefTelRecord, and NdefLibrary.Ndef.NdefSocialRecord.
| Type NdefLibrary.Ndef.NdefRecord.CheckSpecializedType | ( | bool | checkForSubtypes | ) |
Checks the type name format and type of this record and returns the appropriate specialized class, if one is available and known for this record type.
| checkForSubtypes | If set to true, also checks for subtypes of the URL / SmartPoster record where the library offers a convenient handling class - e.g. for SMS or Mailto records, which are actually URL schemes. |
|
protected |
Byte array storing raw contents of the payload. Use Payload property to access it whenever possible.
Direct byte array access provided as virtual property can't be accessed from constructor.
|
protected |
Byte array storing raw contents of the type. Use Type property to access it whenever possible.
Direct byte array access provided as virtual property can't be accessed from constructor.
|
getset |
An identifier in the form of a URI reference.
|
getset |
The application data carried within an NDEF record.
|
getset |
An identifier describing the type of the payload.
|
getset |
Indicates the structure of the value of the TYPE field.
1.8.13