using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class Ar3002TestModeInfo
{
	public static Ar3002TestModeEnum ValueToAr3002TestMode(uint value)
	{
		return value switch
		{
			0u => Ar3002TestModeEnum.PAUSE, 
			1u => Ar3002TestModeEnum.TX_0, 
			2u => Ar3002TestModeEnum.TX_1, 
			3u => Ar3002TestModeEnum.TX_1010, 
			4u => Ar3002TestModeEnum.TX_PRBS, 
			5u => Ar3002TestModeEnum.LOOP_ACL, 
			6u => Ar3002TestModeEnum.LOOP_SCO, 
			7u => Ar3002TestModeEnum.LOOP_ACL_NO_WHITENING, 
			8u => Ar3002TestModeEnum.LOOP_SCO_NO_WHITENING, 
			9u => Ar3002TestModeEnum.TX_11110000, 
			10u => Ar3002TestModeEnum.RX, 
			11u => Ar3002TestModeEnum.LOOPBACK_NC, 
			_ => Ar3002TestModeEnum.InvalidAr3002TestModeValue, 
		};
	}

	public static uint Ar3002TestModeToValue(Ar3002TestModeEnum enumItem)
	{
		return enumItem switch
		{
			Ar3002TestModeEnum.PAUSE => 0u, 
			Ar3002TestModeEnum.TX_0 => 1u, 
			Ar3002TestModeEnum.TX_1 => 2u, 
			Ar3002TestModeEnum.TX_1010 => 3u, 
			Ar3002TestModeEnum.TX_PRBS => 4u, 
			Ar3002TestModeEnum.LOOP_ACL => 5u, 
			Ar3002TestModeEnum.LOOP_SCO => 6u, 
			Ar3002TestModeEnum.LOOP_ACL_NO_WHITENING => 7u, 
			Ar3002TestModeEnum.LOOP_SCO_NO_WHITENING => 8u, 
			Ar3002TestModeEnum.TX_11110000 => 9u, 
			Ar3002TestModeEnum.RX => 10u, 
			Ar3002TestModeEnum.LOOPBACK_NC => 11u, 
			_ => uint.MaxValue, 
		};
	}

	public static string Ar3002TestModeToString(Ar3002TestModeEnum enumItem)
	{
		return enumItem switch
		{
			Ar3002TestModeEnum.PAUSE => "PAUSE", 
			Ar3002TestModeEnum.TX_0 => "TX_0", 
			Ar3002TestModeEnum.TX_1 => "TX_1", 
			Ar3002TestModeEnum.TX_1010 => "TX_1010", 
			Ar3002TestModeEnum.TX_PRBS => "TX_PRBS", 
			Ar3002TestModeEnum.LOOP_ACL => "LOOP_ACL", 
			Ar3002TestModeEnum.LOOP_SCO => "LOOP_SCO", 
			Ar3002TestModeEnum.LOOP_ACL_NO_WHITENING => "LOOP_ACL_NO_WHITENING", 
			Ar3002TestModeEnum.LOOP_SCO_NO_WHITENING => "LOOP_SCO_NO_WHITENING", 
			Ar3002TestModeEnum.TX_11110000 => "TX_11110000", 
			Ar3002TestModeEnum.RX => "RX", 
			Ar3002TestModeEnum.LOOPBACK_NC => "LOOPBACK_NC", 
			_ => "Invalid Ar3002TestMode Value", 
		};
	}

	public static string Ar3002TestModeToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = PAUSE");
		stringBuilder.AppendLine("0x1 = TX_0");
		stringBuilder.AppendLine("0x2 = TX_1");
		stringBuilder.AppendLine("0x3 = TX_1010");
		stringBuilder.AppendLine("0x4 = TX_PRBS");
		stringBuilder.AppendLine("0x5 = LOOP_ACL");
		stringBuilder.AppendLine("0x6 = LOOP_SCO");
		stringBuilder.AppendLine("0x7 = LOOP_ACL_NO_WHITENING");
		stringBuilder.AppendLine("0x8 = LOOP_SCO_NO_WHITENING");
		stringBuilder.AppendLine("0x9 = TX_11110000");
		stringBuilder.AppendLine("0xA = RX");
		stringBuilder.AppendLine("0xB = LOOPBACK_NC");
		return stringBuilder.ToString();
	}
}
