using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WriteInquiryScanTypeInfo : PacketInfoBase
{
	public override string Name => "Write Inquiry Scan Type";

	public override string DisplayGroup => "Host Control and Baseband";

	public WriteInquiryScanTypeInfo(WriteInquiryScanType packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WriteInquiryScanType writeInquiryScanType = (WriteInquiryScanType)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Inquiry Scan Type", WriteInquiryScanType.UserFieldsWrapper.InquiryScanTypeInfo.InquiryScanTypeToDescription(), 8, FormatValue(writeInquiryScanType.UserFields.InquiryScanType, 8), WriteInquiryScanType.UserFieldsWrapper.InquiryScanTypeInfo.InquiryScanTypeToString(WriteInquiryScanType.UserFieldsWrapper.InquiryScanTypeInfo.ValueToInquiryScanType(writeInquiryScanType.UserFields.InquiryScanType)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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