using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class Le1mPhyPreferenceInfo
{
	public static Le1mPhyPreferenceEnum ValueToLe1mPhyPreference(uint value)
	{
		return value switch
		{
			0u => Le1mPhyPreferenceEnum.The_Host_prefers_not_to_use_the_LE_1M_PHY, 
			1u => Le1mPhyPreferenceEnum.The_Host_prefers_to_use_the_LE_1M_PHY_possibly_among_others, 
			_ => Le1mPhyPreferenceEnum.InvalidLe1mPhyPreferenceValue, 
		};
	}

	public static uint Le1mPhyPreferenceToValue(Le1mPhyPreferenceEnum enumItem)
	{
		return enumItem switch
		{
			Le1mPhyPreferenceEnum.The_Host_prefers_not_to_use_the_LE_1M_PHY => 0u, 
			Le1mPhyPreferenceEnum.The_Host_prefers_to_use_the_LE_1M_PHY_possibly_among_others => 1u, 
			_ => uint.MaxValue, 
		};
	}

	public static string Le1mPhyPreferenceToString(Le1mPhyPreferenceEnum enumItem)
	{
		return enumItem switch
		{
			Le1mPhyPreferenceEnum.The_Host_prefers_not_to_use_the_LE_1M_PHY => "The Host prefers not to use the LE 1M PHY", 
			Le1mPhyPreferenceEnum.The_Host_prefers_to_use_the_LE_1M_PHY_possibly_among_others => "The Host prefers to use the LE 1M PHY (possibly among others)", 
			_ => "Invalid Le1mPhyPreference Value", 
		};
	}

	public static string Le1mPhyPreferenceToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = The Host prefers not to use the LE 1M PHY");
		stringBuilder.AppendLine("0x1 = The Host prefers to use the LE 1M PHY (possibly among others)");
		return stringBuilder.ToString();
	}
}
