using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WriteScoFlowControlEnableInfo : PacketInfoBase
{
	public override string Name => "Write Sco Flow Control Enable";

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

	public WriteScoFlowControlEnableInfo(WriteScoFlowControlEnable packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WriteScoFlowControlEnable writeScoFlowControlEnable = (WriteScoFlowControlEnable)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Synchronous Flow Control Enable", WriteScoFlowControlEnable.UserFieldsWrapper.SynchronousFlowControlEnableInfo.SynchronousFlowControlEnableToDescription(), 8, FormatValue(writeScoFlowControlEnable.UserFields.SynchronousFlowControlEnable, 8), WriteScoFlowControlEnable.UserFieldsWrapper.SynchronousFlowControlEnableInfo.SynchronousFlowControlEnableToString(WriteScoFlowControlEnable.UserFieldsWrapper.SynchronousFlowControlEnableInfo.ValueToSynchronousFlowControlEnable(writeScoFlowControlEnable.UserFields.SynchronousFlowControlEnable)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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