using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class DbfwLmpDebugInfoInfo : PacketInfoBase
{
	public override string Name => "Dbfw Lmp Debug Info";

	public override string DisplayGroup => "Vendor Specific";

	public DbfwLmpDebugInfoInfo(DbfwLmpDebugInfo packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		DbfwLmpDebugInfo dbfwLmpDebugInfo = (DbfwLmpDebugInfo)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("DBFW_Event_Code", "DBFW debug event", 8, FormatValue(dbfwLmpDebugInfo.UserFields.DbfwEventCode, 8), "", "", "", settable: false, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Sub_Event_Code", "DBFW SCO debug info", 8, FormatValue(dbfwLmpDebugInfo.UserFields.SubEventCode, 8), "", "", "", settable: false, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Payload0", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.Payload0, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("First_Clock0", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.FirstClock0, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Last_Clock0", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.LastClock0, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Retransmission_Count0", "", 8, FormatValue(dbfwLmpDebugInfo.UserFields.RetransmissionCount0, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Various_Info0", DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo0Info.VariousInfo0ToDescription(), 8, FormatValue(dbfwLmpDebugInfo.UserFields.VariousInfo0, 8), DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo0Info.VariousInfo0ToString(DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo0Info.ValueToVariousInfo0(dbfwLmpDebugInfo.UserFields.VariousInfo0)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ack_Infomation0", DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation0Info.AckInfomation0ToDescription(), 8, FormatValue(dbfwLmpDebugInfo.UserFields.AckInfomation0, 8), DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation0Info.AckInfomation0ToString(DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation0Info.ValueToAckInfomation0(dbfwLmpDebugInfo.UserFields.AckInfomation0)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Payload1", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.Payload1, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("First_Clock1", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.FirstClock1, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Last_Clock1", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.LastClock1, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Retransmission_Count1", "", 8, FormatValue(dbfwLmpDebugInfo.UserFields.RetransmissionCount1, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Various_Info1", DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo1Info.VariousInfo1ToDescription(), 8, FormatValue(dbfwLmpDebugInfo.UserFields.VariousInfo1, 8), DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo1Info.VariousInfo1ToString(DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo1Info.ValueToVariousInfo1(dbfwLmpDebugInfo.UserFields.VariousInfo1)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ack_Infomation1", DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation1Info.AckInfomation1ToDescription(), 8, FormatValue(dbfwLmpDebugInfo.UserFields.AckInfomation1, 8), DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation1Info.AckInfomation1ToString(DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation1Info.ValueToAckInfomation1(dbfwLmpDebugInfo.UserFields.AckInfomation1)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Payload2", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.Payload2, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("First_Clock2", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.FirstClock2, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Last_Clock2", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.LastClock2, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Retransmission_Count2", "", 8, FormatValue(dbfwLmpDebugInfo.UserFields.RetransmissionCount2, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Various_Info2", DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo2Info.VariousInfo2ToDescription(), 8, FormatValue(dbfwLmpDebugInfo.UserFields.VariousInfo2, 8), DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo2Info.VariousInfo2ToString(DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo2Info.ValueToVariousInfo2(dbfwLmpDebugInfo.UserFields.VariousInfo2)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ack_Infomation2", DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation2Info.AckInfomation2ToDescription(), 8, FormatValue(dbfwLmpDebugInfo.UserFields.AckInfomation2, 8), DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation2Info.AckInfomation2ToString(DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation2Info.ValueToAckInfomation2(dbfwLmpDebugInfo.UserFields.AckInfomation2)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Payload3", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.Payload3, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("First_Clock3", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.FirstClock3, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Last_Clock3", "", 32, FormatValue(dbfwLmpDebugInfo.UserFields.LastClock3, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Retransmission_Count3", "", 8, FormatValue(dbfwLmpDebugInfo.UserFields.RetransmissionCount3, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Various_Info3", DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo3Info.VariousInfo3ToDescription(), 8, FormatValue(dbfwLmpDebugInfo.UserFields.VariousInfo3, 8), DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo3Info.VariousInfo3ToString(DbfwLmpDebugInfo.UserFieldsWrapper.VariousInfo3Info.ValueToVariousInfo3(dbfwLmpDebugInfo.UserFields.VariousInfo3)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ack_Infomation3", DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation3Info.AckInfomation3ToDescription(), 8, FormatValue(dbfwLmpDebugInfo.UserFields.AckInfomation3, 8), DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation3Info.AckInfomation3ToString(DbfwLmpDebugInfo.UserFieldsWrapper.AckInfomation3Info.ValueToAckInfomation3(dbfwLmpDebugInfo.UserFields.AckInfomation3)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		DbfwLmpDebugInfo dbfwLmpDebugInfo = (DbfwLmpDebugInfo)packet;
		int num = -1;
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field DbfwEventCode");
		}
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field SubEventCode");
		}
		if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.Payload0 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.FirstClock0 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.LastClock0 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.RetransmissionCount0 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.VariousInfo0 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.AckInfomation0 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.Payload1 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.FirstClock1 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.LastClock1 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.RetransmissionCount1 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.VariousInfo1 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.AckInfomation1 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.Payload2 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.FirstClock2 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.LastClock2 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.RetransmissionCount2 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.VariousInfo2 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.AckInfomation2 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.Payload3 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.FirstClock3 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.LastClock3 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.RetransmissionCount3 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.VariousInfo3 = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			dbfwLmpDebugInfo.UserFields.AckInfomation3 = Convert.ToUInt32(value, 16);
		}
	}
}
