using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class LeRemoveIsoDataPathInfo : PacketInfoBase
{
	public override string Name => "Le Remove Iso Data Path";

	public override string DisplayGroup => "LE Controller";

	public LeRemoveIsoDataPathInfo(LeRemoveIsoDataPath packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LeRemoveIsoDataPath leRemoveIsoDataPath = (LeRemoveIsoDataPath)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Connection_Handle", "", 16, FormatValue(leRemoveIsoDataPath.UserFields.ConnectionHandle, 16), "", "0000", "0EFF", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Data_Path_Direction", LeRemoveIsoDataPath.UserFieldsWrapper.DataPathDirectionInfo.DataPathDirectionToDescription(), 8, FormatValue(leRemoveIsoDataPath.UserFields.DataPathDirection, 8), LeRemoveIsoDataPath.UserFieldsWrapper.DataPathDirectionInfo.DataPathDirectionToString(LeRemoveIsoDataPath.UserFieldsWrapper.DataPathDirectionInfo.ValueToDataPathDirection(leRemoveIsoDataPath.UserFields.DataPathDirection)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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