using System;
using System.Collections.Generic;
using System.Text;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class InquiryResultWithRssi : PacketBase
{
	public class UserFieldsWrapper
	{
		private uint _NumResponses;

		private List<ResponseSubField> _ResponseList = new List<ResponseSubField>();

		public uint NumResponses
		{
			get
			{
				return _NumResponses;
			}
			set
			{
				if (value > 255)
				{
					throw new Exception("Maximum possible value for NumResponses is 0xFF");
				}
				_NumResponses = value;
				while (_ResponseList.Count < _NumResponses)
				{
					_ResponseList.Add(new ResponseSubField());
				}
				while (_ResponseList.Count > _NumResponses)
				{
					_ResponseList.RemoveAt(_ResponseList.Count - 1);
				}
			}
		}

		public List<ResponseSubField> ResponseList => _ResponseList;
	}

	public class ResponseSubField
	{
		public enum RssiEnum
		{
			RSSI_0_DBM,
			RSSI_1_DBM,
			RSSI_2_DBM,
			RSSI_3_DBM,
			RSSI_4_DBM,
			RSSI_5_DBM,
			RSSI_6_DBM,
			RSSI_7_DBM,
			RSSI_8_DBM,
			RSSI_9_DBM,
			RSSI_10_DBM,
			RSSI_11_DBM,
			RSSI_12_DBM,
			RSSI_13_DBM,
			RSSI_14_DBM,
			RSSI_15_DBM,
			RSSI_16_DBM,
			RSSI_17_DBM,
			RSSI_18_DBM,
			RSSI_19_DBM,
			RSSI_20_DBM,
			RSSI_MINUS_127_DBM,
			RSSI_MINUS_126_DBM,
			RSSI_MINUS_125_DBM,
			RSSI_MINUS_124_DBM,
			RSSI_MINUS_123_DBM,
			RSSI_MINUS_122_DBM,
			RSSI_MINUS_121_DBM,
			RSSI_MINUS_120_DBM,
			RSSI_MINUS_119_DBM,
			RSSI_MINUS_118_DBM,
			RSSI_MINUS_117_DBM,
			RSSI_MINUS_116_DBM,
			RSSI_MINUS_115_DBM,
			RSSI_MINUS_114_DBM,
			RSSI_MINUS_113_DBM,
			RSSI_MINUS_112_DBM,
			RSSI_MINUS_111_DBM,
			RSSI_MINUS_110_DBM,
			RSSI_MINUS_109_DBM,
			RSSI_MINUS_108_DBM,
			RSSI_MINUS_107_DBM,
			RSSI_MINUS_106_DBM,
			RSSI_MINUS_105_DBM,
			RSSI_MINUS_104_DBM,
			RSSI_MINUS_103_DBM,
			RSSI_MINUS_102_DBM,
			RSSI_MINUS_101_DBM,
			RSSI_MINUS_100_DBM,
			RSSI_MINUS_99_DBM,
			RSSI_MINUS_98_DBM,
			RSSI_MINUS_97_DBM,
			RSSI_MINUS_96_DBM,
			RSSI_MINUS_95_DBM,
			RSSI_MINUS_94_DBM,
			RSSI_MINUS_93_DBM,
			RSSI_MINUS_92_DBM,
			RSSI_MINUS_91_DBM,
			RSSI_MINUS_90_DBM,
			RSSI_MINUS_89_DBM,
			RSSI_MINUS_88_DBM,
			RSSI_MINUS_87_DBM,
			RSSI_MINUS_86_DBM,
			RSSI_MINUS_85_DBM,
			RSSI_MINUS_84_DBM,
			RSSI_MINUS_83_DBM,
			RSSI_MINUS_82_DBM,
			RSSI_MINUS_81_DBM,
			RSSI_MINUS_80_DBM,
			RSSI_MINUS_79_DBM,
			RSSI_MINUS_78_DBM,
			RSSI_MINUS_77_DBM,
			RSSI_MINUS_76_DBM,
			RSSI_MINUS_75_DBM,
			RSSI_MINUS_74_DBM,
			RSSI_MINUS_73_DBM,
			RSSI_MINUS_72_DBM,
			RSSI_MINUS_71_DBM,
			RSSI_MINUS_70_DBM,
			RSSI_MINUS_69_DBM,
			RSSI_MINUS_68_DBM,
			RSSI_MINUS_67_DBM,
			RSSI_MINUS_66_DBM,
			RSSI_MINUS_65_DBM,
			RSSI_MINUS_64_DBM,
			RSSI_MINUS_63_DBM,
			RSSI_MINUS_62_DBM,
			RSSI_MINUS_61_DBM,
			RSSI_MINUS_60_DBM,
			RSSI_MINUS_59_DBM,
			RSSI_MINUS_58_DBM,
			RSSI_MINUS_57_DBM,
			RSSI_MINUS_56_DBM,
			RSSI_MINUS_55_DBM,
			RSSI_MINUS_54_DBM,
			RSSI_MINUS_53_DBM,
			RSSI_MINUS_52_DBM,
			RSSI_MINUS_51_DBM,
			RSSI_MINUS_50_DBM,
			RSSI_MINUS_49_DBM,
			RSSI_MINUS_48_DBM,
			RSSI_MINUS_47_DBM,
			RSSI_MINUS_46_DBM,
			RSSI_MINUS_45_DBM,
			RSSI_MINUS_44_DBM,
			RSSI_MINUS_43_DBM,
			RSSI_MINUS_42_DBM,
			RSSI_MINUS_41_DBM,
			RSSI_MINUS_40_DBM,
			RSSI_MINUS_39_DBM,
			RSSI_MINUS_38_DBM,
			RSSI_MINUS_37_DBM,
			RSSI_MINUS_36_DBM,
			RSSI_MINUS_35_DBM,
			RSSI_MINUS_34_DBM,
			RSSI_MINUS_33_DBM,
			RSSI_MINUS_32_DBM,
			RSSI_MINUS_31_DBM,
			RSSI_MINUS_30_DBM,
			RSSI_MINUS_29_DBM,
			RSSI_MINUS_28_DBM,
			RSSI_MINUS_27_DBM,
			RSSI_MINUS_26_DBM,
			RSSI_MINUS_25_DBM,
			RSSI_MINUS_24_DBM,
			RSSI_MINUS_23_DBM,
			RSSI_MINUS_22_DBM,
			RSSI_MINUS_21_DBM,
			RSSI_MINUS_20_DBM,
			RSSI_MINUS_19_DBM,
			RSSI_MINUS_18_DBM,
			RSSI_MINUS_17_DBM,
			RSSI_MINUS_16_DBM,
			RSSI_MINUS_15_DBM,
			RSSI_MINUS_14_DBM,
			RSSI_MINUS_13_DBM,
			RSSI_MINUS_12_DBM,
			RSSI_MINUS_11_DBM,
			RSSI_MINUS_10_DBM,
			RSSI_MINUS_9_DBM,
			RSSI_MINUS_8_DBM,
			RSSI_MINUS_7_DBM,
			RSSI_MINUS_6_DBM,
			RSSI_MINUS_5_DBM,
			RSSI_MINUS_4_DBM,
			RSSI_MINUS_3_DBM,
			RSSI_MINUS_2_DBM,
			RSSI_MINUS_1_DBM,
			InvalidRssiValue
		}

		public static class RssiInfo
		{
			public static RssiEnum ValueToRssi(uint value)
			{
				return value switch
				{
					0u => RssiEnum.RSSI_0_DBM, 
					1u => RssiEnum.RSSI_1_DBM, 
					2u => RssiEnum.RSSI_2_DBM, 
					3u => RssiEnum.RSSI_3_DBM, 
					4u => RssiEnum.RSSI_4_DBM, 
					5u => RssiEnum.RSSI_5_DBM, 
					6u => RssiEnum.RSSI_6_DBM, 
					7u => RssiEnum.RSSI_7_DBM, 
					8u => RssiEnum.RSSI_8_DBM, 
					9u => RssiEnum.RSSI_9_DBM, 
					10u => RssiEnum.RSSI_10_DBM, 
					11u => RssiEnum.RSSI_11_DBM, 
					12u => RssiEnum.RSSI_12_DBM, 
					13u => RssiEnum.RSSI_13_DBM, 
					14u => RssiEnum.RSSI_14_DBM, 
					15u => RssiEnum.RSSI_15_DBM, 
					16u => RssiEnum.RSSI_16_DBM, 
					17u => RssiEnum.RSSI_17_DBM, 
					18u => RssiEnum.RSSI_18_DBM, 
					19u => RssiEnum.RSSI_19_DBM, 
					20u => RssiEnum.RSSI_20_DBM, 
					129u => RssiEnum.RSSI_MINUS_127_DBM, 
					130u => RssiEnum.RSSI_MINUS_126_DBM, 
					131u => RssiEnum.RSSI_MINUS_125_DBM, 
					132u => RssiEnum.RSSI_MINUS_124_DBM, 
					133u => RssiEnum.RSSI_MINUS_123_DBM, 
					134u => RssiEnum.RSSI_MINUS_122_DBM, 
					135u => RssiEnum.RSSI_MINUS_121_DBM, 
					136u => RssiEnum.RSSI_MINUS_120_DBM, 
					137u => RssiEnum.RSSI_MINUS_119_DBM, 
					138u => RssiEnum.RSSI_MINUS_118_DBM, 
					139u => RssiEnum.RSSI_MINUS_117_DBM, 
					140u => RssiEnum.RSSI_MINUS_116_DBM, 
					141u => RssiEnum.RSSI_MINUS_115_DBM, 
					142u => RssiEnum.RSSI_MINUS_114_DBM, 
					143u => RssiEnum.RSSI_MINUS_113_DBM, 
					144u => RssiEnum.RSSI_MINUS_112_DBM, 
					145u => RssiEnum.RSSI_MINUS_111_DBM, 
					146u => RssiEnum.RSSI_MINUS_110_DBM, 
					147u => RssiEnum.RSSI_MINUS_109_DBM, 
					148u => RssiEnum.RSSI_MINUS_108_DBM, 
					149u => RssiEnum.RSSI_MINUS_107_DBM, 
					150u => RssiEnum.RSSI_MINUS_106_DBM, 
					151u => RssiEnum.RSSI_MINUS_105_DBM, 
					152u => RssiEnum.RSSI_MINUS_104_DBM, 
					153u => RssiEnum.RSSI_MINUS_103_DBM, 
					154u => RssiEnum.RSSI_MINUS_102_DBM, 
					155u => RssiEnum.RSSI_MINUS_101_DBM, 
					156u => RssiEnum.RSSI_MINUS_100_DBM, 
					157u => RssiEnum.RSSI_MINUS_99_DBM, 
					158u => RssiEnum.RSSI_MINUS_98_DBM, 
					159u => RssiEnum.RSSI_MINUS_97_DBM, 
					160u => RssiEnum.RSSI_MINUS_96_DBM, 
					161u => RssiEnum.RSSI_MINUS_95_DBM, 
					162u => RssiEnum.RSSI_MINUS_94_DBM, 
					163u => RssiEnum.RSSI_MINUS_93_DBM, 
					164u => RssiEnum.RSSI_MINUS_92_DBM, 
					165u => RssiEnum.RSSI_MINUS_91_DBM, 
					166u => RssiEnum.RSSI_MINUS_90_DBM, 
					167u => RssiEnum.RSSI_MINUS_89_DBM, 
					168u => RssiEnum.RSSI_MINUS_88_DBM, 
					169u => RssiEnum.RSSI_MINUS_87_DBM, 
					170u => RssiEnum.RSSI_MINUS_86_DBM, 
					171u => RssiEnum.RSSI_MINUS_85_DBM, 
					172u => RssiEnum.RSSI_MINUS_84_DBM, 
					173u => RssiEnum.RSSI_MINUS_83_DBM, 
					174u => RssiEnum.RSSI_MINUS_82_DBM, 
					175u => RssiEnum.RSSI_MINUS_81_DBM, 
					176u => RssiEnum.RSSI_MINUS_80_DBM, 
					177u => RssiEnum.RSSI_MINUS_79_DBM, 
					178u => RssiEnum.RSSI_MINUS_78_DBM, 
					179u => RssiEnum.RSSI_MINUS_77_DBM, 
					180u => RssiEnum.RSSI_MINUS_76_DBM, 
					181u => RssiEnum.RSSI_MINUS_75_DBM, 
					182u => RssiEnum.RSSI_MINUS_74_DBM, 
					183u => RssiEnum.RSSI_MINUS_73_DBM, 
					184u => RssiEnum.RSSI_MINUS_72_DBM, 
					185u => RssiEnum.RSSI_MINUS_71_DBM, 
					186u => RssiEnum.RSSI_MINUS_70_DBM, 
					187u => RssiEnum.RSSI_MINUS_69_DBM, 
					188u => RssiEnum.RSSI_MINUS_68_DBM, 
					189u => RssiEnum.RSSI_MINUS_67_DBM, 
					190u => RssiEnum.RSSI_MINUS_66_DBM, 
					191u => RssiEnum.RSSI_MINUS_65_DBM, 
					192u => RssiEnum.RSSI_MINUS_64_DBM, 
					193u => RssiEnum.RSSI_MINUS_63_DBM, 
					194u => RssiEnum.RSSI_MINUS_62_DBM, 
					195u => RssiEnum.RSSI_MINUS_61_DBM, 
					196u => RssiEnum.RSSI_MINUS_60_DBM, 
					197u => RssiEnum.RSSI_MINUS_59_DBM, 
					198u => RssiEnum.RSSI_MINUS_58_DBM, 
					199u => RssiEnum.RSSI_MINUS_57_DBM, 
					200u => RssiEnum.RSSI_MINUS_56_DBM, 
					201u => RssiEnum.RSSI_MINUS_55_DBM, 
					202u => RssiEnum.RSSI_MINUS_54_DBM, 
					203u => RssiEnum.RSSI_MINUS_53_DBM, 
					204u => RssiEnum.RSSI_MINUS_52_DBM, 
					205u => RssiEnum.RSSI_MINUS_51_DBM, 
					206u => RssiEnum.RSSI_MINUS_50_DBM, 
					207u => RssiEnum.RSSI_MINUS_49_DBM, 
					208u => RssiEnum.RSSI_MINUS_48_DBM, 
					209u => RssiEnum.RSSI_MINUS_47_DBM, 
					210u => RssiEnum.RSSI_MINUS_46_DBM, 
					211u => RssiEnum.RSSI_MINUS_45_DBM, 
					212u => RssiEnum.RSSI_MINUS_44_DBM, 
					213u => RssiEnum.RSSI_MINUS_43_DBM, 
					214u => RssiEnum.RSSI_MINUS_42_DBM, 
					215u => RssiEnum.RSSI_MINUS_41_DBM, 
					216u => RssiEnum.RSSI_MINUS_40_DBM, 
					217u => RssiEnum.RSSI_MINUS_39_DBM, 
					218u => RssiEnum.RSSI_MINUS_38_DBM, 
					219u => RssiEnum.RSSI_MINUS_37_DBM, 
					220u => RssiEnum.RSSI_MINUS_36_DBM, 
					221u => RssiEnum.RSSI_MINUS_35_DBM, 
					222u => RssiEnum.RSSI_MINUS_34_DBM, 
					223u => RssiEnum.RSSI_MINUS_33_DBM, 
					224u => RssiEnum.RSSI_MINUS_32_DBM, 
					225u => RssiEnum.RSSI_MINUS_31_DBM, 
					226u => RssiEnum.RSSI_MINUS_30_DBM, 
					227u => RssiEnum.RSSI_MINUS_29_DBM, 
					228u => RssiEnum.RSSI_MINUS_28_DBM, 
					229u => RssiEnum.RSSI_MINUS_27_DBM, 
					230u => RssiEnum.RSSI_MINUS_26_DBM, 
					231u => RssiEnum.RSSI_MINUS_25_DBM, 
					232u => RssiEnum.RSSI_MINUS_24_DBM, 
					233u => RssiEnum.RSSI_MINUS_23_DBM, 
					234u => RssiEnum.RSSI_MINUS_22_DBM, 
					235u => RssiEnum.RSSI_MINUS_21_DBM, 
					236u => RssiEnum.RSSI_MINUS_20_DBM, 
					237u => RssiEnum.RSSI_MINUS_19_DBM, 
					238u => RssiEnum.RSSI_MINUS_18_DBM, 
					239u => RssiEnum.RSSI_MINUS_17_DBM, 
					240u => RssiEnum.RSSI_MINUS_16_DBM, 
					241u => RssiEnum.RSSI_MINUS_15_DBM, 
					242u => RssiEnum.RSSI_MINUS_14_DBM, 
					243u => RssiEnum.RSSI_MINUS_13_DBM, 
					244u => RssiEnum.RSSI_MINUS_12_DBM, 
					245u => RssiEnum.RSSI_MINUS_11_DBM, 
					246u => RssiEnum.RSSI_MINUS_10_DBM, 
					247u => RssiEnum.RSSI_MINUS_9_DBM, 
					248u => RssiEnum.RSSI_MINUS_8_DBM, 
					249u => RssiEnum.RSSI_MINUS_7_DBM, 
					250u => RssiEnum.RSSI_MINUS_6_DBM, 
					251u => RssiEnum.RSSI_MINUS_5_DBM, 
					252u => RssiEnum.RSSI_MINUS_4_DBM, 
					253u => RssiEnum.RSSI_MINUS_3_DBM, 
					254u => RssiEnum.RSSI_MINUS_2_DBM, 
					255u => RssiEnum.RSSI_MINUS_1_DBM, 
					_ => RssiEnum.InvalidRssiValue, 
				};
			}

			public static uint RssiToValue(RssiEnum enumItem)
			{
				return enumItem switch
				{
					RssiEnum.RSSI_0_DBM => 0u, 
					RssiEnum.RSSI_1_DBM => 1u, 
					RssiEnum.RSSI_2_DBM => 2u, 
					RssiEnum.RSSI_3_DBM => 3u, 
					RssiEnum.RSSI_4_DBM => 4u, 
					RssiEnum.RSSI_5_DBM => 5u, 
					RssiEnum.RSSI_6_DBM => 6u, 
					RssiEnum.RSSI_7_DBM => 7u, 
					RssiEnum.RSSI_8_DBM => 8u, 
					RssiEnum.RSSI_9_DBM => 9u, 
					RssiEnum.RSSI_10_DBM => 10u, 
					RssiEnum.RSSI_11_DBM => 11u, 
					RssiEnum.RSSI_12_DBM => 12u, 
					RssiEnum.RSSI_13_DBM => 13u, 
					RssiEnum.RSSI_14_DBM => 14u, 
					RssiEnum.RSSI_15_DBM => 15u, 
					RssiEnum.RSSI_16_DBM => 16u, 
					RssiEnum.RSSI_17_DBM => 17u, 
					RssiEnum.RSSI_18_DBM => 18u, 
					RssiEnum.RSSI_19_DBM => 19u, 
					RssiEnum.RSSI_20_DBM => 20u, 
					RssiEnum.RSSI_MINUS_127_DBM => 129u, 
					RssiEnum.RSSI_MINUS_126_DBM => 130u, 
					RssiEnum.RSSI_MINUS_125_DBM => 131u, 
					RssiEnum.RSSI_MINUS_124_DBM => 132u, 
					RssiEnum.RSSI_MINUS_123_DBM => 133u, 
					RssiEnum.RSSI_MINUS_122_DBM => 134u, 
					RssiEnum.RSSI_MINUS_121_DBM => 135u, 
					RssiEnum.RSSI_MINUS_120_DBM => 136u, 
					RssiEnum.RSSI_MINUS_119_DBM => 137u, 
					RssiEnum.RSSI_MINUS_118_DBM => 138u, 
					RssiEnum.RSSI_MINUS_117_DBM => 139u, 
					RssiEnum.RSSI_MINUS_116_DBM => 140u, 
					RssiEnum.RSSI_MINUS_115_DBM => 141u, 
					RssiEnum.RSSI_MINUS_114_DBM => 142u, 
					RssiEnum.RSSI_MINUS_113_DBM => 143u, 
					RssiEnum.RSSI_MINUS_112_DBM => 144u, 
					RssiEnum.RSSI_MINUS_111_DBM => 145u, 
					RssiEnum.RSSI_MINUS_110_DBM => 146u, 
					RssiEnum.RSSI_MINUS_109_DBM => 147u, 
					RssiEnum.RSSI_MINUS_108_DBM => 148u, 
					RssiEnum.RSSI_MINUS_107_DBM => 149u, 
					RssiEnum.RSSI_MINUS_106_DBM => 150u, 
					RssiEnum.RSSI_MINUS_105_DBM => 151u, 
					RssiEnum.RSSI_MINUS_104_DBM => 152u, 
					RssiEnum.RSSI_MINUS_103_DBM => 153u, 
					RssiEnum.RSSI_MINUS_102_DBM => 154u, 
					RssiEnum.RSSI_MINUS_101_DBM => 155u, 
					RssiEnum.RSSI_MINUS_100_DBM => 156u, 
					RssiEnum.RSSI_MINUS_99_DBM => 157u, 
					RssiEnum.RSSI_MINUS_98_DBM => 158u, 
					RssiEnum.RSSI_MINUS_97_DBM => 159u, 
					RssiEnum.RSSI_MINUS_96_DBM => 160u, 
					RssiEnum.RSSI_MINUS_95_DBM => 161u, 
					RssiEnum.RSSI_MINUS_94_DBM => 162u, 
					RssiEnum.RSSI_MINUS_93_DBM => 163u, 
					RssiEnum.RSSI_MINUS_92_DBM => 164u, 
					RssiEnum.RSSI_MINUS_91_DBM => 165u, 
					RssiEnum.RSSI_MINUS_90_DBM => 166u, 
					RssiEnum.RSSI_MINUS_89_DBM => 167u, 
					RssiEnum.RSSI_MINUS_88_DBM => 168u, 
					RssiEnum.RSSI_MINUS_87_DBM => 169u, 
					RssiEnum.RSSI_MINUS_86_DBM => 170u, 
					RssiEnum.RSSI_MINUS_85_DBM => 171u, 
					RssiEnum.RSSI_MINUS_84_DBM => 172u, 
					RssiEnum.RSSI_MINUS_83_DBM => 173u, 
					RssiEnum.RSSI_MINUS_82_DBM => 174u, 
					RssiEnum.RSSI_MINUS_81_DBM => 175u, 
					RssiEnum.RSSI_MINUS_80_DBM => 176u, 
					RssiEnum.RSSI_MINUS_79_DBM => 177u, 
					RssiEnum.RSSI_MINUS_78_DBM => 178u, 
					RssiEnum.RSSI_MINUS_77_DBM => 179u, 
					RssiEnum.RSSI_MINUS_76_DBM => 180u, 
					RssiEnum.RSSI_MINUS_75_DBM => 181u, 
					RssiEnum.RSSI_MINUS_74_DBM => 182u, 
					RssiEnum.RSSI_MINUS_73_DBM => 183u, 
					RssiEnum.RSSI_MINUS_72_DBM => 184u, 
					RssiEnum.RSSI_MINUS_71_DBM => 185u, 
					RssiEnum.RSSI_MINUS_70_DBM => 186u, 
					RssiEnum.RSSI_MINUS_69_DBM => 187u, 
					RssiEnum.RSSI_MINUS_68_DBM => 188u, 
					RssiEnum.RSSI_MINUS_67_DBM => 189u, 
					RssiEnum.RSSI_MINUS_66_DBM => 190u, 
					RssiEnum.RSSI_MINUS_65_DBM => 191u, 
					RssiEnum.RSSI_MINUS_64_DBM => 192u, 
					RssiEnum.RSSI_MINUS_63_DBM => 193u, 
					RssiEnum.RSSI_MINUS_62_DBM => 194u, 
					RssiEnum.RSSI_MINUS_61_DBM => 195u, 
					RssiEnum.RSSI_MINUS_60_DBM => 196u, 
					RssiEnum.RSSI_MINUS_59_DBM => 197u, 
					RssiEnum.RSSI_MINUS_58_DBM => 198u, 
					RssiEnum.RSSI_MINUS_57_DBM => 199u, 
					RssiEnum.RSSI_MINUS_56_DBM => 200u, 
					RssiEnum.RSSI_MINUS_55_DBM => 201u, 
					RssiEnum.RSSI_MINUS_54_DBM => 202u, 
					RssiEnum.RSSI_MINUS_53_DBM => 203u, 
					RssiEnum.RSSI_MINUS_52_DBM => 204u, 
					RssiEnum.RSSI_MINUS_51_DBM => 205u, 
					RssiEnum.RSSI_MINUS_50_DBM => 206u, 
					RssiEnum.RSSI_MINUS_49_DBM => 207u, 
					RssiEnum.RSSI_MINUS_48_DBM => 208u, 
					RssiEnum.RSSI_MINUS_47_DBM => 209u, 
					RssiEnum.RSSI_MINUS_46_DBM => 210u, 
					RssiEnum.RSSI_MINUS_45_DBM => 211u, 
					RssiEnum.RSSI_MINUS_44_DBM => 212u, 
					RssiEnum.RSSI_MINUS_43_DBM => 213u, 
					RssiEnum.RSSI_MINUS_42_DBM => 214u, 
					RssiEnum.RSSI_MINUS_41_DBM => 215u, 
					RssiEnum.RSSI_MINUS_40_DBM => 216u, 
					RssiEnum.RSSI_MINUS_39_DBM => 217u, 
					RssiEnum.RSSI_MINUS_38_DBM => 218u, 
					RssiEnum.RSSI_MINUS_37_DBM => 219u, 
					RssiEnum.RSSI_MINUS_36_DBM => 220u, 
					RssiEnum.RSSI_MINUS_35_DBM => 221u, 
					RssiEnum.RSSI_MINUS_34_DBM => 222u, 
					RssiEnum.RSSI_MINUS_33_DBM => 223u, 
					RssiEnum.RSSI_MINUS_32_DBM => 224u, 
					RssiEnum.RSSI_MINUS_31_DBM => 225u, 
					RssiEnum.RSSI_MINUS_30_DBM => 226u, 
					RssiEnum.RSSI_MINUS_29_DBM => 227u, 
					RssiEnum.RSSI_MINUS_28_DBM => 228u, 
					RssiEnum.RSSI_MINUS_27_DBM => 229u, 
					RssiEnum.RSSI_MINUS_26_DBM => 230u, 
					RssiEnum.RSSI_MINUS_25_DBM => 231u, 
					RssiEnum.RSSI_MINUS_24_DBM => 232u, 
					RssiEnum.RSSI_MINUS_23_DBM => 233u, 
					RssiEnum.RSSI_MINUS_22_DBM => 234u, 
					RssiEnum.RSSI_MINUS_21_DBM => 235u, 
					RssiEnum.RSSI_MINUS_20_DBM => 236u, 
					RssiEnum.RSSI_MINUS_19_DBM => 237u, 
					RssiEnum.RSSI_MINUS_18_DBM => 238u, 
					RssiEnum.RSSI_MINUS_17_DBM => 239u, 
					RssiEnum.RSSI_MINUS_16_DBM => 240u, 
					RssiEnum.RSSI_MINUS_15_DBM => 241u, 
					RssiEnum.RSSI_MINUS_14_DBM => 242u, 
					RssiEnum.RSSI_MINUS_13_DBM => 243u, 
					RssiEnum.RSSI_MINUS_12_DBM => 244u, 
					RssiEnum.RSSI_MINUS_11_DBM => 245u, 
					RssiEnum.RSSI_MINUS_10_DBM => 246u, 
					RssiEnum.RSSI_MINUS_9_DBM => 247u, 
					RssiEnum.RSSI_MINUS_8_DBM => 248u, 
					RssiEnum.RSSI_MINUS_7_DBM => 249u, 
					RssiEnum.RSSI_MINUS_6_DBM => 250u, 
					RssiEnum.RSSI_MINUS_5_DBM => 251u, 
					RssiEnum.RSSI_MINUS_4_DBM => 252u, 
					RssiEnum.RSSI_MINUS_3_DBM => 253u, 
					RssiEnum.RSSI_MINUS_2_DBM => 254u, 
					RssiEnum.RSSI_MINUS_1_DBM => 255u, 
					_ => uint.MaxValue, 
				};
			}

			public static string RssiToString(RssiEnum enumItem)
			{
				return enumItem switch
				{
					RssiEnum.RSSI_0_DBM => "0dBm", 
					RssiEnum.RSSI_1_DBM => "1dBm", 
					RssiEnum.RSSI_2_DBM => "2dBm", 
					RssiEnum.RSSI_3_DBM => "3dBm", 
					RssiEnum.RSSI_4_DBM => "4dBm", 
					RssiEnum.RSSI_5_DBM => "5dBm", 
					RssiEnum.RSSI_6_DBM => "6dBm", 
					RssiEnum.RSSI_7_DBM => "7dBm", 
					RssiEnum.RSSI_8_DBM => "8dBm", 
					RssiEnum.RSSI_9_DBM => "9dBm", 
					RssiEnum.RSSI_10_DBM => "10dBm", 
					RssiEnum.RSSI_11_DBM => "11dBm", 
					RssiEnum.RSSI_12_DBM => "12dBm", 
					RssiEnum.RSSI_13_DBM => "13dBm", 
					RssiEnum.RSSI_14_DBM => "14dBm", 
					RssiEnum.RSSI_15_DBM => "15dBm", 
					RssiEnum.RSSI_16_DBM => "16dBm", 
					RssiEnum.RSSI_17_DBM => "17dBm", 
					RssiEnum.RSSI_18_DBM => "18dBm", 
					RssiEnum.RSSI_19_DBM => "19dBm", 
					RssiEnum.RSSI_20_DBM => "20dBm", 
					RssiEnum.RSSI_MINUS_127_DBM => "-127dBm", 
					RssiEnum.RSSI_MINUS_126_DBM => "-126dBm", 
					RssiEnum.RSSI_MINUS_125_DBM => "-125dBm", 
					RssiEnum.RSSI_MINUS_124_DBM => "-124dBm", 
					RssiEnum.RSSI_MINUS_123_DBM => "-123dBm", 
					RssiEnum.RSSI_MINUS_122_DBM => "-122dBm", 
					RssiEnum.RSSI_MINUS_121_DBM => "-121dBm", 
					RssiEnum.RSSI_MINUS_120_DBM => "-120dBm", 
					RssiEnum.RSSI_MINUS_119_DBM => "-119dBm", 
					RssiEnum.RSSI_MINUS_118_DBM => "-118dBm", 
					RssiEnum.RSSI_MINUS_117_DBM => "-117dBm", 
					RssiEnum.RSSI_MINUS_116_DBM => "-116dBm", 
					RssiEnum.RSSI_MINUS_115_DBM => "-115dBm", 
					RssiEnum.RSSI_MINUS_114_DBM => "-114dBm", 
					RssiEnum.RSSI_MINUS_113_DBM => "-113dBm", 
					RssiEnum.RSSI_MINUS_112_DBM => "-112dBm", 
					RssiEnum.RSSI_MINUS_111_DBM => "-111dBm", 
					RssiEnum.RSSI_MINUS_110_DBM => "-110dBm", 
					RssiEnum.RSSI_MINUS_109_DBM => "-109dBm", 
					RssiEnum.RSSI_MINUS_108_DBM => "-108dBm", 
					RssiEnum.RSSI_MINUS_107_DBM => "-107dBm", 
					RssiEnum.RSSI_MINUS_106_DBM => "-106dBm", 
					RssiEnum.RSSI_MINUS_105_DBM => "-105dBm", 
					RssiEnum.RSSI_MINUS_104_DBM => "-104dBm", 
					RssiEnum.RSSI_MINUS_103_DBM => "-103dBm", 
					RssiEnum.RSSI_MINUS_102_DBM => "-102dBm", 
					RssiEnum.RSSI_MINUS_101_DBM => "-101dBm", 
					RssiEnum.RSSI_MINUS_100_DBM => "-100dBm", 
					RssiEnum.RSSI_MINUS_99_DBM => "-99dBm", 
					RssiEnum.RSSI_MINUS_98_DBM => "-98dBm", 
					RssiEnum.RSSI_MINUS_97_DBM => "-97dBm", 
					RssiEnum.RSSI_MINUS_96_DBM => "-96dBm", 
					RssiEnum.RSSI_MINUS_95_DBM => "-95dBm", 
					RssiEnum.RSSI_MINUS_94_DBM => "-94dBm", 
					RssiEnum.RSSI_MINUS_93_DBM => "-93dBm", 
					RssiEnum.RSSI_MINUS_92_DBM => "-92dBm", 
					RssiEnum.RSSI_MINUS_91_DBM => "-91dBm", 
					RssiEnum.RSSI_MINUS_90_DBM => "-90dBm", 
					RssiEnum.RSSI_MINUS_89_DBM => "-89dBm", 
					RssiEnum.RSSI_MINUS_88_DBM => "-88dBm", 
					RssiEnum.RSSI_MINUS_87_DBM => "-87dBm", 
					RssiEnum.RSSI_MINUS_86_DBM => "-86dBm", 
					RssiEnum.RSSI_MINUS_85_DBM => "-85dBm", 
					RssiEnum.RSSI_MINUS_84_DBM => "-84dBm", 
					RssiEnum.RSSI_MINUS_83_DBM => "-83dBm", 
					RssiEnum.RSSI_MINUS_82_DBM => "-82dBm", 
					RssiEnum.RSSI_MINUS_81_DBM => "-81dBm", 
					RssiEnum.RSSI_MINUS_80_DBM => "-80dBm", 
					RssiEnum.RSSI_MINUS_79_DBM => "-79dBm", 
					RssiEnum.RSSI_MINUS_78_DBM => "-78dBm", 
					RssiEnum.RSSI_MINUS_77_DBM => "-77dBm", 
					RssiEnum.RSSI_MINUS_76_DBM => "-76dBm", 
					RssiEnum.RSSI_MINUS_75_DBM => "-75dBm", 
					RssiEnum.RSSI_MINUS_74_DBM => "-74dBm", 
					RssiEnum.RSSI_MINUS_73_DBM => "-73dBm", 
					RssiEnum.RSSI_MINUS_72_DBM => "-72dBm", 
					RssiEnum.RSSI_MINUS_71_DBM => "-71dBm", 
					RssiEnum.RSSI_MINUS_70_DBM => "-70dBm", 
					RssiEnum.RSSI_MINUS_69_DBM => "-69dBm", 
					RssiEnum.RSSI_MINUS_68_DBM => "-68dBm", 
					RssiEnum.RSSI_MINUS_67_DBM => "-67dBm", 
					RssiEnum.RSSI_MINUS_66_DBM => "-66dBm", 
					RssiEnum.RSSI_MINUS_65_DBM => "-65dBm", 
					RssiEnum.RSSI_MINUS_64_DBM => "-64dBm", 
					RssiEnum.RSSI_MINUS_63_DBM => "-63dBm", 
					RssiEnum.RSSI_MINUS_62_DBM => "-62dBm", 
					RssiEnum.RSSI_MINUS_61_DBM => "-61dBm", 
					RssiEnum.RSSI_MINUS_60_DBM => "-60dBm", 
					RssiEnum.RSSI_MINUS_59_DBM => "-59dBm", 
					RssiEnum.RSSI_MINUS_58_DBM => "-58dBm", 
					RssiEnum.RSSI_MINUS_57_DBM => "-57dBm", 
					RssiEnum.RSSI_MINUS_56_DBM => "-56dBm", 
					RssiEnum.RSSI_MINUS_55_DBM => "-55dBm", 
					RssiEnum.RSSI_MINUS_54_DBM => "-54dBm", 
					RssiEnum.RSSI_MINUS_53_DBM => "-53dBm", 
					RssiEnum.RSSI_MINUS_52_DBM => "-52dBm", 
					RssiEnum.RSSI_MINUS_51_DBM => "-51dBm", 
					RssiEnum.RSSI_MINUS_50_DBM => "-50dBm", 
					RssiEnum.RSSI_MINUS_49_DBM => "-49dBm", 
					RssiEnum.RSSI_MINUS_48_DBM => "-48dBm", 
					RssiEnum.RSSI_MINUS_47_DBM => "-47dBm", 
					RssiEnum.RSSI_MINUS_46_DBM => "-46dBm", 
					RssiEnum.RSSI_MINUS_45_DBM => "-45dBm", 
					RssiEnum.RSSI_MINUS_44_DBM => "-44dBm", 
					RssiEnum.RSSI_MINUS_43_DBM => "-43dBm", 
					RssiEnum.RSSI_MINUS_42_DBM => "-42dBm", 
					RssiEnum.RSSI_MINUS_41_DBM => "-41dBm", 
					RssiEnum.RSSI_MINUS_40_DBM => "-40dBm", 
					RssiEnum.RSSI_MINUS_39_DBM => "-39dBm", 
					RssiEnum.RSSI_MINUS_38_DBM => "-38dBm", 
					RssiEnum.RSSI_MINUS_37_DBM => "-37dBm", 
					RssiEnum.RSSI_MINUS_36_DBM => "-36dBm", 
					RssiEnum.RSSI_MINUS_35_DBM => "-35dBm", 
					RssiEnum.RSSI_MINUS_34_DBM => "-34dBm", 
					RssiEnum.RSSI_MINUS_33_DBM => "-33dBm", 
					RssiEnum.RSSI_MINUS_32_DBM => "-32dBm", 
					RssiEnum.RSSI_MINUS_31_DBM => "-31dBm", 
					RssiEnum.RSSI_MINUS_30_DBM => "-30dBm", 
					RssiEnum.RSSI_MINUS_29_DBM => "-29dBm", 
					RssiEnum.RSSI_MINUS_28_DBM => "-28dBm", 
					RssiEnum.RSSI_MINUS_27_DBM => "-27dBm", 
					RssiEnum.RSSI_MINUS_26_DBM => "-26dBm", 
					RssiEnum.RSSI_MINUS_25_DBM => "-25dBm", 
					RssiEnum.RSSI_MINUS_24_DBM => "-24dBm", 
					RssiEnum.RSSI_MINUS_23_DBM => "-23dBm", 
					RssiEnum.RSSI_MINUS_22_DBM => "-22dBm", 
					RssiEnum.RSSI_MINUS_21_DBM => "-21dBm", 
					RssiEnum.RSSI_MINUS_20_DBM => "-20dBm", 
					RssiEnum.RSSI_MINUS_19_DBM => "-19dBm", 
					RssiEnum.RSSI_MINUS_18_DBM => "-18dBm", 
					RssiEnum.RSSI_MINUS_17_DBM => "-17dBm", 
					RssiEnum.RSSI_MINUS_16_DBM => "-16dBm", 
					RssiEnum.RSSI_MINUS_15_DBM => "-15dBm", 
					RssiEnum.RSSI_MINUS_14_DBM => "-14dBm", 
					RssiEnum.RSSI_MINUS_13_DBM => "-13dBm", 
					RssiEnum.RSSI_MINUS_12_DBM => "-12dBm", 
					RssiEnum.RSSI_MINUS_11_DBM => "-11dBm", 
					RssiEnum.RSSI_MINUS_10_DBM => "-10dBm", 
					RssiEnum.RSSI_MINUS_9_DBM => "-9dBm", 
					RssiEnum.RSSI_MINUS_8_DBM => "-8dBm", 
					RssiEnum.RSSI_MINUS_7_DBM => "-7dBm", 
					RssiEnum.RSSI_MINUS_6_DBM => "-6dBm", 
					RssiEnum.RSSI_MINUS_5_DBM => "-5dBm", 
					RssiEnum.RSSI_MINUS_4_DBM => "-4dBm", 
					RssiEnum.RSSI_MINUS_3_DBM => "-3dBm", 
					RssiEnum.RSSI_MINUS_2_DBM => "-2dBm", 
					RssiEnum.RSSI_MINUS_1_DBM => "-1dBm", 
					_ => "Invalid Rssi Value", 
				};
			}

			public static string RssiToDescription()
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.AppendLine("0x0 = 0dBm");
				stringBuilder.AppendLine("0x1 = 1dBm");
				stringBuilder.AppendLine("0x2 = 2dBm");
				stringBuilder.AppendLine("0x3 = 3dBm");
				stringBuilder.AppendLine("0x4 = 4dBm");
				stringBuilder.AppendLine("0x5 = 5dBm");
				stringBuilder.AppendLine("0x6 = 6dBm");
				stringBuilder.AppendLine("0x7 = 7dBm");
				stringBuilder.AppendLine("0x8 = 8dBm");
				stringBuilder.AppendLine("0x9 = 9dBm");
				stringBuilder.AppendLine("0xA = 10dBm");
				stringBuilder.AppendLine("0xB = 11dBm");
				stringBuilder.AppendLine("0xC = 12dBm");
				stringBuilder.AppendLine("0xD = 13dBm");
				stringBuilder.AppendLine("0xE = 14dBm");
				stringBuilder.AppendLine("0xF = 15dBm");
				stringBuilder.AppendLine("0x10 = 16dBm");
				stringBuilder.AppendLine("0x11 = 17dBm");
				stringBuilder.AppendLine("0x12 = 18dBm");
				stringBuilder.AppendLine("0x13 = 19dBm");
				stringBuilder.AppendLine("0x14 = 20dBm");
				stringBuilder.AppendLine("0x81 = -127dBm");
				stringBuilder.AppendLine("0x82 = -126dBm");
				stringBuilder.AppendLine("0x83 = -125dBm");
				stringBuilder.AppendLine("0x84 = -124dBm");
				stringBuilder.AppendLine("0x85 = -123dBm");
				stringBuilder.AppendLine("0x86 = -122dBm");
				stringBuilder.AppendLine("0x87 = -121dBm");
				stringBuilder.AppendLine("0x88 = -120dBm");
				stringBuilder.AppendLine("0x89 = -119dBm");
				stringBuilder.AppendLine("0x8A = -118dBm");
				stringBuilder.AppendLine("0x8B = -117dBm");
				stringBuilder.AppendLine("0x8C = -116dBm");
				stringBuilder.AppendLine("0x8D = -115dBm");
				stringBuilder.AppendLine("0x8E = -114dBm");
				stringBuilder.AppendLine("0x8F = -113dBm");
				stringBuilder.AppendLine("0x90 = -112dBm");
				stringBuilder.AppendLine("0x91 = -111dBm");
				stringBuilder.AppendLine("0x92 = -110dBm");
				stringBuilder.AppendLine("0x93 = -109dBm");
				stringBuilder.AppendLine("0x94 = -108dBm");
				stringBuilder.AppendLine("0x95 = -107dBm");
				stringBuilder.AppendLine("0x96 = -106dBm");
				stringBuilder.AppendLine("0x97 = -105dBm");
				stringBuilder.AppendLine("0x98 = -104dBm");
				stringBuilder.AppendLine("0x99 = -103dBm");
				stringBuilder.AppendLine("0x9A = -102dBm");
				stringBuilder.AppendLine("0x9B = -101dBm");
				stringBuilder.AppendLine("0x9C = -100dBm");
				stringBuilder.AppendLine("0x9D = -99dBm");
				stringBuilder.AppendLine("0x9E = -98dBm");
				stringBuilder.AppendLine("0x9F = -97dBm");
				stringBuilder.AppendLine("0xA0 = -96dBm");
				stringBuilder.AppendLine("0xA1 = -95dBm");
				stringBuilder.AppendLine("0xA2 = -94dBm");
				stringBuilder.AppendLine("0xA3 = -93dBm");
				stringBuilder.AppendLine("0xA4 = -92dBm");
				stringBuilder.AppendLine("0xA5 = -91dBm");
				stringBuilder.AppendLine("0xA6 = -90dBm");
				stringBuilder.AppendLine("0xA7 = -89dBm");
				stringBuilder.AppendLine("0xA8 = -88dBm");
				stringBuilder.AppendLine("0xA9 = -87dBm");
				stringBuilder.AppendLine("0xAA = -86dBm");
				stringBuilder.AppendLine("0xAB = -85dBm");
				stringBuilder.AppendLine("0xAC = -84dBm");
				stringBuilder.AppendLine("0xAD = -83dBm");
				stringBuilder.AppendLine("0xAE = -82dBm");
				stringBuilder.AppendLine("0xAF = -81dBm");
				stringBuilder.AppendLine("0xB0 = -80dBm");
				stringBuilder.AppendLine("0xB1 = -79dBm");
				stringBuilder.AppendLine("0xB2 = -78dBm");
				stringBuilder.AppendLine("0xB3 = -77dBm");
				stringBuilder.AppendLine("0xB4 = -76dBm");
				stringBuilder.AppendLine("0xB5 = -75dBm");
				stringBuilder.AppendLine("0xB6 = -74dBm");
				stringBuilder.AppendLine("0xB7 = -73dBm");
				stringBuilder.AppendLine("0xB8 = -72dBm");
				stringBuilder.AppendLine("0xB9 = -71dBm");
				stringBuilder.AppendLine("0xBA = -70dBm");
				stringBuilder.AppendLine("0xBB = -69dBm");
				stringBuilder.AppendLine("0xBC = -68dBm");
				stringBuilder.AppendLine("0xBD = -67dBm");
				stringBuilder.AppendLine("0xBE = -66dBm");
				stringBuilder.AppendLine("0xBF = -65dBm");
				stringBuilder.AppendLine("0xC0 = -64dBm");
				stringBuilder.AppendLine("0xC1 = -63dBm");
				stringBuilder.AppendLine("0xC2 = -62dBm");
				stringBuilder.AppendLine("0xC3 = -61dBm");
				stringBuilder.AppendLine("0xC4 = -60dBm");
				stringBuilder.AppendLine("0xC5 = -59dBm");
				stringBuilder.AppendLine("0xC6 = -58dBm");
				stringBuilder.AppendLine("0xC7 = -57dBm");
				stringBuilder.AppendLine("0xC8 = -56dBm");
				stringBuilder.AppendLine("0xC9 = -55dBm");
				stringBuilder.AppendLine("0xCA = -54dBm");
				stringBuilder.AppendLine("0xCB = -53dBm");
				stringBuilder.AppendLine("0xCC = -52dBm");
				stringBuilder.AppendLine("0xCD = -51dBm");
				stringBuilder.AppendLine("0xCE = -50dBm");
				stringBuilder.AppendLine("0xCF = -49dBm");
				stringBuilder.AppendLine("0xD0 = -48dBm");
				stringBuilder.AppendLine("0xD1 = -47dBm");
				stringBuilder.AppendLine("0xD2 = -46dBm");
				stringBuilder.AppendLine("0xD3 = -45dBm");
				stringBuilder.AppendLine("0xD4 = -44dBm");
				stringBuilder.AppendLine("0xD5 = -43dBm");
				stringBuilder.AppendLine("0xD6 = -42dBm");
				stringBuilder.AppendLine("0xD7 = -41dBm");
				stringBuilder.AppendLine("0xD8 = -40dBm");
				stringBuilder.AppendLine("0xD9 = -39dBm");
				stringBuilder.AppendLine("0xDA = -38dBm");
				stringBuilder.AppendLine("0xDB = -37dBm");
				stringBuilder.AppendLine("0xDC = -36dBm");
				stringBuilder.AppendLine("0xDD = -35dBm");
				stringBuilder.AppendLine("0xDE = -34dBm");
				stringBuilder.AppendLine("0xDF = -33dBm");
				stringBuilder.AppendLine("0xE0 = -32dBm");
				stringBuilder.AppendLine("0xE1 = -31dBm");
				stringBuilder.AppendLine("0xE2 = -30dBm");
				stringBuilder.AppendLine("0xE3 = -29dBm");
				stringBuilder.AppendLine("0xE4 = -28dBm");
				stringBuilder.AppendLine("0xE5 = -27dBm");
				stringBuilder.AppendLine("0xE6 = -26dBm");
				stringBuilder.AppendLine("0xE7 = -25dBm");
				stringBuilder.AppendLine("0xE8 = -24dBm");
				stringBuilder.AppendLine("0xE9 = -23dBm");
				stringBuilder.AppendLine("0xEA = -22dBm");
				stringBuilder.AppendLine("0xEB = -21dBm");
				stringBuilder.AppendLine("0xEC = -20dBm");
				stringBuilder.AppendLine("0xED = -19dBm");
				stringBuilder.AppendLine("0xEE = -18dBm");
				stringBuilder.AppendLine("0xEF = -17dBm");
				stringBuilder.AppendLine("0xF0 = -16dBm");
				stringBuilder.AppendLine("0xF1 = -15dBm");
				stringBuilder.AppendLine("0xF2 = -14dBm");
				stringBuilder.AppendLine("0xF3 = -13dBm");
				stringBuilder.AppendLine("0xF4 = -12dBm");
				stringBuilder.AppendLine("0xF5 = -11dBm");
				stringBuilder.AppendLine("0xF6 = -10dBm");
				stringBuilder.AppendLine("0xF7 = -9dBm");
				stringBuilder.AppendLine("0xF8 = -8dBm");
				stringBuilder.AppendLine("0xF9 = -7dBm");
				stringBuilder.AppendLine("0xFA = -6dBm");
				stringBuilder.AppendLine("0xFB = -5dBm");
				stringBuilder.AppendLine("0xFC = -4dBm");
				stringBuilder.AppendLine("0xFD = -3dBm");
				stringBuilder.AppendLine("0xFE = -2dBm");
				stringBuilder.AppendLine("0xFF = -1dBm");
				return stringBuilder.ToString();
			}
		}

		private ulong _BdAddr;

		private uint _PageScanRepetitionMode;

		private uint _Reserved;

		private uint _ClassOfDevice;

		private uint _ClockOffset;

		private uint _Rssi;

		public ulong BdAddr
		{
			get
			{
				return _BdAddr;
			}
			set
			{
				_BdAddr = value;
			}
		}

		public uint PageScanRepetitionMode
		{
			get
			{
				return _PageScanRepetitionMode;
			}
			set
			{
				if (value > 255)
				{
					throw new Exception("Maximum possible value for PageScanRepetitionMode is 0xFF");
				}
				_PageScanRepetitionMode = value;
			}
		}

		public uint Reserved
		{
			get
			{
				return _Reserved;
			}
			set
			{
				if (value > 255)
				{
					throw new Exception("Maximum possible value for Reserved is 0xFF");
				}
				_Reserved = value;
			}
		}

		public uint ClassOfDevice
		{
			get
			{
				return _ClassOfDevice;
			}
			set
			{
				if (value > 16777215)
				{
					throw new Exception("Maximum possible value for ClassOfDevice is 0xFFFFFF");
				}
				_ClassOfDevice = value;
			}
		}

		public uint ClockOffset
		{
			get
			{
				return _ClockOffset;
			}
			set
			{
				if (value > 65535)
				{
					throw new Exception("Maximum possible value for ClockOffset is 0xFFFF");
				}
				_ClockOffset = value;
			}
		}

		public uint Rssi
		{
			get
			{
				return _Rssi;
			}
			set
			{
				if (value > 255)
				{
					throw new Exception("Maximum possible value for Rssi is 0xFF");
				}
				_Rssi = value;
			}
		}

		public PageScanRepetitionModeEnum GetPageScanRepetitionModeAsPageScanRepetitionModeEnum()
		{
			return PageScanRepetitionModeInfo.ValueToPageScanRepetitionMode(_PageScanRepetitionMode);
		}

		public void SetPageScanRepetitionModeAsPageScanRepetitionModeEnum(PageScanRepetitionModeEnum enumItem)
		{
			PageScanRepetitionMode = PageScanRepetitionModeInfo.PageScanRepetitionModeToValue(enumItem);
		}

		public RssiEnum GetRssiAsRssiEnum()
		{
			return RssiInfo.ValueToRssi(_Rssi);
		}

		public void SetRssiAsRssiEnum(RssiEnum enumItem)
		{
			Rssi = RssiInfo.RssiToValue(enumItem);
		}

		public bool FromBitBuilder(ref BitBuilder bitBuilder)
		{
			BdAddr = bitBuilder.RemoveBitsAsUlongLittleEndian(48);
			PageScanRepetitionMode = bitBuilder.RemoveBitsAsUint(8);
			Reserved = bitBuilder.RemoveBitsAsUint(8);
			ClassOfDevice = bitBuilder.RemoveBitsAsUintLittleEndian(24);
			ClockOffset = bitBuilder.RemoveBitsAsUintLittleEndian(16);
			Rssi = bitBuilder.RemoveBitsAsUint(8);
			return true;
		}

		public string ToBitString()
		{
			BitBuilder bitBuilder = new BitBuilder();
			bitBuilder.AddBitsAsUlongLittleEndian(BdAddr, 48);
			bitBuilder.AddBitsAsUint(PageScanRepetitionMode, 8);
			bitBuilder.AddBitsAsUint(Reserved, 8);
			bitBuilder.AddBitsAsUintLittleEndian(ClassOfDevice, 24);
			bitBuilder.AddBitsAsUintLittleEndian(ClockOffset, 16);
			bitBuilder.AddBitsAsUint(Rssi, 8);
			return bitBuilder.ToString();
		}
	}

	private const uint _EventCode = 34u;

	private Type[] expectedResponseTypes = new Type[0];

	private PacketInfoBase info;

	private uint _PayloadLength;

	public UserFieldsWrapper _UserFields = new UserFieldsWrapper();

	public override PacketType Type => PacketType.Notification;

	public override Type[] ExpectedResponseTypes => expectedResponseTypes;

	public override PacketInfoBase Info
	{
		get
		{
			if (info == null)
			{
				info = new InquiryResultWithRssiInfo(this);
			}
			return info;
		}
	}

	public uint EventCode => 34u;

	public uint PayloadLength
	{
		get
		{
			ToBitString();
			return _PayloadLength;
		}
	}

	public UserFieldsWrapper UserFields => _UserFields;

	protected override bool FromBitBuilder(ref BitBuilder bitBuilder)
	{
		if (bitBuilder.RemoveBitsAsUint(8) != EventCode)
		{
			return false;
		}
		_PayloadLength = bitBuilder.RemoveBitsAsUint(8);
		int numberOfBits = bitBuilder.GetNumberOfBits();
		if (numberOfBits > _PayloadLength * 8 + 7)
		{
			return false;
		}
		if (numberOfBits < _PayloadLength * 8)
		{
			return false;
		}
		UserFields.NumResponses = bitBuilder.RemoveBitsAsUint(8);
		for (int i = 0; i < UserFields.ResponseList.Count; i++)
		{
			UserFields.ResponseList[i].FromBitBuilder(ref bitBuilder);
		}
		if (bitBuilder.GetNumberOfBits() > 7)
		{
			return false;
		}
		return true;
	}

	public override string ToBitString()
	{
		BitBuilder bitBuilder = new BitBuilder();
		bitBuilder.AddBitsAsUint(EventCode, 8);
		int numberOfBits = bitBuilder.GetNumberOfBits();
		bitBuilder.AddBitsAsUint(0u, 8);
		bitBuilder.AddBitsAsUint(UserFields.NumResponses, 8);
		for (int i = 0; i < UserFields.ResponseList.Count; i++)
		{
			bitBuilder.AddBitsAsString(UserFields.ResponseList[i].ToBitString());
		}
		_PayloadLength = (uint)((bitBuilder.GetNumberOfBits() - numberOfBits - 8) / 8);
		if ((bitBuilder.GetNumberOfBits() - numberOfBits - 8) % 8 != 0)
		{
			_PayloadLength++;
		}
		bitBuilder.ChangeBitsAsUint(numberOfBits, _PayloadLength, 8);
		return bitBuilder.ToString();
	}
}
