using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WritePageScanPeriodModeInfo : PacketInfoBase
{
	public override string Name => "Write Page Scan Period Mode";

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

	public WritePageScanPeriodModeInfo(WritePageScanPeriodMode packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WritePageScanPeriodMode writePageScanPeriodMode = (WritePageScanPeriodMode)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Page Scan Period Mode", PageScanPeriodModeInfo.PageScanPeriodModeToDescription(), 8, FormatValue(writePageScanPeriodMode.UserFields.PageScanPeriodMode, 8), PageScanPeriodModeInfo.PageScanPeriodModeToString(PageScanPeriodModeInfo.ValueToPageScanPeriodMode(writePageScanPeriodMode.UserFields.PageScanPeriodMode)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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