using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class LeIsoTestEndInfo : PacketInfoBase
{
	public override string Name => "Le Iso Test End";

	public override string DisplayGroup => "LE Controller";

	public LeIsoTestEndInfo(LeIsoTestEnd packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LeIsoTestEnd leIsoTestEnd = (LeIsoTestEnd)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Connection_Handle", "", 16, FormatValue(leIsoTestEnd.UserFields.ConnectionHandle, 16), "", "0000", "0EFF", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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