Files
tbf/NfcC7_DLL/NfcHanler/Protocols/NfcCommand_NdefRead.cs
T

69 lines
2.2 KiB
C#

using System.ComponentModel;
using Sensus;
using Sensus.Protocols.FlexNet;
using Sensus.Protocols.FlexNet.FNv2;
namespace NfcC7_DLL.NfcHanler.Protocols
{
[NA2WSerialProtocolCommand(NfcCommand_NdefRead._Code, NfcCommand_NdefRead._Version)]
public class NfcCommand_NdefRead : BackedHeaders, INA2WSerialProtocolCommand
{
public const byte _Size = 1;
public const DataLinkFrameType _FrameType = DataLinkFrameType.Command;
public const byte _Code = 0x26;
public const byte _Version = 0x01; // Use Sub Command field value
public NfcCommand_NdefRead() : base(_Size)
{
SubCommand = _Version;
}
public NfcCommand_NdefRead(Func<byte[]> buffer, Func<UInt32> offset) : base(buffer, offset)
{
SubCommand = _Version;
}
public static NfcCommand_NdefRead Parse(byte[] buffer, UInt32 offset, UInt32 length)
{
return Parse<NfcCommand_NdefRead>(buffer, offset, length);
}
protected override void Initialize(UInt32 wholeMessageLength)
{
base.Initialize(wholeMessageLength);
}
public override void Bake()
{
base.Bake();
}
IFrame IFrame.Clone()
{
return Parse(Buffer, Offset, _Size);
}
public T Unwrap<T>()
{
return default(T);
}
[Browsable(false)]
public override uint Size { get { return _Size; } set { } }
[Browsable(false)]
public DataLinkFrameType FrameType { get { return _FrameType; } }
[Browsable(false)]
public byte CommandCode { get { return _Code; } }
[Browsable(false)]
public UInt32 PayloadLength { get; private set; }
public byte Version { get { return Buffer.Read<byte>((Offset + 0) * 8 + 0, 4); } set { Buffer.Write(value, (Offset + 0) * 8 + 0, 4); } }
public byte Reserved0 { get { return Buffer.Read<byte>((Offset + 0) * 8 + 4, 4); } set { Buffer.Write(value, (Offset + 0) * 8 + 4, 4); } }
public byte SubCommand { get { return Buffer.Read<byte>((Offset + 0) * 8 + 0, 8); } set { Buffer.Write(value, (Offset + 0) * 8 + 0, 8); } }
}
}