using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class LeSendAoaRequestEnableInfo : PacketInfoBase
{
	public override string Name => "Le Send Aoa Request Enable";

	public override string DisplayGroup => "LE Controller";

	public LeSendAoaRequestEnableInfo(LeSendAoaRequestEnable packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LeSendAoaRequestEnable leSendAoaRequestEnable = (LeSendAoaRequestEnable)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Connection_Handle", "Connection_Handle to be used to identify a connection. Range 0x0000-0x0EFF (0x0F00 - 0x0FFF Reserved for future use)", 16, FormatValue(leSendAoaRequestEnable.UserFields.ConnectionHandle, 16), "", "0EFF", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Enable", LeSendAoaRequestEnable.UserFieldsWrapper.EnableInfo.EnableToDescription(), 8, FormatValue(leSendAoaRequestEnable.UserFields.Enable, 8), LeSendAoaRequestEnable.UserFieldsWrapper.EnableInfo.EnableToString(LeSendAoaRequestEnable.UserFieldsWrapper.EnableInfo.ValueToEnable(leSendAoaRequestEnable.UserFields.Enable)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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