using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class SetTestModeAddressInfo : PacketInfoBase
{
	public override string Name => "Set Test Mode Address";

	public override string DisplayGroup => "Vendor Specific";

	public SetTestModeAddressInfo(SetTestModeAddress packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		SetTestModeAddress setTestModeAddress = (SetTestModeAddress)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Access Address", "", 32, FormatValue(setTestModeAddress.UserFields.AccessAddress, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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