using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class LeSetHostChannelClassificationInfo : PacketInfoBase
{
	public override string Name => "Le Set Host Channel Classification";

	public override string DisplayGroup => "LE Controller";

	public LeSetHostChannelClassificationInfo(LeSetHostChannelClassification packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LeSetHostChannelClassification leSetHostChannelClassification = (LeSetHostChannelClassification)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Channel_Map", "This parameter contains 37 1-bit fields. The nth such field (in the range 0 to 36) contains the value for the link layer channel index n.  Channel n is bad = 0. Channel n is unknown = 1.  The most significant bits are reserved and shall be set to 0. At least one channel shall be marked as unknown", 40, FormatValue(leSetHostChannelClassification.UserFields.ChannelMap, 40), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		LeSetHostChannelClassification leSetHostChannelClassification = (LeSetHostChannelClassification)packet;
		int num = -1;
		if (index == ++num)
		{
			leSetHostChannelClassification.UserFields.ChannelMap = Convert.ToUInt64(value, 16);
		}
	}
}
