using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class EnhancedlogidInfo
{
	public static EnhancedlogidEnum ValueToEnhancedlogid(uint value)
	{
		return value switch
		{
			768u => EnhancedlogidEnum.OTA_LMP_RX_PDU, 
			769u => EnhancedlogidEnum.OTA_LMP_TX_PDU, 
			770u => EnhancedlogidEnum.OTA_LE_CTRL_RX_PDU, 
			771u => EnhancedlogidEnum.OTA_LE_CTRL_TX_PDU, 
			772u => EnhancedlogidEnum.OTA_QLL_CTRL_RX_PDU, 
			773u => EnhancedlogidEnum.OTA_QLL_CTRL_TX_PDU, 
			774u => EnhancedlogidEnum.OTA_QLMP_CTRL_RX_PDU, 
			775u => EnhancedlogidEnum.OTA_QLMP_CTRL_TX_PDU, 
			776u => EnhancedlogidEnum.OTA_QLMP_NOT_ACCEPTED_PDU, 
			_ => EnhancedlogidEnum.InvalidEnhancedlogidValue, 
		};
	}

	public static uint EnhancedlogidToValue(EnhancedlogidEnum enumItem)
	{
		return enumItem switch
		{
			EnhancedlogidEnum.OTA_LMP_RX_PDU => 768u, 
			EnhancedlogidEnum.OTA_LMP_TX_PDU => 769u, 
			EnhancedlogidEnum.OTA_LE_CTRL_RX_PDU => 770u, 
			EnhancedlogidEnum.OTA_LE_CTRL_TX_PDU => 771u, 
			EnhancedlogidEnum.OTA_QLL_CTRL_RX_PDU => 772u, 
			EnhancedlogidEnum.OTA_QLL_CTRL_TX_PDU => 773u, 
			EnhancedlogidEnum.OTA_QLMP_CTRL_RX_PDU => 774u, 
			EnhancedlogidEnum.OTA_QLMP_CTRL_TX_PDU => 775u, 
			EnhancedlogidEnum.OTA_QLMP_NOT_ACCEPTED_PDU => 776u, 
			_ => uint.MaxValue, 
		};
	}

	public static string EnhancedlogidToString(EnhancedlogidEnum enumItem)
	{
		return enumItem switch
		{
			EnhancedlogidEnum.OTA_LMP_RX_PDU => "OTA_LMP_RX_PDU", 
			EnhancedlogidEnum.OTA_LMP_TX_PDU => "OTA_LMP_TX_PDU", 
			EnhancedlogidEnum.OTA_LE_CTRL_RX_PDU => "OTA_LE_CTRL_RX_PDU", 
			EnhancedlogidEnum.OTA_LE_CTRL_TX_PDU => "OTA_LE_CTRL_TX_PDU", 
			EnhancedlogidEnum.OTA_QLL_CTRL_RX_PDU => "OTA_QLL_CTRL_RX_PDU", 
			EnhancedlogidEnum.OTA_QLL_CTRL_TX_PDU => "OTA_QLL_CTRL_TX_PDU", 
			EnhancedlogidEnum.OTA_QLMP_CTRL_RX_PDU => "OTA_QLMP_CTRL_RX_PDU", 
			EnhancedlogidEnum.OTA_QLMP_CTRL_TX_PDU => "OTA_QLMP_CTRL_TX_PDU", 
			EnhancedlogidEnum.OTA_QLMP_NOT_ACCEPTED_PDU => "OTA_QLMP_NOT_ACCEPTED_PDU", 
			_ => "Invalid Enhancedlogid Value", 
		};
	}

	public static string EnhancedlogidToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x300 = OTA_LMP_RX_PDU");
		stringBuilder.AppendLine("0x301 = OTA_LMP_TX_PDU");
		stringBuilder.AppendLine("0x302 = OTA_LE_CTRL_RX_PDU");
		stringBuilder.AppendLine("0x303 = OTA_LE_CTRL_TX_PDU");
		stringBuilder.AppendLine("0x304 = OTA_QLL_CTRL_RX_PDU");
		stringBuilder.AppendLine("0x305 = OTA_QLL_CTRL_TX_PDU");
		stringBuilder.AppendLine("0x306 = OTA_QLMP_CTRL_RX_PDU");
		stringBuilder.AppendLine("0x307 = OTA_QLMP_CTRL_TX_PDU");
		stringBuilder.AppendLine("0x308 = OTA_QLMP_NOT_ACCEPTED_PDU");
		return stringBuilder.ToString();
	}
}
