using System;
using QCRPG.Framework;

namespace QCRPG.TSL.ZigBee.Packets;

public class MlmeResetInfo : PacketInfoBase
{
	public override string Name => "Mlme Reset";

	public override string DisplayGroup => "MLME Request Packets";

	public MlmeResetInfo(MlmeReset packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		MlmeReset mlmeReset = (MlmeReset)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("RESET", MlmeReset.UserFieldsWrapper.ResetInfo.ResetToDescription(), 8, FormatValue(mlmeReset.UserFields.Reset, 8), MlmeReset.UserFieldsWrapper.ResetInfo.ResetToString(MlmeReset.UserFieldsWrapper.ResetInfo.ValueToReset(mlmeReset.UserFields.Reset)), "", "2", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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