using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class HciVsSsScoLoopbackInfo : PacketInfoBase
{
	public override string Name => "Hci Vs Ss Sco Loopback";

	public override string DisplayGroup => "Vendor Specific";

	public HciVsSsScoLoopbackInfo(HciVsSsScoLoopback packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		HciVsSsScoLoopback hciVsSsScoLoopback = (HciVsSsScoLoopback)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Loopback_Mode", HciVsSsScoLoopback.UserFieldsWrapper.LoopbackModeInfo.LoopbackModeToDescription(), 8, FormatValue(hciVsSsScoLoopback.UserFields.LoopbackMode, 8), HciVsSsScoLoopback.UserFieldsWrapper.LoopbackModeInfo.LoopbackModeToString(HciVsSsScoLoopback.UserFieldsWrapper.LoopbackModeInfo.ValueToLoopbackMode(hciVsSsScoLoopback.UserFields.LoopbackMode)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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