Exemple #1
0
        private void MakeDiscoverable(string name)
        {
            if (_ssdpServer == null)
            {
                var _configuration = new UPNPConfiguration()
                {
                    UdpListnerPort  = _uPnPListenerPort,
                    FriendlyName    = name,
                    Manufacture     = "Tampa IoT Dev",
                    ModelName       = Constants.TankBotModelName,
                    DefaultPageHtml = @"<html>
<head>
<title>SoccerBot</title>
<link rel=""stylesheet"" href=""https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"" integrity=""sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"" crossorigin=""anonymous"">
</head>
<body>
<h1>Tampa IoT TankBot SSDP (uPnP) Listener Page</h1>
</body>
</html>"
                };

                try
                {
                    _ssdpServer = NetworkServices.GetSSDPServer();
                    _ssdpServer.MakeDiscoverable(9500, _configuration);
                }
                catch (Exception ex)
                {
                    _logger.NotifyUserError("ConnectionManager_MakeDiscoverable", ex.Message);
                }
            }
        }
        public void MakeDiscoverable(string name)
        {
            var _configuration = new UPNPConfiguration()
            {
                UdpListnerPort  = 1900,
                FriendlyName    = name,
                Manufacture     = "Tampa IoT Dev",
                ModelName       = "SoccerBot-mBot",
                DefaultPageHtml = @"<html>
<head>
<title>SoccerBot</title>
<link rel=""stylesheet"" href=""https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"" integrity=""sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"" crossorigin=""anonymous"">
</head>
<body>
<h1>Soccer Bot SSDP (uPnP) Listener Page</h1>
</body>
</html>"
            };


            _ssdpServer = NetworkServices.GetSSDPServer();
            _ssdpServer.MakeDiscoverable(9500, _configuration);
        }