NFC / NDEF Library for Proximity APIs  4.1.0
Easily parse and create NDEF records with the Windows Proximity APIs / Near Field Communication NFC.
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
NdefLibrary.Ndef.NdefHandoverErrorRecord Class Reference

The Error Record is used in the Handover Select Record to indicate that the Handover Selector failed to successfully process the most recently received Handover Request Message. It SHALL NOT be used elsewhere. More...

Inheritance diagram for NdefLibrary.Ndef.NdefHandoverErrorRecord:
NdefLibrary.Ndef.NdefRecord

Public Types

enum  ErrorReasonTypes : byte { Reserved = 0x00, ErrorReasonTypes.TemporaryMemoryConstraints = 0x01, ErrorReasonTypes.PermanentMemoryConstraints = 0x02, ErrorReasonTypes.CarrierSpecificConstraints = 0x03 }
 According to the current specification, four different error reasons are defined. Depending on the value set for the error reason, the error data has a different meaning. More...
 
- Public Types inherited from NdefLibrary.Ndef.NdefRecord
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

 NdefHandoverErrorRecord ()
 Create an empty Handover Error Record. More...
 
 NdefHandoverErrorRecord (NdefRecord other)
 Create a Handover Error record based on the record passed through the argument. More...
 
 NdefHandoverErrorRecord (byte errorReason, byte[] errorData)
 Create a Handover Error record based on the supplied error reason and error data, coming from direct byte arrays. More...
 
 NdefHandoverErrorRecord (ErrorReasonTypes errorReason, uint errorData)
 Create a Handover Error record based on the supplied error reason and error data, coming from higher level convenience types that this class will convert to the appropriate byte level representation. More...
 
- Public Member Functions inherited from NdefLibrary.Ndef.NdefRecord
 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...
 

Static Public Member Functions

static bool IsRecordType (NdefRecord record)
 Checks if the record sent via the parameter is indeed a Handover Error record. Checks the type and type name format. More...
 

Static Public Attributes

static readonly byte [] BtHandoverErrorType = { 0x65, 0x72, 0x72 }
 Type of the Handover Select / Error Record. More...
 

Properties

byte ErrorReason [get, set]
 The actual byte used to store the error reason in the Handover Error record. More...
 
ErrorReasonTypes ErrorReasonAsType [get, set]
 Access the byte-based ErrorReason property through the enum variable for easier use within apps. More...
 
byte [] ErrorData [get, set]
 Byte array that contains the error data - additional information about the error. Its contents depend on the error reason and are described in the error reason enum documentation. More...
 
uint ErrorDataAsNumber [get, set]
 Access the ErrorData byte array as an Integer. More...
 
- Properties inherited from NdefLibrary.Ndef.NdefRecord
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...
 

Additional Inherited Members

- Protected Attributes inherited from NdefLibrary.Ndef.NdefRecord
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...
 

Detailed Description

The Error Record is used in the Handover Select Record to indicate that the Handover Selector failed to successfully process the most recently received Handover Request Message. It SHALL NOT be used elsewhere.

Member Enumeration Documentation

◆ ErrorReasonTypes

According to the current specification, four different error reasons are defined. Depending on the value set for the error reason, the error data has a different meaning.

Enumerator
TemporaryMemoryConstraints 

The Handover Request Message could not be processed due to temporary memory constraints. Resending the unmodified Handover Request Message might be successful after a time interval of at least the number of milliseconds expressed in the error data field.

PermanentMemoryConstraints 

The Handover Request Message could not be processed due to permanent memory constraints. Resending the unmodified Handover Request Message will always yield the same error condition.

CarrierSpecificConstraints 

The Handover Request Message could not be processed due to carrier-specific constraints. Resending the Handover Request Message might not be successful until after a time interval of at least the number of milliseconds expressed in the error data field.

Constructor & Destructor Documentation

◆ NdefHandoverErrorRecord() [1/4]

NdefLibrary.Ndef.NdefHandoverErrorRecord.NdefHandoverErrorRecord ( )

Create an empty Handover Error Record.

This record is only valid within the Handover Select record.

◆ NdefHandoverErrorRecord() [2/4]

NdefLibrary.Ndef.NdefHandoverErrorRecord.NdefHandoverErrorRecord ( NdefRecord  other)

Create a Handover Error record based on the record passed through the argument.

Internalizes and parses the payload of the original record. The original record has to be a Handover Error Record as well.

Parameters
otherRecord to copy into this Handover Error record.
Exceptions
NdefExceptionThrown if attempting to create a Handover Error record based on an incompatible record type.

◆ NdefHandoverErrorRecord() [3/4]

NdefLibrary.Ndef.NdefHandoverErrorRecord.NdefHandoverErrorRecord ( byte  errorReason,
byte []  errorData 
)

Create a Handover Error record based on the supplied error reason and error data, coming from direct byte arrays.

This record is only valid within the Handover Select record.

Parameters
errorReasonThe reason why the handover request could not be processed by the target device. The value of this defines the possible contents and content length of the second (errorData) parameter.
errorDataAdditional data for the error reason. The contents depend on the error reason, and is usually a time value.

◆ NdefHandoverErrorRecord() [4/4]

NdefLibrary.Ndef.NdefHandoverErrorRecord.NdefHandoverErrorRecord ( ErrorReasonTypes  errorReason,
uint  errorData 
)

Create a Handover Error record based on the supplied error reason and error data, coming from higher level convenience types that this class will convert to the appropriate byte level representation.

This record is only valid within the Handover Select record.

Parameters
errorReasonThe reason why the handover request could not be processed by the target device. The value of this defines the possible contents and content length of the second (errorData) parameter.
errorDataAdditional data for the error reason. The contents depend on the error reason, and is usually a time value.

Member Function Documentation

◆ IsRecordType()

static bool NdefLibrary.Ndef.NdefHandoverErrorRecord.IsRecordType ( NdefRecord  record)
static

Checks if the record sent via the parameter is indeed a Handover Error record. Checks the type and type name format.

Parameters
recordRecord to check.
Returns
True if the record has the correct type, type name format and payload to be a Handover Error record, false if it's a different record.

Member Data Documentation

◆ BtHandoverErrorType

readonly byte [] NdefLibrary.Ndef.NdefHandoverErrorRecord.BtHandoverErrorType = { 0x65, 0x72, 0x72 }
static

Type of the Handover Select / Error Record.

Property Documentation

◆ ErrorData

byte [] NdefLibrary.Ndef.NdefHandoverErrorRecord.ErrorData
getset

Byte array that contains the error data - additional information about the error. Its contents depend on the error reason and are described in the error reason enum documentation.

◆ ErrorDataAsNumber

uint NdefLibrary.Ndef.NdefHandoverErrorRecord.ErrorDataAsNumber
getset

Access the ErrorData byte array as an Integer.

Based on the current Connection Handover 1.3 specification, all possible error data values are time lengths with a different byte number / maximum duration. Therefore, this class provides this convenience accessor to the ErrorData property, which correctly converts a number stored in the ErrorData array based on the number of bytes as defined by the error reason.

◆ ErrorReason

byte NdefLibrary.Ndef.NdefHandoverErrorRecord.ErrorReason
getset

The actual byte used to store the error reason in the Handover Error record.

◆ ErrorReasonAsType

ErrorReasonTypes NdefLibrary.Ndef.NdefHandoverErrorRecord.ErrorReasonAsType
getset

Access the byte-based ErrorReason property through the enum variable for easier use within apps.


The documentation for this class was generated from the following file: