using System;
using QCRPG.Framework;

namespace QCRPG.TSL.NFC.Packets;

public class RfSetListenModeRoutingRspInfo : PacketInfoBase
{
	public override string Name => "Rf Set Listen Mode Routing Rsp";

	public override string DisplayGroup => "RF Management";

	public RfSetListenModeRoutingRspInfo(RfSetListenModeRoutingRsp packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		RfSetListenModeRoutingRsp rfSetListenModeRoutingRsp = (RfSetListenModeRoutingRsp)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Status", StatusCodesInfo.StatusCodesToDescription(), 8, FormatValue(rfSetListenModeRoutingRsp.UserFields.Status, 8), StatusCodesInfo.StatusCodesToString(StatusCodesInfo.ValueToStatusCodes(rfSetListenModeRoutingRsp.UserFields.Status)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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