Пример #1
0
        private static async Task StartMSearchRequestMulticastAsync()
        {
            var mSearchMessage = new MSearch
            {
                SearchCastMethod = CastMethod.Multicast,
                CPFN             = "TestXamarin",
                HostIp           = "239.255.255.250",
                HostPort         = 1900,
                MX = TimeSpan.FromSeconds(1),
                //Headers = new Dictionary<string, string>
                //{
                //    {"abc", "123"},
                //    {"cde", "345"}
                //},

                ST        = "upnp:rootdevice",
                UserAgent = new UserAgent
                {
                    OperatingSystem        = "Windows",
                    OperatingSystemVersion = "10.0",
                    ProductName            = "SSDP.UPNP.PCL",
                    ProductVersion         = "0.9",
                    UpnpMajorVersion       = "2",
                    UpnpMinorVersion       = "0",
                }
            };

            await _controlPoint.SendMSearchAsync(mSearchMessage);
        }
Пример #2
0
    private static async Task StartMSearchRequestMulticastAsync()
    {
        var mSearchMessage = new MSearch
        {
            TransportType = TransportType.Multicast,
            CPFN          = "TestXamarin",

            Name    = UdpSSDPMultiCastAddress,
            Port    = UdpSSDPMulticastPort,
            MX      = TimeSpan.FromSeconds(5),
            TCPPORT = TcpResponseListenerPort.ToString(),
            //ST = new ST("urn:myharmony-com:device:harmony:1"),
            ST = new ST
            {
                StSearchType = STType.All
            },
            //ST = new ST
            //{
            //    STtype  = STtype.ServiceType,
            //    Type = "SwitchPower",
            //    Version = "1",
            //    HasDomain = false
            //},
            //ST = new ST
            //{
            //    StSearchType = STSearchType.DomainDeviceSearch,
            //    Domain = "myharmony-com",
            //    DeviceType = "harmony",
            //    Version = "1",
            //    //STtype = STtype.DeviceType,
            //    ////DeviceUUID = "myharmony-com:device:harmony:1",
            //    //Type = "harmony",
            //    //Version = "1",
            //    //HasDomain = true,
            //    //DomainName = "myharmony-com"
            //},

            UserAgent = new UserAgent
            {
                OperatingSystem        = "Windows",
                OperatingSystemVersion = "10.0",
                ProductName            = "SSDP.UPNP.PCL",
                ProductVersion         = "0.9",
                UpnpMajorVersion       = "2",
                UpnpMinorVersion       = "0",
            }
        };

        await _controlPoint.SendMSearchAsync(mSearchMessage, _controlPointLocalIp1);

        //await Task.Delay(TimeSpan.FromSeconds(1));

        //await _controlPoint.SendMSearchAsync(mSearchMessage);

        //await Task.Delay(TimeSpan.FromSeconds(1));
        //await _controlPoint.SendMSearchAsync(mSearchMessage);
        //await Task.Delay(TimeSpan.FromSeconds(1));

        //await _controlPoint.SendMSearchAsync(mSearchMessage);
    }
Пример #3
0
        private static async Task StartMSearchRequestMulticastAsync()
        {
            var mSearchMessage = new MSearch
            {
                SearchCastMethod = CastMethod.Multicast,
                CPFN             = "TestXamarin",
                Name             = Initializer.UdpSSDPMultiCastAddress,
                Port             = Initializer.UdpSSDPMulticastPort,
                MX      = TimeSpan.FromSeconds(5),
                TCPPORT = Initializer.TcpResponseListenerPort.ToString(),
                ST      = new ST
                {
                    STtype = STtype.RootDevice,
                    //Type = "SwitchPower",
                    //Version = "1",
                    //HasDomain = false
                },

                UserAgent = new UserAgent
                {
                    OperatingSystem        = "Windows",
                    OperatingSystemVersion = "10.0",
                    ProductName            = "SSDP.UPNP.PCL",
                    ProductVersion         = "0.9",
                    UpnpMajorVersion       = "2",
                    UpnpMinorVersion       = "0",
                }
            };
            await _controlPoint.SendMSearchAsync(mSearchMessage);
        }
Пример #4
0
 private static async Task StartMSearchRequestMulticastAsync()
 {
     var mSearchMessage = new MSearch
     {
         SearchCastMethod = CastMethod.Multicast,
         CPFN             = "TestXamarin",
         HostIp           = "239.255.255.250",
         HostPort         = 1900,
         MX        = TimeSpan.FromSeconds(5),
         TCPPORT   = Initializer.TcpResponseListenerPort.ToString(),
         ST        = "upnp:rootdevice",
         UserAgent = new UserAgent
         {
             OperatingSystem        = "Windows",
             OperatingSystemVersion = "10.0",
             ProductName            = "SSDP.UPNP.PCL",
             ProductVersion         = "0.9",
             UpnpMajorVersion       = "2",
             UpnpMinorVersion       = "0",
         }
     };
     await _controlPoint.SendMSearchAsync(mSearchMessage);
 }