Class NdefMessage
Create a NDEF = NFC Data Exchange Format Message class
public class NdefMessage
- Inheritance
-
NdefMessage
Constructors
NdefMessage()
Create an empty NDEF Message
public NdefMessage()
NdefMessage(SpanByte)
Create NDEF Message from a span of bytes
public NdefMessage(SpanByte message)
Parameters
message
SpanBytethe message in span of bytes
Fields
GeneralPurposeByteNdefVersion
Associated with the GeneralPurposeByteConsitions, it tells if a sector is read/write and a valid NDEF sector
public const byte GeneralPurposeByteNdefVersion = 64
Field Value
Properties
Length
Get the length of the message
public int Length { get; }
Property Value
Records
List of all NDEF Records
public ListNdefRecord Records { get; set; }
Property Value
- ListNdefRecord
Methods
ExtractMessage(SpanByte)
Extract an NDEF message from a raw byte array
public static byte[]? ExtractMessage(SpanByte toExtract)
Parameters
toExtract
SpanByteThe byte array where the message is
Returns
- byte[]
A byte array containing the message itself
GetStartSizeNdef(SpanByte)
From a raw message, find the start and stop of an NDEF message
public static Doublet GetStartSizeNdef(SpanByte toExtract)
Parameters
toExtract
SpanByteThe byte array where the message is
Returns
- Doublet
The start and end position
Serialize(SpanByte)
Serialize the message in a span of bytes
public void Serialize(SpanByte messageSerialized)
Parameters
messageSerialized
SpanByteSpan of bytes for the serialized message