Пример #1
0
        /// <summary>
        /// Sends a NOTIFY packet "ssdp:alive" to all UPnP endpoints.
        /// </summary>
        /// <param name="NT">Notification type.</param>
        /// <param name="USN">Unique Service Name.</param>
        /// <param name="rootDevice">Root device for that the message should be send.</param>
        public void SendMessage(string NT, string USN, DvDevice rootDevice)
        {
            SimpleHTTPRequest response = new SimpleHTTPRequest("NOTIFY", "*");

            response.SetHeader("CACHE-CONTROL", "max-age = " + _serverData.AdvertisementExpirationTime);
            response.SetHeader("NT", NT);
            response.SetHeader("NTS", "ssdp:alive");
            response.SetHeader("SERVER", UPnPConfiguration.UPnPMachineInfoHeader);
            response.SetHeader("USN", USN);
            response.SetHeader("BOOTID.UPNP.ORG", _serverData.BootId.ToString());
            // Currently, we don't support SEARCHPORT.UPNP.ORG function and header

            foreach (EndpointConfiguration config in _serverData.UPnPEndPoints)
            {
                if (config.AddressFamily == AddressFamily.InterNetworkV6)
                {
                    response.SetHeader("OPT", "\"http://schemas.upnp.org/upnp/1/0/\"; ns=01");
                    response.SetHeader("01-NLS", _serverData.BootId.ToString());
                }
                response.SetHeader("CONFIGID.UPNP.ORG", config.ConfigId.ToString());
                IPEndPoint ep = new IPEndPoint(config.SSDPMulticastAddress, UPnPConsts.SSDP_MULTICAST_PORT);
                response.SetHeader("HOST", NetworkHelper.IPEndPointToString(ep));
                if (config.SSDPUsesSpecialSearchPort)
                {
                    response.SetHeader("SEARCHPORT.UPNP.ORG", config.SSDPSearchPort.ToString());
                }
                response.SetHeader("LOCATION", config.GetRootDeviceDescriptionURL(rootDevice));
                byte[] bytes = response.Encode();
                NetworkHelper.MulticastMessage(config.SSDP_UDP_UnicastSocket, config.SSDPMulticastAddress, bytes);
            }
        }
Пример #2
0
        public ProviderTestBasic(DvDevice aDevice)
            : base(aDevice)
        {
            EnablePropertyVarUint();
            EnablePropertyVarInt();
            EnablePropertyVarBool();
            EnablePropertyVarStr();
            EnablePropertyVarBin();
            SetPropertyVarUint(0);
            SetPropertyVarInt(0);
            SetPropertyVarBool(false);
            string empty = "";

            byte[] emptyBinary = new byte[0];
            SetPropertyVarStr(empty);
            SetPropertyVarBin(emptyBinary);

            EnableActionIncrement();
            EnableActionDecrement();
            EnableActionToggle();
            EnableActionEchoString();
            EnableActionEchoBinary();
            EnableActionSetUint();
            EnableActionGetUint();
            EnableActionSetInt();
            EnableActionGetInt();
            EnableActionSetBool();
            EnableActionGetBool();
            EnableActionSetString();
            EnableActionGetString();
            EnableActionSetBinary();
            EnableActionGetBinary();
            EnableActionSetMultiple();
        }
        protected static void GeneratePathsRecursive(DvDevice device, EndpointConfiguration config)
        {
            string deviceRelUrl = StringUtils.CheckSuffix(device.UDN, "/");

            foreach (DvService service in device.Services)
            {
                ServicePaths servicePaths = new ServicePaths
                {
                    SCPDPath =
                        GenerateAndAddUniquePath(config.SCPDPathsToServices,
                                                 config.DescriptionPathBase + deviceRelUrl + service.ServiceTypeVersion_URN, ".xml", service),
                    ControlPath =
                        GenerateAndAddUniquePath(config.ControlPathsToServices,
                                                 config.ControlPathBase + deviceRelUrl + service.ServiceTypeVersion_URN, string.Empty, service),
                    EventSubPath =
                        GenerateAndAddUniquePath(config.EventSubPathsToServices,
                                                 config.EventSubPathBase + deviceRelUrl + service.ServiceTypeVersion_URN, string.Empty, service)
                };
                config.ServicePaths.Add(service, servicePaths);
            }
            foreach (DvDevice embeddedDevice in device.EmbeddedDevices)
            {
                GeneratePathsRecursive(embeddedDevice, config);
            }
        }
        protected static void SendMessagesEmbeddedDevice(DvDevice rootDevice, DvDevice device, ISSDPDiscoveryMessageSender messageSender)
        {
            string deviceUDN = device.UDN;

            messageSender.SendMessage(deviceUDN, deviceUDN, rootDevice);
            messageSender.SendMessage(device.DeviceTypeVersion_URN, deviceUDN + "::" + device.DeviceTypeVersion_URN, rootDevice);
        }
        protected static void SendMessagesService(DvDevice rootDevice, DvDevice device, string serviceTypeVersion_URN,
                                                  ISSDPDiscoveryMessageSender messageSender)
        {
            string deviceUUID = device.UDN;

            messageSender.SendMessage(serviceTypeVersion_URN, deviceUUID + "::" + serviceTypeVersion_URN, rootDevice);
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderOpenhomeOrgTestDimmableLight1(DvDevice aDevice)
     : base(aDevice, "openhome.org", "TestDimmableLight", 1)
 {
     iGch = GCHandle.Alloc(this);
     iPropertyA_ARG_Level = new PropertyUint(new ParameterUint("A_ARG_Level"));
     AddProperty(iPropertyA_ARG_Level);
 }
Пример #7
0
        public void Activated(PluginRuntime pluginRuntime)
        {
            var meta = pluginRuntime.Metadata;

            Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));

            DvDevice device = ServiceRegistration.Get <IBackendServer>().UPnPBackendServer.FindDevicesByDeviceTypeAndVersion(UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE_VERSION, true).FirstOrDefault();

            if (device != null)
            {
                var serverSettings = new ServerSettingsImpl();
                Logger.Debug("ServerSettings: Registering ServerSettings service.");
                device.AddService(serverSettings);
                Logger.Debug("ServerSettings: Adding ServerSettings service to MP2 backend root device");

                // List all assemblies
                InitPluginAssemblyList();

                // Set our own resolver to lookup types from any of assemblies from Plugins subfolder.
                SettingsSerializer.CustomAssemblyResolver = PluginsAssemblyResolver;
                // AppDomain.CurrentDomain.AssemblyResolve += PluginsAssemblyResolver;

                Logger.Debug("ServerSettings: Adding Plugins folder to private path");
            }
            else
            {
                Logger.Error("ServerSettings: MP2 backend root device not found!");
            }
        }
Пример #8
0
        public void SendMessage(string NT, string USN, DvDevice rootDevice)
        {
            SimpleHTTPResponse response = new SimpleHTTPResponse(HTTPResponseCode.Ok);

            response.SetHeader("CACHE-CONTROL", "max-age = " + _serverData.AdvertisementExpirationTime);
            response.SetHeader("DATE", DateTime.Now.ToUniversalTime().ToString("R"));
            response.SetHeader("EXT", string.Empty);
            response.SetHeader("SERVER", UPnPConfiguration.UPnPMachineInfoHeader);
            response.SetHeader("ST", NT);
            response.SetHeader("USN", USN);
            response.SetHeader("BOOTID.UPNP.ORG", _serverData.BootId.ToString());
            response.SetHeader("CONFIGID.UPNP.ORG", _localEndpointConfiguration.ConfigId.ToString());
            if (_localEndpointConfiguration.AddressFamily == AddressFamily.InterNetworkV6)
            {
                response.SetHeader("OPT", "\"http://schemas.upnp.org/upnp/1/0/\"; ns=01");
                response.SetHeader("01-NLS", _serverData.BootId.ToString());
            }
            if (_localEndpointConfiguration.SSDPUsesSpecialSearchPort)
            {
                response.SetHeader("SEARCHPORT.UPNP.ORG", _localEndpointConfiguration.SSDPSearchPort.ToString());
            }

            response.SetHeader("LOCATION", _localEndpointConfiguration.GetRootDeviceDescriptionURL(rootDevice));
            byte[] bytes  = response.Encode();
            Socket socket = _localEndpointConfiguration.SSDP_UDP_UnicastSocket;

            if (socket != null)
            {
                NetworkHelper.SendData(socket, _receiverEndPoint, bytes, 1);
            }
        }
Пример #9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgSwitchPower1(DvDevice aDevice)
     : base(aDevice, "upnp.org", "SwitchPower", 1)
 {
     iGch = GCHandle.Alloc(this);
     iPropertyStatus = new PropertyBool(new ParameterBool("Status"));
     AddProperty(iPropertyStatus);
 }
Пример #10
0
 protected void ProcessSearchRequest(PendingSearchRequest ps)
 {
     lock (_serverData.SyncObj)
     {
         SearchResultMessageSender srms = new SearchResultMessageSender(_serverData, ps.LocalEndpointConfiguration, ps.RequesterEndPoint);
         if (ps.ST == "ssdp:all")
         {
             DeviceTreeNotificationProducer.SendMessagesServer(_serverData.Server, srms);
         }
         else if (ps.ST == "upnp:rootdevice")
         { // Search root device
             foreach (DvDevice rootDevice in _serverData.Server.RootDevices)
             {
                 string deviceUDN = rootDevice.UDN;
                 srms.SendMessage("upnp:rootdevice", deviceUDN + "::upnp:rootdevice", rootDevice);
             }
         }
         else if (ps.ST.StartsWith("uuid:"))
         { // Search by device id
             string   deviceUDN = ps.ST;
             DvDevice device    = _serverData.Server.FindDeviceByUDN(deviceUDN);
             if (device != null)
             {
                 srms.SendMessage(deviceUDN, deviceUDN, device.RootDevice);
             }
         }
         else if (ps.ST.StartsWith("urn:") && (ps.ST.IndexOf(":device:") > -1 || ps.ST.IndexOf(":service:") > -1))
         { // Search by device type or service type and version
             string type;
             int    version;
             if (!ParserHelper.TryParseTypeVersion_URN(ps.ST, out type, out version))
             {
                 UPnPConfiguration.LOGGER.Debug("SSDPServerController: Problem parsing incoming packet, UPnP device or service search query '{0}'", ps.ST);
                 return;
             }
             if (type.IndexOf(":device:") > -1)
             {
                 IEnumerable <DvDevice> devices = _serverData.Server.FindDevicesByDeviceTypeAndVersion(
                     type, version, true);
                 foreach (DvDevice device in devices)
                 {
                     srms.SendMessage(device.DeviceTypeVersion_URN, device.UDN + "::" + device.DeviceTypeVersion_URN, device.RootDevice);
                 }
             }
             else if (type.IndexOf(":service:") > -1)
             {
                 foreach (DvDevice rootDevice in _serverData.Server.RootDevices)
                 {
                     IEnumerable <DvService> services = rootDevice.FindServicesByServiceTypeAndVersion(
                         type, version, true);
                     foreach (DvService service in services)
                     {
                         srms.SendMessage(service.ServiceTypeVersion_URN, service.ParentDevice.UDN + "::" + service.ServiceTypeVersion_URN, service.ParentDevice.RootDevice);
                     }
                 }
             }
         }
     }
 }
Пример #11
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgRenderingControl1(DvDevice aDevice)
     : base(aDevice, "upnp.org", "RenderingControl", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyLastChange = new PropertyString(new ParameterString("LastChange", allowedValues));
     AddProperty(iPropertyLastChange);
 }
Пример #12
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgScheduledRecording2(DvDevice aDevice)
     : base(aDevice, "upnp.org", "ScheduledRecording", 2)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyLastChange = new PropertyString(new ParameterString("LastChange", allowedValues));
     AddProperty(iPropertyLastChange);
 }
 protected static void SendMessagesEmbeddedDevicesRecursive(DvDevice rootDevice, DvDevice device, ISSDPDiscoveryMessageSender messageSender)
 {
     SendMessagesEmbeddedDevice(rootDevice, device, messageSender);
     SendMessagesServices(rootDevice, device, messageSender);
     foreach (DvDevice embeddedDevice in device.EmbeddedDevices)
     {
         SendMessagesEmbeddedDevicesRecursive(rootDevice, embeddedDevice, messageSender);
     }
 }
        protected static void SendMessagesServices(DvDevice rootDevice, DvDevice device, ISSDPDiscoveryMessageSender messageSender)
        {
            ICollection <string> services = device.GetServiceTypeVersion_URNs();

            foreach (string serviceTypeVersion_URN in services)
            {
                // One notification for each service
                SendMessagesService(rootDevice, device, serviceTypeVersion_URN, messageSender);
            }
        }
Пример #15
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgTime1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Time", 1)
 {
     iGch = GCHandle.Alloc(this);
     iPropertyTrackCount = new PropertyUint(new ParameterUint("TrackCount"));
     AddProperty(iPropertyTrackCount);
     iPropertyDuration = new PropertyUint(new ParameterUint("Duration"));
     AddProperty(iPropertyDuration);
     iPropertySeconds = new PropertyUint(new ParameterUint("Seconds"));
     AddProperty(iPropertySeconds);
 }
Пример #16
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgAVTransport2(DvDevice aDevice)
     : base(aDevice, "upnp.org", "AVTransport", 2)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyLastChange = new PropertyString(new ParameterString("LastChange", allowedValues));
     AddProperty(iPropertyLastChange);
     allowedValues.Add("OK");
     iPropertyDRMState = new PropertyString(new ParameterString("DRMState", allowedValues));
     AddProperty(iPropertyDRMState);
     allowedValues.Clear();
 }
        protected void SendMulticastEventNotification(DvService service, IEnumerable <DvStateVariable> variables)
        {
            DvDevice      device        = service.ParentDevice;
            EventingState eventingState = _serverData.GetMulticastEventKey(service);
            // First cluster variables by multicast event level so we can put variables of the same event level into a single message
            IDictionary <string, ICollection <DvStateVariable> > variablesByLevel =
                new Dictionary <string, ICollection <DvStateVariable> >();

            foreach (DvStateVariable variable in variables)
            {
                ICollection <DvStateVariable> variablesCollection;
                if (!variablesByLevel.TryGetValue(variable.MulticastEventLevel, out variablesCollection))
                {
                    variablesByLevel[variable.MulticastEventLevel] = variablesCollection = new List <DvStateVariable>();
                }
                variablesCollection.Add(variable);
            }
            foreach (KeyValuePair <string, ICollection <DvStateVariable> > varByLevel in variablesByLevel)
            {
                // Use a maximum cluster size of GENA_MAX_MULTICAST_EVENT_VAR_COUNT to keep UDP message small
                ICollection <IList <DvStateVariable> > variableClusters = CollectionUtils.Cluster(
                    varByLevel.Value, UPnPConsts.GENA_MAX_MULTICAST_EVENT_VAR_COUNT);
                foreach (IList <DvStateVariable> cluster in variableClusters)
                {
                    foreach (DvStateVariable variable in cluster)
                    {
                        eventingState.UpdateModerationData(variable);
                    }
                    eventingState.IncEventKey();
                    byte[] bodyData = UPnPConsts.UTF8_NO_BOM.GetBytes(GENAMessageBuilder.BuildEventNotificationMessage(
                                                                          cluster, false)); // Albert TODO: Is it correct not to force the simple string equivalent for extended data types here?
                    SimpleHTTPRequest request = new SimpleHTTPRequest("NOTIFY", "*");
                    request.SetHeader("CONTENT-LENGTH", bodyData.Length.ToString());
                    request.SetHeader("CONTENT-TYPE", "text/xml; charset=\"utf-8\"");
                    request.SetHeader("USN", device.UDN + "::" + service.ServiceTypeVersion_URN);
                    request.SetHeader("SVCID", service.ServiceId);
                    request.SetHeader("NT", "upnp:event");
                    request.SetHeader("NTS", "upnp:propchange");
                    request.SetHeader("SEQ", eventingState.EventKey.ToString());
                    request.SetHeader("LVL", varByLevel.Key);
                    request.SetHeader("BOOTID.UPNP.ORG", _serverData.BootId.ToString());

                    foreach (EndpointConfiguration config in _serverData.UPnPEndPoints)
                    {
                        IPEndPoint ep = new IPEndPoint(config.GENAMulticastAddress, UPnPConsts.GENA_MULTICAST_PORT);
                        request.SetHeader("HOST", NetworkHelper.IPEndPointToString(ep));
                        request.MessageBody = bodyData;
                        byte[] bytes = request.Encode();
                        NetworkHelper.SendData(config.GENA_UDP_Socket, ep, bytes, 1);
                    }
                }
            }
        }
Пример #18
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgConnectionManager1(DvDevice aDevice)
     : base(aDevice, "upnp.org", "ConnectionManager", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertySourceProtocolInfo = new PropertyString(new ParameterString("SourceProtocolInfo", allowedValues));
     AddProperty(iPropertySourceProtocolInfo);
     iPropertySinkProtocolInfo = new PropertyString(new ParameterString("SinkProtocolInfo", allowedValues));
     AddProperty(iPropertySinkProtocolInfo);
     iPropertyCurrentConnectionIDs = new PropertyString(new ParameterString("CurrentConnectionIDs", allowedValues));
     AddProperty(iPropertyCurrentConnectionIDs);
 }
        protected static void SendMessagesRootDevice(DvDevice rootDevice, ISSDPDiscoveryMessageSender messageSender)
        {
            string deviceUDN = rootDevice.UDN;

            messageSender.SendMessage("upnp:rootdevice", deviceUDN + "::upnp:rootdevice", rootDevice);
            messageSender.SendMessage(deviceUDN, deviceUDN, rootDevice);
            messageSender.SendMessage(rootDevice.DeviceTypeVersion_URN, deviceUDN + "::" + rootDevice.DeviceTypeVersion_URN, rootDevice);
            SendMessagesServices(rootDevice, rootDevice, messageSender);
            foreach (DvDevice embeddedDevice in rootDevice.EmbeddedDevices)
            {
                SendMessagesEmbeddedDevicesRecursive(rootDevice, embeddedDevice, messageSender);
            }
        }
Пример #20
0
        public void Activated(PluginRuntime pluginRuntime)
        {
            var stateService = new ServerStateServiceImpl();

            ServiceRegistration.Set <IServerStateService>(stateService);

            DvDevice device = ServiceRegistration.Get <IBackendServer>().UPnPBackendServer
                              .FindDevicesByDeviceTypeAndVersion(UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE_VERSION, true).FirstOrDefault();

            if (device != null)
            {
                Logger.Debug("ServerStateService: Registering ServerStateService service.");
                device.AddService(stateService);
                Logger.Debug("ServerStateService: Adding ServerStateService service to MP2 backend root device");
            }
            else
            {
                Logger.Error("ServerStateService: MP2 backend root device not found!");
            }
        }
Пример #21
0
        public void Activated(PluginRuntime pluginRuntime)
        {
            var meta = pluginRuntime.Metadata;

            Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));

            DvDevice device = ServiceRegistration.Get <IBackendServer>().UPnPBackendServer.FindDevicesByDeviceTypeAndVersion(UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE_VERSION, true).FirstOrDefault();

            if (device != null)
            {
                ServiceRegistration.Set <IFanArtService>(new FanArtService());
                Logger.Debug("FanArtService: Registered IFanArtService.");
                device.AddService(new FanArtServiceImpl());
                Logger.Debug("FanArtService: Adding FanArt service to MP2 backend root device");
            }
            else
            {
                Logger.Error("FanArtService: MP2 backend root device not found!");
            }
        }
Пример #22
0
        /// <summary>
        /// Sends a NOTIFY packet "ssdp:byebye" to all UPnP endpoints.
        /// </summary>
        /// <param name="NT">Notification type.</param>
        /// <param name="USN">Unique Service Name.</param>
        /// <param name="rootDevice">Root device for that the message should be send.</param>
        public void SendMessage(string NT, string USN, DvDevice rootDevice)
        {
            SimpleHTTPRequest response = new SimpleHTTPRequest("NOTIFY", "*");

            response.SetHeader("NT", NT);
            response.SetHeader("NTS", "ssdp:byebye");
            response.SetHeader("USN", USN);
            response.SetHeader("BOOTID.UPNP.ORG", _serverData.BootId.ToString());
            // Currently, we don't support SEARCHPORT.UPNP.ORG function and header

            foreach (EndpointConfiguration config in _serverData.UPnPEndPoints)
            {
                if (config.AddressFamily == AddressFamily.InterNetworkV6)
                {
                    response.SetHeader("OPT", "\"http://schemas.upnp.org/upnp/1/0/\"; ns=01");
                    response.SetHeader("01-NLS", _serverData.BootId.ToString());
                }
                response.SetHeader("CONFIGID.UPNP.ORG", config.ConfigId.ToString());
                IPEndPoint ep = new IPEndPoint(config.SSDPMulticastAddress, UPnPConsts.SSDP_MULTICAST_PORT);
                response.SetHeader("HOST", NetworkHelper.IPEndPointToString(ep));
                byte[] bytes = response.Encode();
                NetworkHelper.MulticastMessage(config.SSDP_UDP_UnicastSocket, config.SSDPMulticastAddress, bytes);
            }
        }
 /// <summary>
 /// Returns an URL which points to the root device description of the given <paramref name="rootDevice"/> on this endpoint.
 /// </summary>
 /// <param name="rootDevice">Root device to get the description URL for.</param>
 /// <returns>Absolute URL to the device description.</returns>
 public string GetRootDeviceDescriptionURL(DvDevice rootDevice)
 {
     return(GetEndpointHttpPrefixString() + _rootDeviceDescriptionPaths[rootDevice]);
 }
Пример #24
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgProduct1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Product", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyManufacturerName = new PropertyString(new ParameterString("ManufacturerName", allowedValues));
     AddProperty(iPropertyManufacturerName);
     iPropertyManufacturerInfo = new PropertyString(new ParameterString("ManufacturerInfo", allowedValues));
     AddProperty(iPropertyManufacturerInfo);
     iPropertyManufacturerUrl = new PropertyString(new ParameterString("ManufacturerUrl", allowedValues));
     AddProperty(iPropertyManufacturerUrl);
     iPropertyManufacturerImageUri = new PropertyString(new ParameterString("ManufacturerImageUri", allowedValues));
     AddProperty(iPropertyManufacturerImageUri);
     iPropertyModelName = new PropertyString(new ParameterString("ModelName", allowedValues));
     AddProperty(iPropertyModelName);
     iPropertyModelInfo = new PropertyString(new ParameterString("ModelInfo", allowedValues));
     AddProperty(iPropertyModelInfo);
     iPropertyModelUrl = new PropertyString(new ParameterString("ModelUrl", allowedValues));
     AddProperty(iPropertyModelUrl);
     iPropertyModelImageUri = new PropertyString(new ParameterString("ModelImageUri", allowedValues));
     AddProperty(iPropertyModelImageUri);
     iPropertyProductRoom = new PropertyString(new ParameterString("ProductRoom", allowedValues));
     AddProperty(iPropertyProductRoom);
     iPropertyProductName = new PropertyString(new ParameterString("ProductName", allowedValues));
     AddProperty(iPropertyProductName);
     iPropertyProductInfo = new PropertyString(new ParameterString("ProductInfo", allowedValues));
     AddProperty(iPropertyProductInfo);
     iPropertyProductUrl = new PropertyString(new ParameterString("ProductUrl", allowedValues));
     AddProperty(iPropertyProductUrl);
     iPropertyProductImageUri = new PropertyString(new ParameterString("ProductImageUri", allowedValues));
     AddProperty(iPropertyProductImageUri);
     iPropertyStandby = new PropertyBool(new ParameterBool("Standby"));
     AddProperty(iPropertyStandby);
     iPropertySourceIndex = new PropertyUint(new ParameterUint("SourceIndex"));
     AddProperty(iPropertySourceIndex);
     iPropertySourceCount = new PropertyUint(new ParameterUint("SourceCount"));
     AddProperty(iPropertySourceCount);
     iPropertySourceXml = new PropertyString(new ParameterString("SourceXml", allowedValues));
     AddProperty(iPropertySourceXml);
     iPropertyAttributes = new PropertyString(new ParameterString("Attributes", allowedValues));
     AddProperty(iPropertyAttributes);
 }
Пример #25
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgMediaServer1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "MediaServer", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #26
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgContentDirectory2(DvDevice aDevice)
     : base(aDevice, "upnp.org", "ContentDirectory", 2)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertySystemUpdateID = new PropertyUint(new ParameterUint("SystemUpdateID"));
     AddProperty(iPropertySystemUpdateID);
     iPropertyContainerUpdateIDs = new PropertyString(new ParameterString("ContainerUpdateIDs", allowedValues));
     AddProperty(iPropertyContainerUpdateIDs);
     iPropertyTransferIDs = new PropertyString(new ParameterString("TransferIDs", allowedValues));
     AddProperty(iPropertyTransferIDs);
 }
Пример #27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgScheduledRecording2(DvDevice aDevice)
     : base(aDevice, "upnp.org", "ScheduledRecording", 2)
 {
     iGch = GCHandle.Alloc(this);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgNetworkMonitor1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "NetworkMonitor", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #29
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgContentDirectory2(DvDevice aDevice)
     : base(aDevice, "upnp.org", "ContentDirectory", 2)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #30
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgDimming1(DvDevice aDevice)
     : base(aDevice, "upnp.org", "Dimming", 1)
 {
     iGch = GCHandle.Alloc(this);
     iPropertyLoadLevelStatus = new PropertyUint(new ParameterUint("LoadLevelStatus", 0, 100));
     AddProperty(iPropertyLoadLevelStatus);
     iPropertyStepDelta = new PropertyUint(new ParameterUint("StepDelta", 1, 100));
     AddProperty(iPropertyStepDelta);
     iPropertyRampRate = new PropertyUint(new ParameterUint("RampRate", 0, 100));
     AddProperty(iPropertyRampRate);
     iPropertyIsRamping = new PropertyBool(new ParameterBool("IsRamping"));
     AddProperty(iPropertyIsRamping);
     iPropertyRampPaused = new PropertyBool(new ParameterBool("RampPaused"));
     AddProperty(iPropertyRampPaused);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgCredentials1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Credentials", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #32
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgExakt2(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Exakt", 2)
 {
     iGch = GCHandle.Alloc(this);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgSwitchPower1(DvDevice aDevice)
     : base(aDevice, "upnp.org", "SwitchPower", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #34
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgDimming1(DvDevice aDevice)
     : base(aDevice, "upnp.org", "Dimming", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #35
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderOpenhomeOrgTestBasic1(DvDevice aDevice)
     : base(aDevice, "openhome.org", "TestBasic", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #36
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgExakt2(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Exakt", 2)
 {
     iGch = GCHandle.Alloc(this);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderLinnCoUkExaktInputs1(DvDevice aDevice)
     : base(aDevice, "linn.co.uk", "ExaktInputs", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #38
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderLinnCoUkConfiguration1(DvDevice aDevice)
     : base(aDevice, "linn.co.uk", "Configuration", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #39
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgTime1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Time", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #40
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgPlaylist1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Playlist", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     allowedValues.Add("Playing");
     allowedValues.Add("Paused");
     allowedValues.Add("Stopped");
     allowedValues.Add("Buffering");
     iPropertyTransportState = new PropertyString(new ParameterString("TransportState", allowedValues));
     AddProperty(iPropertyTransportState);
     allowedValues.Clear();
     iPropertyRepeat = new PropertyBool(new ParameterBool("Repeat"));
     AddProperty(iPropertyRepeat);
     iPropertyShuffle = new PropertyBool(new ParameterBool("Shuffle"));
     AddProperty(iPropertyShuffle);
     iPropertyId = new PropertyUint(new ParameterUint("Id"));
     AddProperty(iPropertyId);
     iPropertyIdArray = new PropertyBinary(new ParameterBinary("IdArray"));
     AddProperty(iPropertyIdArray);
     iPropertyTracksMax = new PropertyUint(new ParameterUint("TracksMax"));
     AddProperty(iPropertyTracksMax);
     iPropertyProtocolInfo = new PropertyString(new ParameterString("ProtocolInfo", allowedValues));
     AddProperty(iPropertyProtocolInfo);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderOpenhomeOrgSubscriptionLongPoll1(DvDevice aDevice)
     : base(aDevice, "openhome.org", "SubscriptionLongPoll", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #42
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgRenderingControl2(DvDevice aDevice)
     : base(aDevice, "upnp.org", "RenderingControl", 2)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #43
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgConnectionManager2(DvDevice aDevice)
     : base(aDevice, "upnp.org", "ConnectionManager", 2)
 {
     iGch = GCHandle.Alloc(this);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgCredentials1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Credentials", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #45
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgReceiver1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Receiver", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyUri = new PropertyString(new ParameterString("Uri", allowedValues));
     AddProperty(iPropertyUri);
     iPropertyMetadata = new PropertyString(new ParameterString("Metadata", allowedValues));
     AddProperty(iPropertyMetadata);
     allowedValues.Add("Stopped");
     allowedValues.Add("Playing");
     allowedValues.Add("Waiting");
     allowedValues.Add("Buffering");
     iPropertyTransportState = new PropertyString(new ParameterString("TransportState", allowedValues));
     AddProperty(iPropertyTransportState);
     allowedValues.Clear();
     iPropertyProtocolInfo = new PropertyString(new ParameterString("ProtocolInfo", allowedValues));
     AddProperty(iPropertyProtocolInfo);
 }
Пример #46
0
 /// <summary>
 /// Adds a new UPnP root device. Should be done before <see cref="Bind"/> is called.
 /// </summary>
 /// <param name="device">Device to add to the <see cref="RootDevices"/> collection.</param>
 public void AddRootDevice(DvDevice device)
 {
     _rootDevices.Add(device);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgPlaylistManager1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "PlaylistManager", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #48
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgRadio1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Radio", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #49
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgInfo1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Info", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyTrackCount = new PropertyUint(new ParameterUint("TrackCount"));
     AddProperty(iPropertyTrackCount);
     iPropertyDetailsCount = new PropertyUint(new ParameterUint("DetailsCount"));
     AddProperty(iPropertyDetailsCount);
     iPropertyMetatextCount = new PropertyUint(new ParameterUint("MetatextCount"));
     AddProperty(iPropertyMetatextCount);
     iPropertyUri = new PropertyString(new ParameterString("Uri", allowedValues));
     AddProperty(iPropertyUri);
     iPropertyMetadata = new PropertyString(new ParameterString("Metadata", allowedValues));
     AddProperty(iPropertyMetadata);
     iPropertyDuration = new PropertyUint(new ParameterUint("Duration"));
     AddProperty(iPropertyDuration);
     iPropertyBitRate = new PropertyUint(new ParameterUint("BitRate"));
     AddProperty(iPropertyBitRate);
     iPropertyBitDepth = new PropertyUint(new ParameterUint("BitDepth"));
     AddProperty(iPropertyBitDepth);
     iPropertySampleRate = new PropertyUint(new ParameterUint("SampleRate"));
     AddProperty(iPropertySampleRate);
     iPropertyLossless = new PropertyBool(new ParameterBool("Lossless"));
     AddProperty(iPropertyLossless);
     iPropertyCodecName = new PropertyString(new ParameterString("CodecName", allowedValues));
     AddProperty(iPropertyCodecName);
     iPropertyMetatext = new PropertyString(new ParameterString("Metatext", allowedValues));
     AddProperty(iPropertyMetatext);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderLinnCoUkUpdate1(DvDevice aDevice)
     : base(aDevice, "linn.co.uk", "Update", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #51
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgSender1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Sender", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyPresentationUrl = new PropertyString(new ParameterString("PresentationUrl", allowedValues));
     AddProperty(iPropertyPresentationUrl);
     iPropertyMetadata = new PropertyString(new ParameterString("Metadata", allowedValues));
     AddProperty(iPropertyMetadata);
     iPropertyAudio = new PropertyBool(new ParameterBool("Audio"));
     AddProperty(iPropertyAudio);
     allowedValues.Add("Enabled");
     allowedValues.Add("Disabled");
     allowedValues.Add("Blocked");
     iPropertyStatus = new PropertyString(new ParameterString("Status", allowedValues));
     AddProperty(iPropertyStatus);
     allowedValues.Clear();
     iPropertyAttributes = new PropertyString(new ParameterString("Attributes", allowedValues));
     AddProperty(iPropertyAttributes);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderLinnCoUkFlash1(DvDevice aDevice)
     : base(aDevice, "linn.co.uk", "Flash", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #53
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderOpenhomeOrgTestBasic1(DvDevice aDevice)
     : base(aDevice, "openhome.org", "TestBasic", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyVarUint = new PropertyUint(new ParameterUint("VarUint"));
     AddProperty(iPropertyVarUint);
     iPropertyVarInt = new PropertyInt(new ParameterInt("VarInt"));
     AddProperty(iPropertyVarInt);
     iPropertyVarBool = new PropertyBool(new ParameterBool("VarBool"));
     AddProperty(iPropertyVarBool);
     iPropertyVarStr = new PropertyString(new ParameterString("VarStr", allowedValues));
     AddProperty(iPropertyVarStr);
     iPropertyVarBin = new PropertyBinary(new ParameterBinary("VarBin"));
     AddProperty(iPropertyVarBin);
 }
Пример #54
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderLinnCoUkLipSync1(DvDevice aDevice)
     : base(aDevice, "linn.co.uk", "LipSync", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #55
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgAVTransport1(DvDevice aDevice)
     : base(aDevice, "upnp.org", "AVTransport", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderLinnCoUkVolkano1(DvDevice aDevice)
     : base(aDevice, "linn.co.uk", "Volkano", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #57
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgRadio1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "Radio", 1)
 {
     iGch = GCHandle.Alloc(this);
     List<String> allowedValues = new List<String>();
     iPropertyUri = new PropertyString(new ParameterString("Uri", allowedValues));
     AddProperty(iPropertyUri);
     iPropertyMetadata = new PropertyString(new ParameterString("Metadata", allowedValues));
     AddProperty(iPropertyMetadata);
     allowedValues.Add("Stopped");
     allowedValues.Add("Playing");
     allowedValues.Add("Paused");
     allowedValues.Add("Buffering");
     iPropertyTransportState = new PropertyString(new ParameterString("TransportState", allowedValues));
     AddProperty(iPropertyTransportState);
     allowedValues.Clear();
     iPropertyId = new PropertyUint(new ParameterUint("Id"));
     AddProperty(iPropertyId);
     iPropertyIdArray = new PropertyBinary(new ParameterBinary("IdArray"));
     AddProperty(iPropertyIdArray);
     iPropertyChannelsMax = new PropertyUint(new ParameterUint("ChannelsMax"));
     AddProperty(iPropertyChannelsMax);
     iPropertyProtocolInfo = new PropertyString(new ParameterString("ProtocolInfo", allowedValues));
     AddProperty(iPropertyProtocolInfo);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderOpenhomeOrgSubscriptionLongPoll1(DvDevice aDevice)
     : base(aDevice, "openhome.org", "SubscriptionLongPoll", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #59
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderUpnpOrgConnectionManager1(DvDevice aDevice)
     : base(aDevice, "upnp.org", "ConnectionManager", 1)
 {
     iGch = GCHandle.Alloc(this);
 }
Пример #60
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="aDevice">Device which owns this provider</param>
 protected DvProviderAvOpenhomeOrgNetworkMonitor1(DvDevice aDevice)
     : base(aDevice, "av.openhome.org", "NetworkMonitor", 1)
 {
     iGch = GCHandle.Alloc(this);
 }