using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class ProductIdInfo
{
	public static ProductIdEnum ValueToProductId(uint value)
	{
		return value switch
		{
			1u => ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4000, 
			2u => ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4100, 
			3u => ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4120, 
			4u => ProductIdEnum.SYS_CFG_PROD_ARM_BTS_4025, 
			5u => ProductIdEnum.SYS_CFG_PROD_ARM_BTS_4054, 
			6u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_65, 
			7u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_6501, 
			8u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA6174, 
			9u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA3685, 
			10u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_WCN3990, 
			11u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA4020, 
			12u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA9379, 
			13u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA6290, 
			14u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_ZEAGLE, 
			15u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_WCN3950, 
			17u => ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCC5140, 
			_ => ProductIdEnum.InvalidProductIdValue, 
		};
	}

	public static uint ProductIdToValue(ProductIdEnum enumItem)
	{
		return enumItem switch
		{
			ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4000 => 1u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4100 => 2u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4120 => 3u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BTS_4025 => 4u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BTS_4054 => 5u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_65 => 6u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_6501 => 7u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA6174 => 8u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA3685 => 9u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_WCN3990 => 10u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA4020 => 11u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA9379 => 12u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA6290 => 13u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_ZEAGLE => 14u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_WCN3950 => 15u, 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCC5140 => 17u, 
			_ => uint.MaxValue, 
		};
	}

	public static string ProductIdToString(ProductIdEnum enumItem)
	{
		return enumItem switch
		{
			ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4000 => "SYS_CFG_PROD_ARM_SIW_4000", 
			ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4100 => "SYS_CFG_PROD_ARM_SIW_4100", 
			ProductIdEnum.SYS_CFG_PROD_ARM_SIW_4120 => "SYS_CFG_PROD_ARM_SIW_4120", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BTS_4025 => "SYS_CFG_PROD_ARM_BTS_4025", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BTS_4054 => "SYS_CFG_PROD_ARM_BTS_4054", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_65 => "SYS_CFG_PROD_ARM_BT_65", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_6501 => "SYS_CFG_PROD_ARM_BT_6501", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA6174 => "SYS_CFG_PROD_ARM_BT_QCA6174", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA3685 => "SYS_CFG_PROD_ARM_BT_QCA3685", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_WCN3990 => "SYS_CFG_PROD_ARM_BT_WCN3990", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA4020 => "SYS_CFG_PROD_ARM_BT_QCA4020", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA9379 => "SYS_CFG_PROD_ARM_BT_QCA9379", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCA6290 => "SYS_CFG_PROD_ARM_BT_QCA6290", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_ZEAGLE => "SYS_CFG_PROD_ARM_BT_ZEAGLE", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_WCN3950 => "SYS_CFG_PROD_ARM_BT_WCN3950", 
			ProductIdEnum.SYS_CFG_PROD_ARM_BT_QCC5140 => "SYS_CFG_PROD_ARM_BT_QCC5140", 
			_ => "Invalid ProductId Value", 
		};
	}

	public static string ProductIdToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x1 = SYS_CFG_PROD_ARM_SIW_4000");
		stringBuilder.AppendLine("0x2 = SYS_CFG_PROD_ARM_SIW_4100");
		stringBuilder.AppendLine("0x3 = SYS_CFG_PROD_ARM_SIW_4120");
		stringBuilder.AppendLine("0x4 = SYS_CFG_PROD_ARM_BTS_4025");
		stringBuilder.AppendLine("0x5 = SYS_CFG_PROD_ARM_BTS_4054");
		stringBuilder.AppendLine("0x6 = SYS_CFG_PROD_ARM_BT_65");
		stringBuilder.AppendLine("0x7 = SYS_CFG_PROD_ARM_BT_6501");
		stringBuilder.AppendLine("0x8 = SYS_CFG_PROD_ARM_BT_QCA6174");
		stringBuilder.AppendLine("0x9 = SYS_CFG_PROD_ARM_BT_QCA3685");
		stringBuilder.AppendLine("0xA = SYS_CFG_PROD_ARM_BT_WCN3990");
		stringBuilder.AppendLine("0xB = SYS_CFG_PROD_ARM_BT_QCA4020");
		stringBuilder.AppendLine("0xC = SYS_CFG_PROD_ARM_BT_QCA9379");
		stringBuilder.AppendLine("0xD = SYS_CFG_PROD_ARM_BT_QCA6290");
		stringBuilder.AppendLine("0xE = SYS_CFG_PROD_ARM_BT_ZEAGLE");
		stringBuilder.AppendLine("0xF = SYS_CFG_PROD_ARM_BT_WCN3950");
		stringBuilder.AppendLine("0x11 = SYS_CFG_PROD_ARM_BT_QCC5140");
		return stringBuilder.ToString();
	}
}
