using System;
using System.Text;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class SetEventMask : PacketBase
{
	public class UserFieldsWrapper
	{
		public class EventMaskEnumCollection
		{
			private EnableBitEnum _InquiryCompleteEvent;

			private EnableBitEnum _InquiryResultEvent;

			private EnableBitEnum _ConnectionCompleteEvent;

			private EnableBitEnum _ConnectionRequestEvent;

			private EnableBitEnum _DisconnectionCompleteEvent;

			private EnableBitEnum _AuthenticationCompleteEvent;

			private EnableBitEnum _RemoteNameRequestCompleteEvent;

			private EnableBitEnum _EncryptionChangeEvent;

			private EnableBitEnum _ChangeConnectionLinkKeyCompleteEvent;

			private EnableBitEnum _MasterLinkKeyCompleteEvent;

			private EnableBitEnum _ReadRemoteSupportedFeaturesCompleteEvent;

			private EnableBitEnum _ReadRemoteVersionInformationCompleteEvent;

			private EnableBitEnum _QosSetupCompleteEvent;

			private EnableBitEnum _HardwareErrorEvent;

			private EnableBitEnum _FlushOccurredEvent;

			private EnableBitEnum _RoleChangeEvent;

			private EnableBitEnum _ModeChangeEvent;

			private EnableBitEnum _ReturnLinkKeysEvent;

			private EnableBitEnum _PinCodeRequestEvent;

			private EnableBitEnum _LinkKeyRequestEvent;

			private EnableBitEnum _LinkKeyNotificationEvent;

			private EnableBitEnum _LoopbackCommandEvent;

			private EnableBitEnum _DataBufferOverflowEvent;

			private EnableBitEnum _MaxSlotsChangeEvent;

			private EnableBitEnum _ReadClockOffsetCompleteEvent;

			private EnableBitEnum _ConnectionPacketTypeChangedEvent;

			private EnableBitEnum _QosViolationEvent;

			private EnableBitEnum _PageScanModeChangeEventDeprecated;

			private EnableBitEnum _PageScanRepetitionModeChangeEvent;

			private EnableBitEnum _FlowSpecificationCompleteEvent;

			private EnableBitEnum _InquiryResultWithRssiEvent;

			private EnableBitEnum _ReadRemoteExtendedFeaturesCompleteEvent;

			private EnableBitEnum _SynchronousConnectionCompleteEvent;

			private EnableBitEnum _SynchronousConnectionChangedEvent;

			private EnableBitEnum _SniffSubratingEvent;

			private EnableBitEnum _ExtendedInquiryResultEvent;

			private EnableBitEnum _EncryptionKeyRefreshCompleteEvent;

			private EnableBitEnum _IoCapabilityRequestEvent;

			private EnableBitEnum _IoCapabilityRequestReplyEvent;

			private EnableBitEnum _UserConfirmationRequestEvent;

			private EnableBitEnum _UserPasskeyRequestEvent;

			private EnableBitEnum _RemoteOobDataRequestEvent;

			private EnableBitEnum _SimplePairingCompleteEvent;

			private EnableBitEnum _LinkSupervisionTimeoutChangedEvent;

			private EnableBitEnum _EnhancedFlushCompleteEvent;

			private EnableBitEnum _UserPasskeyNotificationEvent;

			private EnableBitEnum _KeypressNotificationEvent;

			private EnableBitEnum _RemoteHostSupportedFeaturesNotificationEvent;

			private EnableBitEnum _LeMetaEvent;

			public EnableBitEnum InquiryCompleteEvent
			{
				get
				{
					return _InquiryCompleteEvent;
				}
				set
				{
					_InquiryCompleteEvent = value;
				}
			}

			public EnableBitEnum InquiryResultEvent
			{
				get
				{
					return _InquiryResultEvent;
				}
				set
				{
					_InquiryResultEvent = value;
				}
			}

			public EnableBitEnum ConnectionCompleteEvent
			{
				get
				{
					return _ConnectionCompleteEvent;
				}
				set
				{
					_ConnectionCompleteEvent = value;
				}
			}

			public EnableBitEnum ConnectionRequestEvent
			{
				get
				{
					return _ConnectionRequestEvent;
				}
				set
				{
					_ConnectionRequestEvent = value;
				}
			}

			public EnableBitEnum DisconnectionCompleteEvent
			{
				get
				{
					return _DisconnectionCompleteEvent;
				}
				set
				{
					_DisconnectionCompleteEvent = value;
				}
			}

			public EnableBitEnum AuthenticationCompleteEvent
			{
				get
				{
					return _AuthenticationCompleteEvent;
				}
				set
				{
					_AuthenticationCompleteEvent = value;
				}
			}

			public EnableBitEnum RemoteNameRequestCompleteEvent
			{
				get
				{
					return _RemoteNameRequestCompleteEvent;
				}
				set
				{
					_RemoteNameRequestCompleteEvent = value;
				}
			}

			public EnableBitEnum EncryptionChangeEvent
			{
				get
				{
					return _EncryptionChangeEvent;
				}
				set
				{
					_EncryptionChangeEvent = value;
				}
			}

			public EnableBitEnum ChangeConnectionLinkKeyCompleteEvent
			{
				get
				{
					return _ChangeConnectionLinkKeyCompleteEvent;
				}
				set
				{
					_ChangeConnectionLinkKeyCompleteEvent = value;
				}
			}

			public EnableBitEnum MasterLinkKeyCompleteEvent
			{
				get
				{
					return _MasterLinkKeyCompleteEvent;
				}
				set
				{
					_MasterLinkKeyCompleteEvent = value;
				}
			}

			public EnableBitEnum ReadRemoteSupportedFeaturesCompleteEvent
			{
				get
				{
					return _ReadRemoteSupportedFeaturesCompleteEvent;
				}
				set
				{
					_ReadRemoteSupportedFeaturesCompleteEvent = value;
				}
			}

			public EnableBitEnum ReadRemoteVersionInformationCompleteEvent
			{
				get
				{
					return _ReadRemoteVersionInformationCompleteEvent;
				}
				set
				{
					_ReadRemoteVersionInformationCompleteEvent = value;
				}
			}

			public EnableBitEnum QosSetupCompleteEvent
			{
				get
				{
					return _QosSetupCompleteEvent;
				}
				set
				{
					_QosSetupCompleteEvent = value;
				}
			}

			public EnableBitEnum HardwareErrorEvent
			{
				get
				{
					return _HardwareErrorEvent;
				}
				set
				{
					_HardwareErrorEvent = value;
				}
			}

			public EnableBitEnum FlushOccurredEvent
			{
				get
				{
					return _FlushOccurredEvent;
				}
				set
				{
					_FlushOccurredEvent = value;
				}
			}

			public EnableBitEnum RoleChangeEvent
			{
				get
				{
					return _RoleChangeEvent;
				}
				set
				{
					_RoleChangeEvent = value;
				}
			}

			public EnableBitEnum ModeChangeEvent
			{
				get
				{
					return _ModeChangeEvent;
				}
				set
				{
					_ModeChangeEvent = value;
				}
			}

			public EnableBitEnum ReturnLinkKeysEvent
			{
				get
				{
					return _ReturnLinkKeysEvent;
				}
				set
				{
					_ReturnLinkKeysEvent = value;
				}
			}

			public EnableBitEnum PinCodeRequestEvent
			{
				get
				{
					return _PinCodeRequestEvent;
				}
				set
				{
					_PinCodeRequestEvent = value;
				}
			}

			public EnableBitEnum LinkKeyRequestEvent
			{
				get
				{
					return _LinkKeyRequestEvent;
				}
				set
				{
					_LinkKeyRequestEvent = value;
				}
			}

			public EnableBitEnum LinkKeyNotificationEvent
			{
				get
				{
					return _LinkKeyNotificationEvent;
				}
				set
				{
					_LinkKeyNotificationEvent = value;
				}
			}

			public EnableBitEnum LoopbackCommandEvent
			{
				get
				{
					return _LoopbackCommandEvent;
				}
				set
				{
					_LoopbackCommandEvent = value;
				}
			}

			public EnableBitEnum DataBufferOverflowEvent
			{
				get
				{
					return _DataBufferOverflowEvent;
				}
				set
				{
					_DataBufferOverflowEvent = value;
				}
			}

			public EnableBitEnum MaxSlotsChangeEvent
			{
				get
				{
					return _MaxSlotsChangeEvent;
				}
				set
				{
					_MaxSlotsChangeEvent = value;
				}
			}

			public EnableBitEnum ReadClockOffsetCompleteEvent
			{
				get
				{
					return _ReadClockOffsetCompleteEvent;
				}
				set
				{
					_ReadClockOffsetCompleteEvent = value;
				}
			}

			public EnableBitEnum ConnectionPacketTypeChangedEvent
			{
				get
				{
					return _ConnectionPacketTypeChangedEvent;
				}
				set
				{
					_ConnectionPacketTypeChangedEvent = value;
				}
			}

			public EnableBitEnum QosViolationEvent
			{
				get
				{
					return _QosViolationEvent;
				}
				set
				{
					_QosViolationEvent = value;
				}
			}

			public EnableBitEnum PageScanModeChangeEventDeprecated
			{
				get
				{
					return _PageScanModeChangeEventDeprecated;
				}
				set
				{
					_PageScanModeChangeEventDeprecated = value;
				}
			}

			public EnableBitEnum PageScanRepetitionModeChangeEvent
			{
				get
				{
					return _PageScanRepetitionModeChangeEvent;
				}
				set
				{
					_PageScanRepetitionModeChangeEvent = value;
				}
			}

			public EnableBitEnum FlowSpecificationCompleteEvent
			{
				get
				{
					return _FlowSpecificationCompleteEvent;
				}
				set
				{
					_FlowSpecificationCompleteEvent = value;
				}
			}

			public EnableBitEnum InquiryResultWithRssiEvent
			{
				get
				{
					return _InquiryResultWithRssiEvent;
				}
				set
				{
					_InquiryResultWithRssiEvent = value;
				}
			}

			public EnableBitEnum ReadRemoteExtendedFeaturesCompleteEvent
			{
				get
				{
					return _ReadRemoteExtendedFeaturesCompleteEvent;
				}
				set
				{
					_ReadRemoteExtendedFeaturesCompleteEvent = value;
				}
			}

			public EnableBitEnum SynchronousConnectionCompleteEvent
			{
				get
				{
					return _SynchronousConnectionCompleteEvent;
				}
				set
				{
					_SynchronousConnectionCompleteEvent = value;
				}
			}

			public EnableBitEnum SynchronousConnectionChangedEvent
			{
				get
				{
					return _SynchronousConnectionChangedEvent;
				}
				set
				{
					_SynchronousConnectionChangedEvent = value;
				}
			}

			public EnableBitEnum SniffSubratingEvent
			{
				get
				{
					return _SniffSubratingEvent;
				}
				set
				{
					_SniffSubratingEvent = value;
				}
			}

			public EnableBitEnum ExtendedInquiryResultEvent
			{
				get
				{
					return _ExtendedInquiryResultEvent;
				}
				set
				{
					_ExtendedInquiryResultEvent = value;
				}
			}

			public EnableBitEnum EncryptionKeyRefreshCompleteEvent
			{
				get
				{
					return _EncryptionKeyRefreshCompleteEvent;
				}
				set
				{
					_EncryptionKeyRefreshCompleteEvent = value;
				}
			}

			public EnableBitEnum IoCapabilityRequestEvent
			{
				get
				{
					return _IoCapabilityRequestEvent;
				}
				set
				{
					_IoCapabilityRequestEvent = value;
				}
			}

			public EnableBitEnum IoCapabilityRequestReplyEvent
			{
				get
				{
					return _IoCapabilityRequestReplyEvent;
				}
				set
				{
					_IoCapabilityRequestReplyEvent = value;
				}
			}

			public EnableBitEnum UserConfirmationRequestEvent
			{
				get
				{
					return _UserConfirmationRequestEvent;
				}
				set
				{
					_UserConfirmationRequestEvent = value;
				}
			}

			public EnableBitEnum UserPasskeyRequestEvent
			{
				get
				{
					return _UserPasskeyRequestEvent;
				}
				set
				{
					_UserPasskeyRequestEvent = value;
				}
			}

			public EnableBitEnum RemoteOobDataRequestEvent
			{
				get
				{
					return _RemoteOobDataRequestEvent;
				}
				set
				{
					_RemoteOobDataRequestEvent = value;
				}
			}

			public EnableBitEnum SimplePairingCompleteEvent
			{
				get
				{
					return _SimplePairingCompleteEvent;
				}
				set
				{
					_SimplePairingCompleteEvent = value;
				}
			}

			public EnableBitEnum LinkSupervisionTimeoutChangedEvent
			{
				get
				{
					return _LinkSupervisionTimeoutChangedEvent;
				}
				set
				{
					_LinkSupervisionTimeoutChangedEvent = value;
				}
			}

			public EnableBitEnum EnhancedFlushCompleteEvent
			{
				get
				{
					return _EnhancedFlushCompleteEvent;
				}
				set
				{
					_EnhancedFlushCompleteEvent = value;
				}
			}

			public EnableBitEnum UserPasskeyNotificationEvent
			{
				get
				{
					return _UserPasskeyNotificationEvent;
				}
				set
				{
					_UserPasskeyNotificationEvent = value;
				}
			}

			public EnableBitEnum KeypressNotificationEvent
			{
				get
				{
					return _KeypressNotificationEvent;
				}
				set
				{
					_KeypressNotificationEvent = value;
				}
			}

			public EnableBitEnum RemoteHostSupportedFeaturesNotificationEvent
			{
				get
				{
					return _RemoteHostSupportedFeaturesNotificationEvent;
				}
				set
				{
					_RemoteHostSupportedFeaturesNotificationEvent = value;
				}
			}

			public EnableBitEnum LeMetaEvent
			{
				get
				{
					return _LeMetaEvent;
				}
				set
				{
					_LeMetaEvent = value;
				}
			}
		}

		public static class EventMaskInfo
		{
			public static EventMaskEnumCollection ValueToEventMask(ulong value)
			{
				EventMaskEnumCollection eventMaskEnumCollection = new EventMaskEnumCollection();
				eventMaskEnumCollection.InquiryCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)(value & 1));
				eventMaskEnumCollection.InquiryResultEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 2) >> 1));
				eventMaskEnumCollection.ConnectionCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 4) >> 2));
				eventMaskEnumCollection.ConnectionRequestEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 8) >> 3));
				eventMaskEnumCollection.DisconnectionCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x10) >> 4));
				eventMaskEnumCollection.AuthenticationCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x20) >> 5));
				eventMaskEnumCollection.RemoteNameRequestCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x40) >> 6));
				eventMaskEnumCollection.EncryptionChangeEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x80) >> 7));
				eventMaskEnumCollection.ChangeConnectionLinkKeyCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x100) >> 8));
				eventMaskEnumCollection.MasterLinkKeyCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x200) >> 9));
				eventMaskEnumCollection.ReadRemoteSupportedFeaturesCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x400) >> 10));
				eventMaskEnumCollection.ReadRemoteVersionInformationCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x800) >> 11));
				eventMaskEnumCollection.QosSetupCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x1000) >> 12));
				eventMaskEnumCollection.HardwareErrorEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x8000) >> 15));
				eventMaskEnumCollection.FlushOccurredEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x10000) >> 16));
				eventMaskEnumCollection.RoleChangeEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x20000) >> 17));
				eventMaskEnumCollection.ModeChangeEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x80000) >> 19));
				eventMaskEnumCollection.ReturnLinkKeysEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x100000) >> 20));
				eventMaskEnumCollection.PinCodeRequestEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x200000) >> 21));
				eventMaskEnumCollection.LinkKeyRequestEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x400000) >> 22));
				eventMaskEnumCollection.LinkKeyNotificationEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x800000) >> 23));
				eventMaskEnumCollection.LoopbackCommandEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x1000000) >> 24));
				eventMaskEnumCollection.DataBufferOverflowEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x2000000) >> 25));
				eventMaskEnumCollection.MaxSlotsChangeEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x4000000) >> 26));
				eventMaskEnumCollection.ReadClockOffsetCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x8000000) >> 27));
				eventMaskEnumCollection.ConnectionPacketTypeChangedEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x10000000) >> 28));
				eventMaskEnumCollection.QosViolationEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x20000000) >> 29));
				eventMaskEnumCollection.PageScanModeChangeEventDeprecated = EnableBitInfo.ValueToEnableBit((uint)((value & 0x40000000) >> 30));
				eventMaskEnumCollection.PageScanRepetitionModeChangeEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x80000000u) >> 31));
				eventMaskEnumCollection.FlowSpecificationCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x100000000L) >> 32));
				eventMaskEnumCollection.InquiryResultWithRssiEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x200000000L) >> 33));
				eventMaskEnumCollection.ReadRemoteExtendedFeaturesCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x400000000L) >> 34));
				eventMaskEnumCollection.SynchronousConnectionCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x80000000000L) >> 43));
				eventMaskEnumCollection.SynchronousConnectionChangedEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x100000000000L) >> 44));
				eventMaskEnumCollection.SniffSubratingEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x200000000000L) >> 45));
				eventMaskEnumCollection.ExtendedInquiryResultEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x400000000000L) >> 46));
				eventMaskEnumCollection.EncryptionKeyRefreshCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x800000000000L) >> 47));
				eventMaskEnumCollection.IoCapabilityRequestEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x1000000000000L) >> 48));
				eventMaskEnumCollection.IoCapabilityRequestReplyEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x2000000000000L) >> 49));
				eventMaskEnumCollection.UserConfirmationRequestEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x4000000000000L) >> 50));
				eventMaskEnumCollection.UserPasskeyRequestEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x8000000000000L) >> 51));
				eventMaskEnumCollection.RemoteOobDataRequestEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x10000000000000L) >> 52));
				eventMaskEnumCollection.SimplePairingCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x20000000000000L) >> 53));
				eventMaskEnumCollection.LinkSupervisionTimeoutChangedEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x80000000000000L) >> 55));
				eventMaskEnumCollection.EnhancedFlushCompleteEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x100000000000000L) >> 56));
				eventMaskEnumCollection.UserPasskeyNotificationEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x400000000000000L) >> 58));
				eventMaskEnumCollection.KeypressNotificationEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x800000000000000L) >> 59));
				eventMaskEnumCollection.RemoteHostSupportedFeaturesNotificationEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x1000000000000000L) >> 60));
				eventMaskEnumCollection.LeMetaEvent = EnableBitInfo.ValueToEnableBit((uint)((value & 0x2000000000000000L) >> 61));
				return eventMaskEnumCollection;
			}

			public static ulong EventMaskToValue(EventMaskEnumCollection enumCollection)
			{
				ulong num = 0uL;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.InquiryCompleteEvent);
				num |= EnableBitInfo.EnableBitToValue(enumCollection.InquiryResultEvent) << 1;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ConnectionCompleteEvent) << 2;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ConnectionRequestEvent) << 3;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.DisconnectionCompleteEvent) << 4;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.AuthenticationCompleteEvent) << 5;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.RemoteNameRequestCompleteEvent) << 6;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.EncryptionChangeEvent) << 7;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ChangeConnectionLinkKeyCompleteEvent) << 8;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.MasterLinkKeyCompleteEvent) << 9;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ReadRemoteSupportedFeaturesCompleteEvent) << 10;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ReadRemoteVersionInformationCompleteEvent) << 11;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.QosSetupCompleteEvent) << 12;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.HardwareErrorEvent) << 15;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.FlushOccurredEvent) << 16;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.RoleChangeEvent) << 17;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ModeChangeEvent) << 19;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ReturnLinkKeysEvent) << 20;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.PinCodeRequestEvent) << 21;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.LinkKeyRequestEvent) << 22;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.LinkKeyNotificationEvent) << 23;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.LoopbackCommandEvent) << 24;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.DataBufferOverflowEvent) << 25;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.MaxSlotsChangeEvent) << 26;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ReadClockOffsetCompleteEvent) << 27;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ConnectionPacketTypeChangedEvent) << 28;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.QosViolationEvent) << 29;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.PageScanModeChangeEventDeprecated) << 30;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.PageScanRepetitionModeChangeEvent) << 31;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.FlowSpecificationCompleteEvent);
				num |= EnableBitInfo.EnableBitToValue(enumCollection.InquiryResultWithRssiEvent) << 1;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ReadRemoteExtendedFeaturesCompleteEvent) << 2;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.SynchronousConnectionCompleteEvent) << 11;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.SynchronousConnectionChangedEvent) << 12;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.SniffSubratingEvent) << 13;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.ExtendedInquiryResultEvent) << 14;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.EncryptionKeyRefreshCompleteEvent) << 15;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.IoCapabilityRequestEvent) << 16;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.IoCapabilityRequestReplyEvent) << 17;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.UserConfirmationRequestEvent) << 18;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.UserPasskeyRequestEvent) << 19;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.RemoteOobDataRequestEvent) << 20;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.SimplePairingCompleteEvent) << 21;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.LinkSupervisionTimeoutChangedEvent) << 23;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.EnhancedFlushCompleteEvent) << 24;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.UserPasskeyNotificationEvent) << 26;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.KeypressNotificationEvent) << 27;
				num |= EnableBitInfo.EnableBitToValue(enumCollection.RemoteHostSupportedFeaturesNotificationEvent) << 28;
				return num | (EnableBitInfo.EnableBitToValue(enumCollection.LeMetaEvent) << 29);
			}

			public static string EventMaskToString(EventMaskEnumCollection enumCollection)
			{
				string text = "";
				text = text + "Inquiry Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.InquiryCompleteEvent) + "\r\n";
				text = text + "Inquiry Result Event: " + EnableBitInfo.EnableBitToString(enumCollection.InquiryResultEvent) + "\r\n";
				text = text + "Connection Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.ConnectionCompleteEvent) + "\r\n";
				text = text + "Connection Request Event: " + EnableBitInfo.EnableBitToString(enumCollection.ConnectionRequestEvent) + "\r\n";
				text = text + "Disconnection Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.DisconnectionCompleteEvent) + "\r\n";
				text = text + "Authentication Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.AuthenticationCompleteEvent) + "\r\n";
				text = text + "Remote Name Request Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.RemoteNameRequestCompleteEvent) + "\r\n";
				text = text + "Encryption Change Event: " + EnableBitInfo.EnableBitToString(enumCollection.EncryptionChangeEvent) + "\r\n";
				text = text + "Change Connection Link Key Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.ChangeConnectionLinkKeyCompleteEvent) + "\r\n";
				text = text + "Master Link Key Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.MasterLinkKeyCompleteEvent) + "\r\n";
				text = text + "Read Remote Supported Features Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.ReadRemoteSupportedFeaturesCompleteEvent) + "\r\n";
				text = text + "Read Remote Version Information Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.ReadRemoteVersionInformationCompleteEvent) + "\r\n";
				text = text + "QoS Setup Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.QosSetupCompleteEvent) + "\r\n";
				text = text + "Hardware Error Event: " + EnableBitInfo.EnableBitToString(enumCollection.HardwareErrorEvent) + "\r\n";
				text = text + "Flush Occurred Event: " + EnableBitInfo.EnableBitToString(enumCollection.FlushOccurredEvent) + "\r\n";
				text = text + "Role Change Event: " + EnableBitInfo.EnableBitToString(enumCollection.RoleChangeEvent) + "\r\n";
				text = text + "Mode Change Event: " + EnableBitInfo.EnableBitToString(enumCollection.ModeChangeEvent) + "\r\n";
				text = text + "Return Link Keys Event: " + EnableBitInfo.EnableBitToString(enumCollection.ReturnLinkKeysEvent) + "\r\n";
				text = text + "PIN Code Request Event: " + EnableBitInfo.EnableBitToString(enumCollection.PinCodeRequestEvent) + "\r\n";
				text = text + "Link Key Request Event: " + EnableBitInfo.EnableBitToString(enumCollection.LinkKeyRequestEvent) + "\r\n";
				text = text + "Link Key Notification Event: " + EnableBitInfo.EnableBitToString(enumCollection.LinkKeyNotificationEvent) + "\r\n";
				text = text + "Loopback Command Event: " + EnableBitInfo.EnableBitToString(enumCollection.LoopbackCommandEvent) + "\r\n";
				text = text + "Data Buffer Overflow Event: " + EnableBitInfo.EnableBitToString(enumCollection.DataBufferOverflowEvent) + "\r\n";
				text = text + "Max Slots Change Event: " + EnableBitInfo.EnableBitToString(enumCollection.MaxSlotsChangeEvent) + "\r\n";
				text = text + "Read Clock Offset Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.ReadClockOffsetCompleteEvent) + "\r\n";
				text = text + "Connection Packet Type Changed Event: " + EnableBitInfo.EnableBitToString(enumCollection.ConnectionPacketTypeChangedEvent) + "\r\n";
				text = text + "QoS Violation Event: " + EnableBitInfo.EnableBitToString(enumCollection.QosViolationEvent) + "\r\n";
				text = text + "Page Scan Mode Change Event deprecated: " + EnableBitInfo.EnableBitToString(enumCollection.PageScanModeChangeEventDeprecated) + "\r\n";
				text = text + "Page Scan Repetition Mode Change Event: " + EnableBitInfo.EnableBitToString(enumCollection.PageScanRepetitionModeChangeEvent) + "\r\n";
				text = text + "Flow Specification Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.FlowSpecificationCompleteEvent) + "\r\n";
				text = text + "Inquiry Result with RSSI Event: " + EnableBitInfo.EnableBitToString(enumCollection.InquiryResultWithRssiEvent) + "\r\n";
				text = text + "Read Remote Extended Features Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.ReadRemoteExtendedFeaturesCompleteEvent) + "\r\n";
				text = text + "Synchronous Connection Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.SynchronousConnectionCompleteEvent) + "\r\n";
				text = text + "Synchronous Connection Changed Event: " + EnableBitInfo.EnableBitToString(enumCollection.SynchronousConnectionChangedEvent) + "\r\n";
				text = text + "Sniff Subrating Event: " + EnableBitInfo.EnableBitToString(enumCollection.SniffSubratingEvent) + "\r\n";
				text = text + "Extended Inquiry Result Event: " + EnableBitInfo.EnableBitToString(enumCollection.ExtendedInquiryResultEvent) + "\r\n";
				text = text + "Encryption Key Refresh Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.EncryptionKeyRefreshCompleteEvent) + "\r\n";
				text = text + "IO Capability Request Event: " + EnableBitInfo.EnableBitToString(enumCollection.IoCapabilityRequestEvent) + "\r\n";
				text = text + "IO Capability Request Reply Event: " + EnableBitInfo.EnableBitToString(enumCollection.IoCapabilityRequestReplyEvent) + "\r\n";
				text = text + "User Confirmation Request Event: " + EnableBitInfo.EnableBitToString(enumCollection.UserConfirmationRequestEvent) + "\r\n";
				text = text + "User Passkey Request Event: " + EnableBitInfo.EnableBitToString(enumCollection.UserPasskeyRequestEvent) + "\r\n";
				text = text + "Remote OOB Data Request Event: " + EnableBitInfo.EnableBitToString(enumCollection.RemoteOobDataRequestEvent) + "\r\n";
				text = text + "Simple Pairing Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.SimplePairingCompleteEvent) + "\r\n";
				text = text + "Link Supervision Timeout Changed Event: " + EnableBitInfo.EnableBitToString(enumCollection.LinkSupervisionTimeoutChangedEvent) + "\r\n";
				text = text + "Enhanced Flush Complete Event: " + EnableBitInfo.EnableBitToString(enumCollection.EnhancedFlushCompleteEvent) + "\r\n";
				text = text + "User Passkey Notification Event: " + EnableBitInfo.EnableBitToString(enumCollection.UserPasskeyNotificationEvent) + "\r\n";
				text = text + "Keypress Notification Event: " + EnableBitInfo.EnableBitToString(enumCollection.KeypressNotificationEvent) + "\r\n";
				text = text + "Remote Host Supported Features Notification Event: " + EnableBitInfo.EnableBitToString(enumCollection.RemoteHostSupportedFeaturesNotificationEvent) + "\r\n";
				text = text + "LE Meta-Event: " + EnableBitInfo.EnableBitToString(enumCollection.LeMetaEvent) + "\r\n";
				return text.TrimEnd('\r', '\n');
			}

			public static string EventMaskToDescription()
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.AppendLine("Bit 0: Inquiry Complete Event");
				stringBuilder.AppendLine("Bit 1: Inquiry Result Event");
				stringBuilder.AppendLine("Bit 2: Connection Complete Event");
				stringBuilder.AppendLine("Bit 3: Connection Request Event");
				stringBuilder.AppendLine("Bit 4: Disconnection Complete Event");
				stringBuilder.AppendLine("Bit 5: Authentication Complete Event");
				stringBuilder.AppendLine("Bit 6: Remote Name Request Complete Event");
				stringBuilder.AppendLine("Bit 7: Encryption Change Event");
				stringBuilder.AppendLine("Bit 8: Change Connection Link Key Complete Event");
				stringBuilder.AppendLine("Bit 9: Master Link Key Complete Event");
				stringBuilder.AppendLine("Bit 10: Read Remote Supported Features Complete Event");
				stringBuilder.AppendLine("Bit 11: Read Remote Version Information Complete Event");
				stringBuilder.AppendLine("Bit 12: QoS Setup Complete Event");
				stringBuilder.AppendLine("Bits 14-13: Reserved");
				stringBuilder.AppendLine("Bit 15: Hardware Error Event");
				stringBuilder.AppendLine("Bit 16: Flush Occurred Event");
				stringBuilder.AppendLine("Bit 17: Role Change Event");
				stringBuilder.AppendLine("Bit 18: Reserved");
				stringBuilder.AppendLine("Bit 19: Mode Change Event");
				stringBuilder.AppendLine("Bit 20: Return Link Keys Event");
				stringBuilder.AppendLine("Bit 21: PIN Code Request Event");
				stringBuilder.AppendLine("Bit 22: Link Key Request Event");
				stringBuilder.AppendLine("Bit 23: Link Key Notification Event");
				stringBuilder.AppendLine("Bit 24: Loopback Command Event");
				stringBuilder.AppendLine("Bit 25: Data Buffer Overflow Event");
				stringBuilder.AppendLine("Bit 26: Max Slots Change Event");
				stringBuilder.AppendLine("Bit 27: Read Clock Offset Complete Event");
				stringBuilder.AppendLine("Bit 28: Connection Packet Type Changed Event");
				stringBuilder.AppendLine("Bit 29: QoS Violation Event");
				stringBuilder.AppendLine("Bit 30: Page Scan Mode Change Event deprecated");
				stringBuilder.AppendLine("Bit 31: Page Scan Repetition Mode Change Event");
				stringBuilder.AppendLine("Bit 32: Flow Specification Complete Event");
				stringBuilder.AppendLine("Bit 33: Inquiry Result with RSSI Event");
				stringBuilder.AppendLine("Bit 34: Read Remote Extended Features Complete Event");
				stringBuilder.AppendLine("Bits 42-35: Reserved");
				stringBuilder.AppendLine("Bit 43: Synchronous Connection Complete Event");
				stringBuilder.AppendLine("Bit 44: Synchronous Connection Changed Event");
				stringBuilder.AppendLine("Bit 45: Sniff Subrating Event");
				stringBuilder.AppendLine("Bit 46: Extended Inquiry Result Event");
				stringBuilder.AppendLine("Bit 47: Encryption Key Refresh Complete Event");
				stringBuilder.AppendLine("Bit 48: IO Capability Request Event");
				stringBuilder.AppendLine("Bit 49: IO Capability Request Reply Event");
				stringBuilder.AppendLine("Bit 50: User Confirmation Request Event");
				stringBuilder.AppendLine("Bit 51: User Passkey Request Event");
				stringBuilder.AppendLine("Bit 52: Remote OOB Data Request Event");
				stringBuilder.AppendLine("Bit 53: Simple Pairing Complete Event");
				stringBuilder.AppendLine("Bit 54: Reserved");
				stringBuilder.AppendLine("Bit 55: Link Supervision Timeout Changed Event");
				stringBuilder.AppendLine("Bit 56: Enhanced Flush Complete Event");
				stringBuilder.AppendLine("Bit 57: Reserved");
				stringBuilder.AppendLine("Bit 58: User Passkey Notification Event");
				stringBuilder.AppendLine("Bit 59: Keypress Notification Event");
				stringBuilder.AppendLine("Bit 60: Remote Host Supported Features Notification Event");
				stringBuilder.AppendLine("Bit 61: LE Meta-Event");
				stringBuilder.AppendLine("Bits 63-62: Reserved for future use");
				return stringBuilder.ToString();
			}
		}

		private ulong _EventMask;

		public ulong EventMask
		{
			get
			{
				return _EventMask;
			}
			set
			{
				_EventMask = value;
			}
		}

		public EventMaskEnumCollection GetEventMaskAsEventMaskEnumCollection()
		{
			return EventMaskInfo.ValueToEventMask(_EventMask);
		}

		public void SetEventMaskAsEventMaskEnumCollection(EventMaskEnumCollection enumCollection)
		{
			EventMask = EventMaskInfo.EventMaskToValue(enumCollection);
		}
	}

	private const uint _Opcode = 3073u;

	private Type[] expectedResponseTypes = new Type[1] { typeof(CommandCompleteForSetEventMask) };

	private PacketInfoBase info;

	private uint _PayloadLength;

	public UserFieldsWrapper _UserFields = new UserFieldsWrapper();

	public override PacketType Type => PacketType.Command;

	public override Type[] ExpectedResponseTypes => expectedResponseTypes;

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

	public uint Opcode => 3073u;

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

	public UserFieldsWrapper UserFields => _UserFields;

	public override void SetDefaultValues()
	{
		UserFields.EventMask = 35184372088831uL;
	}

	protected override bool FromBitBuilder(ref BitBuilder bitBuilder)
	{
		if (bitBuilder.RemoveBitsAsUintLittleEndian(16) != Opcode)
		{
			return false;
		}
		_PayloadLength = bitBuilder.RemoveBitsAsUint(8);
		int numberOfBits = bitBuilder.GetNumberOfBits();
		if (numberOfBits > _PayloadLength * 8 + 7)
		{
			return false;
		}
		if (numberOfBits < _PayloadLength * 8)
		{
			return false;
		}
		UserFields.EventMask = bitBuilder.RemoveBitsAsUlongLittleEndian(64);
		if (bitBuilder.GetNumberOfBits() > 7)
		{
			return false;
		}
		return true;
	}

	public override string ToBitString()
	{
		BitBuilder bitBuilder = new BitBuilder();
		bitBuilder.AddBitsAsUintLittleEndian(Opcode, 16);
		int numberOfBits = bitBuilder.GetNumberOfBits();
		bitBuilder.AddBitsAsUint(0u, 8);
		bitBuilder.AddBitsAsUlongLittleEndian(UserFields.EventMask, 64);
		_PayloadLength = (uint)((bitBuilder.GetNumberOfBits() - numberOfBits - 8) / 8);
		if ((bitBuilder.GetNumberOfBits() - numberOfBits - 8) % 8 != 0)
		{
			_PayloadLength++;
		}
		bitBuilder.ChangeBitsAsUint(numberOfBits, _PayloadLength, 8);
		return bitBuilder.ToString();
	}
}
