示例#1
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            //Note, you can use deviceDefinition.ToDescriptionDocumentText() to retrieve the data to
            //return from the Location end point, you just need to get that data to your service
            //implementation somehow. Depends on how you've implemented your service.

            _Publisher = new SsdpDevicePublisher();
            _device    = PublishDevice();
            _Publisher.AddDevice(_device);

            await StartWebserverAsync();
        }
示例#2
0
        // Call this method from somewhere to actually do the publish.
        public SsdpHueBridgeDevice PublishDevice()
        {
            // As this is a sample, we are only setting the minimum required properties.
            var deviceDefinition = new SsdpHueBridgeDevice()
            {
                Uuid                        = Guid.NewGuid().ToString(),
                Manufacturer                = "Me",
                FriendlyName                = "Name",
                ModelName                   = "HueBridgeEmulator",
                HttpServerIpAddress         = "192.168.178.48",
                HttpServerPort              = "80",
                HttpServerOptionalSubFolder = "/api/hue",
                MacAddress                  = "b827eb1cf6c9"
            };

            return(deviceDefinition);
        }