using System;
using QCRPG.Framework;

namespace QCRPG.TSL.ZigBee.Packets;

public class McpsPurgeRequestInfo : PacketInfoBase
{
	public override string Name => "Mcps Purge Request";

	public override string DisplayGroup => "MCPS Data Packets";

	public McpsPurgeRequestInfo(McpsPurgeRequest packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		McpsPurgeRequest mcpsPurgeRequest = (McpsPurgeRequest)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("msduHandle", "The handle of the MSDU to be purged from the transaction queue", 8, FormatValue(mcpsPurgeRequest.UserFields.Msduhandle, 8), "", "", "FF", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		McpsPurgeRequest mcpsPurgeRequest = (McpsPurgeRequest)packet;
		int num = -1;
		if (index == ++num)
		{
			mcpsPurgeRequest.UserFields.Msduhandle = Convert.ToUInt32(value, 16);
		}
	}
}
