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

Create an NDEF record for Bluetooth Carrier Handover according to the "Secure Simple Pairing" mechanism defined by the Bluetooth SIG. More...

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

Classes

class  BtClassOfDevice
 Defines the Class of Device information data. This is to be used to provide a graphical representation to the user as part of UI involving operations with Bluetooth devices. For example, it may provide a particular icon to represent the device. More...
 
class  BtServiceClasses
 Utility class to handle the Bluetooth Service Classes defined in the OOB data of the Secure Simple Pairing Record. More...
 

Public Types

enum  OobDataTypes : byte {
  IncompleteList16BitServiceClassUuids = (byte)0x02, CompleteList16BitServiceClassUuids = (byte)0x03, IncompleteList32BitServiceClassUuids = (byte)0x04, CompleteList32BitServiceClassUuids = (byte)0x05,
  IncompleteList128BitServiceClassUuids = (byte)0x06, CompleteList128BitServiceClassUuids = (byte)0x07, ShortenedLocalName = (byte)0x08, CompleteLocalName = (byte)0x09,
  ClassOfDevice = (byte)0x0D, SimplePairingHashC = (byte)0x0E, SimplePairingRandomizerR = (byte)0x0F
}
 IDs of OOB Data according to the Bluetooth Generic Access Profile (GAP). 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

 NdefBtSecureSimplePairingRecord ()
 Create an empty Bluetooth Secure Simple Pairing / Carrier Configuration record. More...
 
 NdefBtSecureSimplePairingRecord (NdefRecord other)
 Create a Bluetooth Secure Simple Pairing / Carrier Configuration record based on the record passed through the argument. 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 Bluetooth Secure Simple Pairing / Carrier Configuration Record. Only checks the type and type name format, doesn't analyze if the payload is valid. More...
 

Static Public Attributes

static readonly byte [] BtOobType = Encoding.UTF8.GetBytes("application/vnd.bluetooth.ep.oob")
 Type of the Bluetooth Carrier Configuration Record. More...
 

Properties

byte [] BtDeviceAddress [get, set]
 Bluetooth device address. More...
 
string BtDeviceAddressString [get, set]
 Get / set the Bluetooth device address as a hex string instead of the byte array. The address string is in a format like "00:0c:78:51:c4:06". More...
 
string CompleteLocalName [get, set]
 The complete local device name / friendly name of the Bluetooth device. This is usually shown to the user during a Bluetooth search or when attempting to establish a connection to the device. More...
 
BtClassOfDevice ClassOfDevice [get, set]
 The Bluetooth Class of Device information, which is used to provide a graphical representation to the user as part of UI involving operations with Bluetooth devices. More...
 
BtServiceClasses ServiceClasses [get, set]
 Defines the supported Bluetooth services of the device. More...
 
byte [] SimplePairingHashC [get, set]
 The optional Simple Pairing Hash C can be used to facilitate the pairing process. More...
 
byte [] SimplePairingRandomizerR [get, set]
 The optional Simple Pairing Randomizer to facilitate pairing. 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

Create an NDEF record for Bluetooth Carrier Handover according to the "Secure Simple Pairing" mechanism defined by the Bluetooth SIG.

This record is usually written on static NFC tags that facilitate Bluetooth handover, as found in speakers or headsets. It enables devices to establish a Bluetooth connection by tapping the NFC tag, without having to manually start a device & service search.

The record has to define at least the Bluetooth device address. In addition, it usually contains additional optional Bluetooth OOB (Out-Of-Band) data - for example the friendly device name, information about the device class as well as supported services.

In some cases, also a pairing hash and randomizer can be supplied.

The class represents a complete implementation, including all currently standardized services and device classes as per May 20th, 2014 and defined at: https://www.bluetooth.org/en-us/specification/assigned-numbers In addition, it provides convenient look-up functions and definitions to work with the numerous different defined classes and services.

The record is implemented according to the specification published by the NFC Forum. The record is defined as a Media-type per RFC2046, its payload by the Extended Inquiry Response (EIR) format specified in the Bluetooth Core Specification, Volume 3, Part C, Section 8.

For information regards to compatibility with the Windows platform: http://msdn.microsoft.com/en-us/library/windows/hardware/dn482419%28v=vs.85%29.aspx Supported protocols in Windows: http://msdn.microsoft.com/en-us/library/windows/hardware/jj866066%28v=vs.85%29.aspx

Member Enumeration Documentation

◆ OobDataTypes

IDs of OOB Data according to the Bluetooth Generic Access Profile (GAP).

The OOB (Bluetooth Out Of Band) data consists of several data blocks. Each data block first specifies the data block length, then this ID, and then the data type specific payload data (e.g., the local device name). https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile

Constructor & Destructor Documentation

◆ NdefBtSecureSimplePairingRecord() [1/2]

NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.NdefBtSecureSimplePairingRecord ( )

Create an empty Bluetooth Secure Simple Pairing / Carrier Configuration record.

◆ NdefBtSecureSimplePairingRecord() [2/2]

NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.NdefBtSecureSimplePairingRecord ( NdefRecord  other)

Create a Bluetooth Secure Simple Pairing / Carrier Configuration 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 Bluetooth Carrier Configuration Record as well.

Parameters
otherRecord to copy into this Secure Simple Pairing record.
Exceptions
NdefExceptionThrown if attempting to create an Secure Simple Pairing Record based on an incompatible record type.

Member Function Documentation

◆ IsRecordType()

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

Checks if the record sent via the parameter is indeed a Bluetooth Secure Simple Pairing / Carrier Configuration Record. Only checks the type and type name format, doesn't analyze if the payload is valid.

Parameters
recordRecord to check.
Returns
True if the record has the correct type and type name format to be a Bluetooth Secure Simple Pairing / Carrier Configuration Record, false if it's a different record.

Member Data Documentation

◆ BtOobType

readonly byte [] NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.BtOobType = Encoding.UTF8.GetBytes("application/vnd.bluetooth.ep.oob")
static

Type of the Bluetooth Carrier Configuration Record.

Property Documentation

◆ BtDeviceAddress

byte [] NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.BtDeviceAddress
getset

Bluetooth device address.

Encoded in little endian order. For example, the Bluetooth Address 00:0c:78:51:c4:06 would be encoded as 0x06 0xC4 0x51 0x78 0x0C 0x00.

◆ BtDeviceAddressString

string NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.BtDeviceAddressString
getset

Get / set the Bluetooth device address as a hex string instead of the byte array. The address string is in a format like "00:0c:78:51:c4:06".

◆ ClassOfDevice

BtClassOfDevice NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.ClassOfDevice
getset

The Bluetooth Class of Device information, which is used to provide a graphical representation to the user as part of UI involving operations with Bluetooth devices.

For example, the UI may show a particular icon to represent the device, which is chosen based on the class of device defined by this property.

◆ CompleteLocalName

string NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.CompleteLocalName
getset

The complete local device name / friendly name of the Bluetooth device. This is usually shown to the user during a Bluetooth search or when attempting to establish a connection to the device.

◆ ServiceClasses

BtServiceClasses NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.ServiceClasses
getset

Defines the supported Bluetooth services of the device.

The service classes can be represented as 16 / 32 / 128 bit UUIDs. For standardized services, usually 16 bit UUIDs are used. The class contains a convenient enumeration for the currently standardized service classes.

◆ SimplePairingHashC

byte [] NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.SimplePairingHashC
getset

The optional Simple Pairing Hash C can be used to facilitate the pairing process.

The Hash C should be generated anew for each pairing - this is usually not possible on passive & static NFC Forum tags.

◆ SimplePairingRandomizerR

byte [] NdefLibrary.Ndef.NdefBtSecureSimplePairingRecord.SimplePairingRandomizerR
getset

The optional Simple Pairing Randomizer to facilitate pairing.


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