public Accessory(string DisplayName, string UUID) { if (DisplayName.Length == 0) { throw new InvalidOperationException("Accessories must be created with a non-empty displayName."); } if (UUID.Length == 0) { throw new InvalidOperationException("Accessories must be created with a valid UUID."); } if (!UUIDHelper.IsValid(UUID)) { throw new InvalidOperationException("UUID is not a valid UUID. Try using the provided 'generateUUID' function to create a valid UUID from any arbitrary string, like a serial number."); } this.DisplayName = DisplayName; this.UUID = UUID; this.Aid = null; // assigned by us in assignIDs() this.Reachable = true; this.Category = (int)Categories.OTHER; this.CameraSource = null; this.Services = new List <int>(); this.ShouldPurgeUnusedIDs = true; // Purge unused ids by default // create our initial "Accessory Information" Service that all Accessories are expected to have }