using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class CommandCompleteForProdTestStatsInfo : PacketInfoBase
{
	public override string Name => "Command Complete For Prod Test Stats";

	public override string DisplayGroup => "Vendor Specific";

	public CommandCompleteForProdTestStatsInfo(CommandCompleteForProdTestStats packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		CommandCompleteForProdTestStats commandCompleteForProdTestStats = (CommandCompleteForProdTestStats)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Num HCI Command Packets", "", 8, FormatValue(commandCompleteForProdTestStats.UserFields.NumHciCommandPackets, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Command OpCode", CommandOpcodeInfo.CommandOpcodeToDescription(), 16, FormatValue(commandCompleteForProdTestStats.UserFields.CommandOpcode, 16), CommandOpcodeInfo.CommandOpcodeToString(CommandOpcodeInfo.ValueToCommandOpcode(commandCompleteForProdTestStats.UserFields.CommandOpcode)), "", "", settable: false, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Status", ErrorCodeInfo.ErrorCodeToDescription(), 8, FormatValue(commandCompleteForProdTestStats.UserFields.Status, 8), ErrorCodeInfo.ErrorCodeToString(ErrorCodeInfo.ValueToErrorCode(commandCompleteForProdTestStats.UserFields.Status)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Command", "", 8, FormatValue(commandCompleteForProdTestStats.UserFields.Command, 8), "", "", "", settable: false, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Received Packets", "", 16, FormatValue(commandCompleteForProdTestStats.UserFields.ReceivedPackets, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch1 Packets Received", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch1PacketsReceived, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch1 Packet Access Error Code", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch1PacketAccessErrorCode, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch1 HEC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch1HecErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch1 CRC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch1CrcErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch1 Total commandCompletePacket Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch1TotalCommandcompletepacketBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch1 First Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch1FirstHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch1 Last Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch1LastHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch1 RSSI Reading", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch1RssiReading, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch2 commandCompletePackets Received", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch2CommandcompletepacketsReceived, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch2 commandCompletePacket Access Error Code", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch2CommandcompletepacketAccessErrorCode, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch2 HEC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch2HecErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch2 CRC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch2CrcErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch2 Total commandCompletePacket Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch2TotalCommandcompletepacketBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch2 First Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch2FirstHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch2 Last Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch2LastHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch2 RSSI Reading", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch2RssiReading, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch3 commandCompletePackets Received", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch3CommandcompletepacketsReceived, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch3 commandCompletePacket Access Error Code", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch3CommandcompletepacketAccessErrorCode, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch3 HEC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch3HecErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch3 CRC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch3CrcErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch3 Total commandCompletePacket Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch3TotalCommandcompletepacketBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch3 First Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch3FirstHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch3 Last Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch3LastHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch3 RSSI Reading", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch3RssiReading, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch4 commandCompletePackets Received", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch4CommandcompletepacketsReceived, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch4 commandCompletePacket Access Error Code", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch4CommandcompletepacketAccessErrorCode, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch4 HEC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch4HecErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch4 CRC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch4CrcErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch4 Total commandCompletePacket Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch4TotalCommandcompletepacketBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch4 First Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch4FirstHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch4 Last Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch4LastHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch4 RSSI Reading", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch4RssiReading, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch5 commandCompletePackets Received", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch5CommandcompletepacketsReceived, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch5 commandCompletePacket Access Error Code", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch5CommandcompletepacketAccessErrorCode, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch5 HEC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch5HecErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch5 CRC Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch5CrcErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch5 Total commandCompletePacket Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch5TotalCommandcompletepacketBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch5 First Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch5FirstHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch5 Last Half Bit Errors", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch5LastHalfBitErrors, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Ch5 RSSI Reading", "", 32, FormatValue(commandCompleteForProdTestStats.UserFields.Ch5RssiReading, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		CommandCompleteForProdTestStats commandCompleteForProdTestStats = (CommandCompleteForProdTestStats)packet;
		int num = -1;
		if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.NumHciCommandPackets = Convert.ToUInt32(value, 16);
			return;
		}
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field CommandOpcode");
		}
		if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Status = Convert.ToUInt32(value, 16);
			return;
		}
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field Command");
		}
		if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.ReceivedPackets = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch1PacketsReceived = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch1PacketAccessErrorCode = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch1HecErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch1CrcErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch1TotalCommandcompletepacketBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch1FirstHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch1LastHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch1RssiReading = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch2CommandcompletepacketsReceived = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch2CommandcompletepacketAccessErrorCode = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch2HecErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch2CrcErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch2TotalCommandcompletepacketBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch2FirstHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch2LastHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch2RssiReading = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch3CommandcompletepacketsReceived = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch3CommandcompletepacketAccessErrorCode = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch3HecErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch3CrcErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch3TotalCommandcompletepacketBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch3FirstHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch3LastHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch3RssiReading = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch4CommandcompletepacketsReceived = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch4CommandcompletepacketAccessErrorCode = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch4HecErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch4CrcErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch4TotalCommandcompletepacketBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch4FirstHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch4LastHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch4RssiReading = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch5CommandcompletepacketsReceived = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch5CommandcompletepacketAccessErrorCode = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch5HecErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch5CrcErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch5TotalCommandcompletepacketBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch5FirstHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch5LastHalfBitErrors = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			commandCompleteForProdTestStats.UserFields.Ch5RssiReading = Convert.ToUInt32(value, 16);
		}
	}
}
