using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WriteInquiryModeInfo : PacketInfoBase
{
	public override string Name => "Write Inquiry Mode";

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

	public WriteInquiryModeInfo(WriteInquiryMode packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WriteInquiryMode writeInquiryMode = (WriteInquiryMode)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Inquiry Mode", WriteInquiryMode.UserFieldsWrapper.InquiryModeInfo.InquiryModeToDescription(), 8, FormatValue(writeInquiryMode.UserFields.InquiryMode, 8), WriteInquiryMode.UserFieldsWrapper.InquiryModeInfo.InquiryModeToString(WriteInquiryMode.UserFieldsWrapper.InquiryModeInfo.ValueToInquiryMode(writeInquiryMode.UserFields.InquiryMode)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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