SpringCard PC/SC Helpers for .NET  18.10.10
High-level access to a few current cards and to advanced coupler features
SpringCard.NfcForum.Ndef.NdefObject Class Reference
Inheritance diagram for SpringCard.NfcForum.Ndef.NdefObject:
SpringCard.NfcForum.Ndef.AbsoluteUri SpringCard.NfcForum.Ndef.Rtd SpringCard.NfcForum.Ndef.RtdAlternativeCarrier SpringCard.NfcForum.Ndef.RtdHandoverSelector SpringCard.NfcForum.Ndef.RtdMedia SpringCard.NfcForum.Ndef.RtdSmartPoster SpringCard.NfcForum.Ndef.RtdSmartPosterAction SpringCard.NfcForum.Ndef.RtdSmartPosterTargetIcon SpringCard.NfcForum.Ndef.RtdSmartPosterTargetSize SpringCard.NfcForum.Ndef.RtdSmartPosterTargetType SpringCard.NfcForum.Ndef.RtdText SpringCard.NfcForum.Ndef.RtdUri

Public Member Functions

 NdefObject (NdefObject ndef)
 
 NdefObject (byte _TNF, string _TYPE)
 
 NdefObject (byte _TNF, string _TYPE, byte[] _PAYLOAD)
 
 NdefObject (byte _TNF, string _TYPE, byte[] ID, byte[] _PAYLOAD)
 
 NdefObject (byte _TNF, byte[] _TYPE, byte[] ID, byte[] _PAYLOAD)
 
void SetMessageBegin (bool mb)
 
void SetMessageEnd (bool me)
 
int Size (ref bool is_short_record)
 
byte [] GetBytes (bool isBegin, bool isEnd)
 
byte [] GetBytes ()
 
virtual bool Encode (ref byte[] buffer)
 
delegate void NdefFoundCallback (NdefObject ndef)
 

Static Public Member Functions

static bool Parse (byte[] buffer, NdefFoundCallback callback)
 
static bool Parse (byte[] buffer, ref int offset, ref NdefObject ndef, ref bool terminated)
 
static NdefObject [] Parse (byte[] buffer)
 

Public Attributes

const byte MESSAGE_BEGIN = 0x80
 
const byte MESSAGE_END = 0x40
 
const byte CHUNK_FLAG = 0x20
 
const byte SHORT_RECORD = 0x10
 
const byte ID_LENGTH_PRESENT = 0x08
 
const byte TNF_MASK = 0x07
 
const byte TNF_EMPTY = 0x00
 
const byte TNF_NFC_RTD_WKN = 0x01
 
const byte TNF_MEDIA_TYPE = 0x02
 
const byte TNF_ABSOLUTE_URI = 0x03
 
const byte TNF_NFC_RTD_EXT = 0x04
 
const byte TNF_UNKNOWN = 0x05
 
const byte TNF_UNCHANGED = 0x06
 
const byte TNF_RESERVED = 0x07
 

Protected Attributes

byte [] _payload = null
 
List< NdefObject_children = new List<NdefObject>()
 

Properties

byte TNF [get, set]
 
string TYPE [get, set]
 
byte [] ID [get, set]
 
byte [] PAYLOAD [get, set]
 

Detailed Description

c* SpringCard.NfcForum.Ndef/NdefObject

NAME Ndef

DESCRIPTION Represents a NDEF message, or portion of message

DERIVED BY Rtd

SYNOPSIS Ndef ndef = new Ndef(bytes[]) Ndef ndef = new Ndef(byte TNF, string TYPE) Ndef ndef = new Ndef(byte TNF, string TYPE, byte[] PAYLOAD) Ndef ndef = new Ndef(Ndef ndef)

Member Function Documentation

◆ Encode()

virtual bool SpringCard.NfcForum.Ndef.NdefObject.Encode ( ref byte []  buffer)
virtual

m* SpringCard.NfcForum.Ndef/NdefObject.Encode

SYNOPSIS public virtual bool Encode(ref byte[] buffer)

DESCRIPTION Serializes the NDEF and returns true if the operation succeeds

Reimplemented in SpringCard.NfcForum.Ndef.RtdVCard, SpringCard.NfcForum.Ndef.RtdSmartPoster, SpringCard.NfcForum.Ndef.RtdHandoverSelector, and SpringCard.NfcForum.Ndef.RtdAlternativeCarrier.

◆ GetBytes()

byte [] SpringCard.NfcForum.Ndef.NdefObject.GetBytes ( bool  isBegin,
bool  isEnd 
)

m* SpringCard.NfcForum.Ndef/NdefObject.GetBytes

SYNOPSIS public byte[] GetBytes(bool isBegin, bool isEnd) public byte[] GetBytes()

DESCRIPTION Uses the "Encode" method to serialize the ndef and returns the byte array. The two parameters isBegin and isEnd indicate if the NDEF is the first or the last in a series of NDEF

SEE ALSO Ndef.Encode

◆ NdefFoundCallback()

delegate void SpringCard.NfcForum.Ndef.NdefObject.NdefFoundCallback ( NdefObject  ndef)

m* SpringCard.NfcForum.Ndef/NdefObject.NdefFoundCallback

SYNOPSIS public delegate void NdefFoundCallback(Ndef ndef)

DESCRIPTION Specifies the callback that will be called once a NDEF is found

SEE ALSO Ndef.Parse

◆ Parse()

static bool SpringCard.NfcForum.Ndef.NdefObject.Parse ( byte []  buffer,
NdefFoundCallback  callback 
)
static

m* SpringCard.NfcForum.Ndef/NdefObject.Parse

SYNOPSIS public static bool Parse(byte [] buffer, NdefFoundCallback callback) public static bool Parse(byte[] buffer, ref int offset, ref Ndef ndef, ref bool terminated) public static Ndef[] Parse(byte[] buffer)

DESCRIPTION Analyses a bytes array to retrieve one or several NDEFs in it

SEE ALSO Ndef.Parse

◆ SetMessageBegin()

void SpringCard.NfcForum.Ndef.NdefObject.SetMessageBegin ( bool  mb)

m* SpringCard.NfcForum.Ndef/NdefObject.SetMessageBegin

SYNOPSIS public void SetMessageBegin(bool mb)

DESCRIPTION Sets the "MESSAGE BEGIN" bit in header

SEE ALSO Ndef.SetMessageEnd

◆ SetMessageEnd()

void SpringCard.NfcForum.Ndef.NdefObject.SetMessageEnd ( bool  me)

m* SpringCard.NfcForum.Ndef/NdefObject.SetMessageEnd

SYNOPSIS public void SetMessageEnd(bool me)

DESCRIPTION Sets the "MESSAGE END" bit in header

SEE ALSO Ndef.SetMessageBegin

◆ Size()

int SpringCard.NfcForum.Ndef.NdefObject.Size ( ref bool  is_short_record)

m* SpringCard.NfcForum.Ndef/NdefObject.Size

SYNOPSIS public int Size(ref bool is_short_record)

DESCRIPTION Calculates the size in bytes of the whole NDEF The parameter is_short_record indicates if the NDEF is a short record (length of payload < 256)

Property Documentation

◆ ID

byte [] SpringCard.NfcForum.Ndef.NdefObject.ID
getset

v* SpringCard.NfcForum.Ndef/NdefObject.ID

SYNOPSIS public byte[] ID

DESCRIPTION Gets and sets the Id of the NDEF

◆ PAYLOAD

byte [] SpringCard.NfcForum.Ndef.NdefObject.PAYLOAD
getset

v* SpringCard.NfcForum.Ndef/NdefObject.PAYLOAD

SYNOPSIS public byte[] PAYLOAD

DESCRIPTION Gets and sets the Payload of the NDEF

◆ TNF

byte SpringCard.NfcForum.Ndef.NdefObject.TNF
getset

v* SpringCard.NfcForum.Ndef/NdefObject.TNF

SYNOPSIS public byte TNF

DESCRIPTION Gets and sets the Type Name Format of the NDEF

◆ TYPE

string SpringCard.NfcForum.Ndef.NdefObject.TYPE
getset

v* SpringCard.NfcForum.Ndef/NdefObject.TYPE

SYNOPSIS public string TYPE

DESCRIPTION Gets and sets the Type of the NDEF


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