using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class LeSetAdvertiseEnabledInfo : PacketInfoBase
{
	public override string Name => "Le Set Advertise Enabled";

	public override string DisplayGroup => "LE Controller";

	public LeSetAdvertiseEnabledInfo(LeSetAdvertiseEnabled packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LeSetAdvertiseEnabled leSetAdvertiseEnabled = (LeSetAdvertiseEnabled)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Advertising_Enable", AdvertisingEnableInfo.AdvertisingEnableToDescription(), 8, FormatValue(leSetAdvertiseEnabled.UserFields.AdvertisingEnable, 8), AdvertisingEnableInfo.AdvertisingEnableToString(AdvertisingEnableInfo.ValueToAdvertisingEnable(leSetAdvertiseEnabled.UserFields.AdvertisingEnable)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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