Exemplo n.º 1
0
 /// <summary>
 /// Prints some device information.
 /// </summary>
 /// <param name="aPrologue"></param>
 /// <param name="aDevice"></param>
 private void PrintDeviceInfo(string aPrologue, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     string location;
     aDevice.GetAttribute("Upnp.Location", out location);
     string friendlyName;
     aDevice.GetAttribute("Upnp.FriendlyName", out friendlyName);
     Utils.Logger.Log(Utils.Logger.Level.Debug,
         aPrologue +
         "\n    udn = " + aDevice.Udn() +
         "\n    location = " + location +
         "\n    name = " + friendlyName
     );
 }
Exemplo n.º 2
0
        public CpConfigService_OhNet(OpenHome.Net.ControlPoint.CpDevice _configDevice)
        {
            _configDevice.GetAttribute("Upnp.FriendlyName", out FriendlyName);
                _configDevice.GetAttribute("Upnp.DeviceXml", out DeviceXml);
                _configDevice.GetAttribute("Upnp.Location", out Location);

                configService = new OpenHome.Net.ControlPoint.Proxies.CpProxyRaumfeldComConfigService1(_configDevice);
                //configService.SetPropertyInitialEvent(propertyChanged);
                configService.SetPropertyChanged(propertyChanged);
                configService.SetPropertyLastChangeChanged(propertyChanged);

                configService.Subscribe();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handler for CpDeviceList if devices are found on the network.
        /// </summary>
        /// <param name="aList"></param>
        /// <param name="aDevice"></param>
        private void DeviceAdded(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
        {
            lock (deviceList)
            {
                PrintDeviceInfo("Found", aDevice);

                string deviceXml;
                aDevice.GetAttribute("Upnp.DeviceXml", out deviceXml);

                XmlDocument xmlDeviceDescription = new XmlDocument();
                xmlDeviceDescription.LoadXml(deviceXml);

                if (UPnPTools.isMediaRenderer(xmlDeviceDescription))
                {
                    deviceList.Add(aDevice.Udn(), new UPnPDevice(aDevice, xmlDeviceDescription));
                    Utils.Logger.Log(Utils.Logger.Level.Debug, "Found usefull MediaRenderer: " + deviceList [aDevice.Udn()].FriendlyName);
                    OnDeviceDiscovered(deviceList [aDevice.Udn()]);
                }
            }
        }
Exemplo n.º 4
0
 protected void ConfigServiceFoundSink(OpenHome.Net.ControlPoint.CpDeviceList aList, OpenHome.Net.ControlPoint.CpDevice aDevice)
 {
     String name;
         aDevice.GetAttribute("Upnp.FriendlyName", out name);
         if (name == "Raumfeld ConfigDevice") // Only until find works correct!
         {
             CpConfigService configService = new CpConfigService_OhNet(aDevice);
             this.ConfigServiceFoundSink(configService);
         }
 }