using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class SimultaneousLeHostInfo
{
	public static SimultaneousLeHostEnum ValueToSimultaneousLeHost(uint value)
	{
		if (value == 0)
		{
			return SimultaneousLeHostEnum.Simultaneous_LE_and_BR_EDR_to_Same_Device_Capable_Host_disabled;
		}
		if (value >= 1 && value <= 255)
		{
			return SimultaneousLeHostEnum.RESERVED;
		}
		return SimultaneousLeHostEnum.InvalidSimultaneousLeHostValue;
	}

	public static uint SimultaneousLeHostToValue(SimultaneousLeHostEnum enumItem)
	{
		return enumItem switch
		{
			SimultaneousLeHostEnum.Simultaneous_LE_and_BR_EDR_to_Same_Device_Capable_Host_disabled => 0u, 
			SimultaneousLeHostEnum.RESERVED => 1u, 
			_ => uint.MaxValue, 
		};
	}

	public static string SimultaneousLeHostToString(SimultaneousLeHostEnum enumItem)
	{
		return enumItem switch
		{
			SimultaneousLeHostEnum.Simultaneous_LE_and_BR_EDR_to_Same_Device_Capable_Host_disabled => "Simultaneous_LE_and_BR_EDR_to_Same_Device_Capable_Host_disabled", 
			SimultaneousLeHostEnum.RESERVED => "Reserved", 
			_ => "Invalid SimultaneousLeHost Value", 
		};
	}

	public static string SimultaneousLeHostToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Simultaneous_LE_and_BR_EDR_to_Same_Device_Capable_Host_disabled");
		stringBuilder.AppendLine("0x1-0xFF = Reserved");
		return stringBuilder.ToString();
	}
}
