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.NdefHandoverAlternativeCarrierRecord Class Reference

The Alternative Carrier record is used within the payload of the Handover Select record to describe a single alternative carrier. More...

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

Public Types

enum  CarrierPowerStates : byte { Inactive = 0x00, Active = 0x01, Activating = 0x02, Unknown = 0x03 }
 Enum to conveniently access the 2-bit field that indicates the carrier power state. 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

void AddAuxiliaryDataReference (byte[] auxiliaryDataReference)
 Convenience method to add another auxiliary data reference to the list. Using this method ensures that the list is already created and updates the payload according to the changes. More...
 
 NdefHandoverAlternativeCarrierRecord ()
 Create an empty Alternative Carrier Record. More...
 
 NdefHandoverAlternativeCarrierRecord (NdefRecord other)
 Create an Alternative Carrier Record based on the record passed through the argument. More...
 
bool AssemblePayload ()
 Create the payload based on the data stored in the properties. Usually called automatically when changing properties, but you might need to call this manually if you modify the list of auxiliary data references directly without using accessor method provided by this class. More...
 
override 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...
 
- 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...
 

Static Public Member Functions

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

Static Public Attributes

static readonly byte [] BtAcType = Encoding.UTF8.GetBytes("ac")
 Type of the Alternative Carrier Record. More...
 

Properties

CarrierPowerStates CarrierPowerState [get, set]
 2-bit field that indicates the carrier power state. More...
 
byte CarrierPowerStateAsByte [get, set]
 Access the Carrier Power State property as a byte instead of the enum. Note that according to the current Bluetooth specification (1.3), only two bits of the byte are in use for the Carrier Power State. More...
 
byte [] CarrierDataReference [get, set]
 The Carrier Data Reference is a pointer to an NDEF record that uniquely identifies the carrier technology. More...
 
string CarrierDataReferenceAsString [get, set]
 Access the byte array that should contain chars forming a number as a string for easier manipulation from within an app. More...
 
List< byte[]> AuxiliaryDataReferenceList [get, set]
 An Auxiliary Data Reference is a pointer to an NDEF record that gives additional information about the alternative carrier. 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 Alternative Carrier record is used within the payload of the Handover Select record to describe a single alternative carrier.

This record essentially describes a single alternative carrier, including its power state and a reference to where further details can be found - this is done by referencing the ID of the other NDEF record within the same handover message. The pointed record may be a Handover Carrier record or a Carrier Configuration record.

Optional Auxiliary Data reference(s) are pointers to NDEF records that contain additional information about the alternative carrier. There are no limitations on the type of record that can be pointed to.

Member Enumeration Documentation

◆ CarrierPowerStates

Enum to conveniently access the 2-bit field that indicates the carrier power state.

Constructor & Destructor Documentation

◆ NdefHandoverAlternativeCarrierRecord() [1/2]

NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.NdefHandoverAlternativeCarrierRecord ( )

Create an empty Alternative Carrier Record.

◆ NdefHandoverAlternativeCarrierRecord() [2/2]

NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.NdefHandoverAlternativeCarrierRecord ( NdefRecord  other)

Create an Alternative Carrier Record based on the record passed through the argument.

Internalizes and parses the payload of the original record. The original record has to be an Alternative Carrier Record as well.

Parameters
otherRecord to copy into this Alternative Carrier Record.
Exceptions
NdefExceptionThrown if attempting to create a Alternative Carrier Record based on an incompatible record type.

Member Function Documentation

◆ AddAuxiliaryDataReference()

void NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.AddAuxiliaryDataReference ( byte []  auxiliaryDataReference)

Convenience method to add another auxiliary data reference to the list. Using this method ensures that the list is already created and updates the payload according to the changes.

If you manually modify the AuxiliaryDataReferenceList, you need to call AssemblePayload() manually when you are finished with changes and want the payload to be synchronized to the properties.

Parameters
auxiliaryDataReferenceThe auxiliary data reference to add. This is the record ID of another record within the Handover Select payload which contains additional information about this alternative carrier.

◆ AssemblePayload()

bool NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.AssemblePayload ( )

Create the payload based on the data stored in the properties. Usually called automatically when changing properties, but you might need to call this manually if you modify the list of auxiliary data references directly without using accessor method provided by this class.

Exceptions
NdefExceptionThrown if unable to assemble the payload. The exception message contains further details about the issue.

◆ CheckIfValid()

override bool NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.CheckIfValid ( )
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.

Exceptions
NdefExceptionThrown if no valid NDEF record can be created based on the record's current contents. The exception message contains further details about the issue.
Returns
True if the record contents are valid, or throws an exception if an issue is found.

Reimplemented from NdefLibrary.Ndef.NdefRecord.

◆ IsRecordType()

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

Checks if the record sent via the parameter is indeed a Handover Alternate Carrier 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 Alternate Carrier record, false if it's a different record.

Member Data Documentation

◆ BtAcType

readonly byte [] NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.BtAcType = Encoding.UTF8.GetBytes("ac")
static

Type of the Alternative Carrier Record.

Property Documentation

◆ AuxiliaryDataReferenceList

List<byte[]> NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.AuxiliaryDataReferenceList
getset

An Auxiliary Data Reference is a pointer to an NDEF record that gives additional information about the alternative carrier.

◆ CarrierDataReference

byte [] NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.CarrierDataReference
getset

The Carrier Data Reference is a pointer to an NDEF record that uniquely identifies the carrier technology.

Reference is the record ID of a Handover Carrier record or a Carrier Configuration Record (can also be a Bluetooth Secure Simple Pairing record)

◆ CarrierDataReferenceAsString

string NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.CarrierDataReferenceAsString
getset

Access the byte array that should contain chars forming a number as a string for easier manipulation from within an app.

◆ CarrierPowerState

CarrierPowerStates NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.CarrierPowerState
getset

2-bit field that indicates the carrier power state.

◆ CarrierPowerStateAsByte

byte NdefLibrary.Ndef.NdefHandoverAlternativeCarrierRecord.CarrierPowerStateAsByte
getset

Access the Carrier Power State property as a byte instead of the enum. Note that according to the current Bluetooth specification (1.3), only two bits of the byte are in use for the Carrier Power State.

If setting a Carrier power state that is not known by the enum, the internal value is set to Unknown.


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