using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WritePageTimeoutInfo : PacketInfoBase
{
	public override string Name => "Write Page Timeout";

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

	public WritePageTimeoutInfo(WritePageTimeout packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WritePageTimeout writePageTimeout = (WritePageTimeout)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Page Timeout", "Page Timeout measured in Number of BR/EDR Baseband slots.", 16, FormatValue(writePageTimeout.UserFields.PageTimeout, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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