Example #1
0
 private void OnModifiedSink_A_ARG_TYPE_RegistrationReqMsg(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_A_ARG_TYPE_RegistrationReqMsg != null)
     {
         OnStateVariableModified_A_ARG_TYPE_RegistrationReqMsg(this);
     }
 }
Example #2
0
 private void OnModifiedSink_A_ARG_TYPE_Nonce(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_A_ARG_TYPE_Nonce != null)
     {
         OnStateVariableModified_A_ARG_TYPE_Nonce(this);
     }
 }
 private void OnModifiedSink_SystemUpdateID(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_SystemUpdateID != null)
     {
         OnStateVariableModified_SystemUpdateID(this);
     }
 }
 private void OnModifiedSink_A_ARG_TYPE_BrowseFlag(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_A_ARG_TYPE_BrowseFlag != null)
     {
         OnStateVariableModified_A_ARG_TYPE_BrowseFlag(this);
     }
 }
 private void OnModifiedSink_A_ARG_TYPE_SearchCriteria(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_A_ARG_TYPE_SearchCriteria != null)
     {
         OnStateVariableModified_A_ARG_TYPE_SearchCriteria(this);
     }
 }
 private void OnModifiedSink_SortCapabilities(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_SortCapabilities != null)
     {
         OnStateVariableModified_SortCapabilities(this);
     }
 }
Example #7
0
 private void OnModifiedSink_Target(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_Target != null)
     {
         OnStateVariableModified_Target(this);
     }
 }
 private void OnModifiedSink_TransferIDs(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_TransferIDs != null)
     {
         OnStateVariableModified_TransferIDs(this);
     }
 }
Example #9
0
 private void OnModifiedSink_ValidationSucceededUpdateID(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_ValidationSucceededUpdateID != null)
     {
         OnStateVariableModified_ValidationSucceededUpdateID(this);
     }
 }
Example #10
0
 private void OnModifiedSink_AuthorizationGrantedUpdateID(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_AuthorizationGrantedUpdateID != null)
     {
         OnStateVariableModified_AuthorizationGrantedUpdateID(this);
     }
 }
Example #11
0
 private void OnModifiedSink_A_ARG_TYPE_ConnectionID(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_A_ARG_TYPE_ConnectionID != null)
     {
         OnStateVariableModified_A_ARG_TYPE_ConnectionID(this);
     }
 }
Example #12
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[8];
                RetVal[0] = new UPnPModeratedStateVariable("AuthorizationDeniedUpdateID", typeof(System.UInt32), true);
                RetVal[1] = new UPnPModeratedStateVariable("A_ARG_TYPE_DeviceID", typeof(System.String), false);
                RetVal[1].AddAssociation("IsAuthorized", "DeviceID");
                RetVal[1].AddAssociation("IsValidated", "DeviceID");
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_RegistrationRespMsg", typeof(System.Byte[]), false);
                RetVal[2].AddAssociation("RegisterDevice", "RegistrationRespMsg");
                RetVal[3] = new UPnPModeratedStateVariable("ValidationRevokedUpdateID", typeof(System.UInt32), true);
                RetVal[4] = new UPnPModeratedStateVariable("ValidationSucceededUpdateID", typeof(System.UInt32), true);
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_Result", typeof(System.Int32), false);
                RetVal[5].AddAssociation("IsAuthorized", "Result");
                RetVal[5].AddAssociation("IsValidated", "Result");
                RetVal[6] = new UPnPModeratedStateVariable("AuthorizationGrantedUpdateID", typeof(System.UInt32), true);
                RetVal[7] = new UPnPModeratedStateVariable("A_ARG_TYPE_RegistrationReqMsg", typeof(System.Byte[]), false);
                RetVal[7].AddAssociation("RegisterDevice", "RegistrationReqMsg");

                UPnPService S = new UPnPService(1, "urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar", "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1", true, this);

                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("IsAuthorized");
                S.AddMethod("IsValidated");
                S.AddMethod("RegisterDevice");
                return(S);
            }
Example #13
0
 private void OnModifiedSink_A_ARG_TYPE_SignAlgorithm(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_A_ARG_TYPE_SignAlgorithm != null)
     {
         OnStateVariableModified_A_ARG_TYPE_SignAlgorithm(this);
     }
 }
 private void OnModifiedSink_CurrentConnectionIDs(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_CurrentConnectionIDs != null)
     {
         OnStateVariableModified_CurrentConnectionIDs(this);
     }
 }
 private void OnModifiedSink_SinkProtocolInfo(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_SinkProtocolInfo != null)
     {
         OnStateVariableModified_SinkProtocolInfo(this);
     }
 }
 private void OnModifiedSink_ContainerUpdateIDs(UPnPStateVariable sender, object NewValue)
 {
     if (OnStateVariableModified_ContainerUpdateIDs != null)
     {
         OnStateVariableModified_ContainerUpdateIDs(this);
     }
 }
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[14];
                RetVal[0] = new UPnPModeratedStateVariable("SearchCapabilities", typeof(System.String), false);
                RetVal[0].AddAssociation("GetSearchCapabilities", "SearchCaps");
                RetVal[1] = new UPnPModeratedStateVariable("A_ARG_TYPE_SortCriteria", typeof(System.String), false);
                RetVal[1].AddAssociation("Browse", "SortCriteria");
                RetVal[1].AddAssociation("Search", "SortCriteria");
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_SearchCriteria", typeof(System.String), false);
                RetVal[2].AddAssociation("Search", "SearchCriteria");
                RetVal[3] = new UPnPModeratedStateVariable("A_ARG_TYPE_Filter", typeof(System.String), false);
                RetVal[3].AddAssociation("Browse", "Filter");
                RetVal[3].AddAssociation("Search", "Filter");
                RetVal[4] = new UPnPModeratedStateVariable("SortCapabilities", typeof(System.String), false);
                RetVal[4].AddAssociation("GetSortCapabilities", "SortCaps");
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_ObjectID", typeof(System.String), false);
                RetVal[5].AddAssociation("Browse", "ObjectID");
                RetVal[5].AddAssociation("DestroyObject", "ObjectID");
                RetVal[5].AddAssociation("Search", "ContainerID");
                RetVal[6] = new UPnPModeratedStateVariable("SystemUpdateID", typeof(System.UInt32), true);
                RetVal[6].AddAssociation("GetSystemUpdateID", "Id");
                RetVal[7] = new UPnPModeratedStateVariable("A_ARG_TYPE_BrowseFlag", typeof(System.String), false);
                RetVal[7].AllowedStringValues = new string[2] {
                    "BrowseMetadata", "BrowseDirectChildren"
                };
                RetVal[7].AddAssociation("Browse", "BrowseFlag");
                RetVal[8] = new UPnPModeratedStateVariable("A_ARG_TYPE_UpdateID", typeof(System.UInt32), false);
                RetVal[8].AddAssociation("Browse", "UpdateID");
                RetVal[8].AddAssociation("Search", "UpdateID");
                RetVal[9]  = new UPnPModeratedStateVariable("ContainerUpdateIDs", typeof(System.String), true);
                RetVal[10] = new UPnPModeratedStateVariable("TransferIDs", typeof(System.String), true);
                RetVal[11] = new UPnPModeratedStateVariable("A_ARG_TYPE_Index", typeof(System.UInt32), false);
                RetVal[11].AddAssociation("Browse", "StartingIndex");
                RetVal[11].AddAssociation("Search", "StartingIndex");
                RetVal[12] = new UPnPModeratedStateVariable("A_ARG_TYPE_Count", typeof(System.UInt32), false);
                RetVal[12].AddAssociation("Browse", "RequestedCount");
                RetVal[12].AddAssociation("Browse", "NumberReturned");
                RetVal[12].AddAssociation("Browse", "TotalMatches");
                RetVal[12].AddAssociation("Search", "RequestedCount");
                RetVal[12].AddAssociation("Search", "NumberReturned");
                RetVal[12].AddAssociation("Search", "TotalMatches");
                RetVal[13] = new UPnPModeratedStateVariable("A_ARG_TYPE_Result", typeof(System.String), false);
                RetVal[13].AddAssociation("Browse", "Result");
                RetVal[13].AddAssociation("Search", "Result");

                UPnPService S = new UPnPService(1, "urn:schemas-upnp-org:service:ContentDirectory", URN, true, this);

                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("Browse");
                S.AddMethod("DestroyObject");
                S.AddMethod("GetSearchCapabilities");
                S.AddMethod("GetSortCapabilities");
                S.AddMethod("GetSystemUpdateID");
                S.AddMethod("Search");
                return(S);
            }
 private void StateVarModifiedSink(UPnPStateVariable sender, object newval)
 {
     EventTable[sender.Name] = true;
     if (Interlocked.Decrement(ref NumEvents) == 0)
     {
         MRE.Set();
     }
 }
        private void ChangeTriggered(UPnPStateVariable sender, object value)
        {
            Console.WriteLine("LastChange from {0}", UUID);
            var newState = sender.Value;

            Console.WriteLine(newState);
            ParseChangeXML((string)newState);
        }
Example #20
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[12];
                RetVal[0] = new UPnPModeratedStateVariable("A_ARG_TYPE_EndpointID", typeof(System.String), false);
                RetVal[0].AddAssociation("AcquireNonce", "HostId");
                RetVal[0].AddAssociation("Advertise", "HostId");
                RetVal[0].AddAssociation("Advertise", "ApplicationId");
                RetVal[0].AddAssociation("Inhibit", "HostId");
                RetVal[0].AddAssociation("Inhibit", "ApplicationId");
                RetVal[1] = new UPnPModeratedStateVariable("A_ARG_TYPE_AnyString", typeof(System.String), false);
                RetVal[1].AddAssociation("Advertise", "ApplicationData");
                RetVal[1].AddAssociation("Advertise", "ExperienceEndpointData");
                RetVal[1].AddAssociation("Inhibit", "ApplicationData");
                RetVal[1].AddAssociation("Inhibit", "ReasonMessage");
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_SignAlgorithmList", typeof(System.String), false);
                RetVal[2].AddAssociation("AcquireNonce", "SupportedSignatureAlgorithms");
                RetVal[3] = new UPnPModeratedStateVariable("A_ARG_TYPE_Bool", typeof(System.Boolean), false);
                RetVal[3].AddAssociation("AcquireNonce", "AttachCertificate");
                RetVal[4] = new UPnPModeratedStateVariable("A_ARG_TYPE_ReasonCode", typeof(System.UInt32), false);
                RetVal[4].AddAssociation("Inhibit", "ReasonCode");
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_Uri", typeof(System.String), false);
                RetVal[5].AddAssociation("Advertise", "ExperienceIconUri");
                RetVal[5].AddAssociation("Advertise", "ExperienceEndpointUri");
                RetVal[6] = new UPnPModeratedStateVariable("A_ARG_TYPE_Certificate", typeof(System.String), false);
                RetVal[6].AddAssociation("Advertise", "HostCertificate");
                RetVal[6].AddAssociation("Inhibit", "HostCertificate");
                RetVal[7] = new UPnPModeratedStateVariable("A_ARG_TYPE_Version", typeof(System.String), false);
                RetVal[7].AddAssociation("Advertise", "ApplicationVersion");
                RetVal[7].AddAssociation("Inhibit", "ApplicationVersion");
                RetVal[8] = new UPnPModeratedStateVariable("A_ARG_TYPE_Name", typeof(System.String), false);
                RetVal[8].AddAssociation("Advertise", "HostFriendlyName");
                RetVal[8].AddAssociation("Advertise", "ExperienceFriendlyName");
                RetVal[9] = new UPnPModeratedStateVariable("A_ARG_TYPE_SignAlgorithm", typeof(System.String), false);
                RetVal[9].AddAssociation("Advertise", "SignatureAlgorithm");
                RetVal[9].AddAssociation("Inhibit", "SignatureAlgorithm");
                RetVal[10] = new UPnPModeratedStateVariable("A_ARG_TYPE_Signature", typeof(System.String), false);
                RetVal[10].AddAssociation("Advertise", "Signature");
                RetVal[10].AddAssociation("Inhibit", "Signature");
                RetVal[11] = new UPnPModeratedStateVariable("A_ARG_TYPE_Nonce", typeof(System.UInt32), false);
                RetVal[11].AddAssociation("AcquireNonce", "Nonce");
                RetVal[11].AddAssociation("Advertise", "Nonce");
                RetVal[11].AddAssociation("Inhibit", "Nonce");

                UPnPService S = new UPnPService(1, "urn:schemas-microsoft-com:serviceId:MSRX", "urn:schemas-microsoft-com:service:msremotedexperience:1", true, this);

                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("AcquireNonce");
                S.AddMethod("Advertise");
                S.AddMethod("Inhibit");
                return(S);
            }
Example #21
0
        /// <summary>
        /// Eventing, wird benutzt um Änderungen an der Zone zu ermitteln
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="newvalue"></param>
        private void OnZoneGroupStateChanged(UPnPStateVariable sender, object newvalue)
        {
            //Console.WriteLine(sender.Value);

            // Avoid multiple state changes and consolidate them
            if (stateChangedTimer != null)
            {
                stateChangedTimer.Dispose();
            }
            stateChangedTimer = new Timer(state => HandleZoneXML(sender.Value.ToString()), null, TimeSpan.FromMilliseconds(1000),
                                          TimeSpan.FromMilliseconds(-1));
        }
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[10];
                RetVal[0] = new UPnPModeratedStateVariable("A_ARG_TYPE_ProtocolInfo", typeof(System.String), false);
                RetVal[0].AddAssociation("GetCurrentConnectionInfo", "ProtocolInfo");
                RetVal[0].AddAssociation("PrepareForConnection", "RemoteProtocolInfo");
                RetVal[1] = new UPnPModeratedStateVariable("A_ARG_TYPE_ConnectionStatus", typeof(System.String), false);
                RetVal[1].AllowedStringValues = new string[5] {
                    "OK", "ContentFormatMismatch", "InsufficientBandwidth", "UnreliableChannel", "Unknown"
                };
                RetVal[1].AddAssociation("GetCurrentConnectionInfo", "Status");
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_AVTransportID", typeof(System.Int32), false);
                RetVal[2].AddAssociation("GetCurrentConnectionInfo", "AVTransportID");
                RetVal[2].AddAssociation("PrepareForConnection", "AVTransportID");
                RetVal[3] = new UPnPModeratedStateVariable("A_ARG_TYPE_RcsID", typeof(System.Int32), false);
                RetVal[3].AddAssociation("GetCurrentConnectionInfo", "RcsID");
                RetVal[3].AddAssociation("PrepareForConnection", "RcsID");
                RetVal[4] = new UPnPModeratedStateVariable("A_ARG_TYPE_ConnectionID", typeof(System.Int32), false);
                RetVal[4].AddAssociation("GetCurrentConnectionInfo", "ConnectionID");
                RetVal[4].AddAssociation("GetCurrentConnectionInfo", "PeerConnectionID");
                RetVal[4].AddAssociation("PrepareForConnection", "PeerConnectionID");
                RetVal[4].AddAssociation("PrepareForConnection", "ConnectionID");
                RetVal[4].AddAssociation("ConnectionComplete", "ConnectionID");
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_ConnectionManager", typeof(System.String), false);
                RetVal[5].AddAssociation("GetCurrentConnectionInfo", "PeerConnectionManager");
                RetVal[5].AddAssociation("PrepareForConnection", "PeerConnectionManager");
                RetVal[6] = new UPnPModeratedStateVariable("SourceProtocolInfo", typeof(System.String), true);
                RetVal[6].AddAssociation("GetProtocolInfo", "Source");
                RetVal[7] = new UPnPModeratedStateVariable("SinkProtocolInfo", typeof(System.String), true);
                RetVal[7].AddAssociation("GetProtocolInfo", "Sink");
                RetVal[8] = new UPnPModeratedStateVariable("A_ARG_TYPE_Direction", typeof(System.String), false);
                RetVal[8].AllowedStringValues = new string[2] {
                    "Input", "Output"
                };
                RetVal[8].AddAssociation("GetCurrentConnectionInfo", "Direction");
                RetVal[8].AddAssociation("PrepareForConnection", "Direction");
                RetVal[9] = new UPnPModeratedStateVariable("CurrentConnectionIDs", typeof(System.String), true);
                RetVal[9].AddAssociation("GetCurrentConnectionIDs", "ConnectionIDs");

                UPnPService S = new UPnPService(1, "urn:schemas-upnp-org:service:ConnectionManager", "urn:schemas-upnp-org:service:ConnectionManager:1", true, this);

                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetCurrentConnectionInfo");
                S.AddMethod("PrepareForConnection");
                S.AddMethod("ConnectionComplete");
                S.AddMethod("GetProtocolInfo");
                S.AddMethod("GetCurrentConnectionIDs");
                return(S);
            }
Example #23
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[1];
                RetVal[0] = new UPnPModeratedStateVariable("Target", typeof(System.Boolean), false);

                UPnPService S = new UPnPService(1, "urn:microsoft-com:serviceId:NULL", "urn:schemas-microsoft-com:service:NULL:1", true, this);

                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                return(S);
            }
Example #24
0
		private static Hashtable BuildEnumerations(UPnPStateVariable[] SV)
		{
			Hashtable h = new Hashtable();
			Hashtable hlist = new Hashtable();
			EnumStruct d;
			VarData vd;
			string t;
	
			foreach(UPnPStateVariable V in SV)
			{
				if(V.AllowedStringValues!=null)
				{
					vd = new VarData();
					vd.VariableName = V.Name;
					vd.Enumerations = new ArrayList();
					hlist.Add(V.Name,vd);
					h.Clear();

					foreach(string val in V.AllowedStringValues)
					{
						t = val.ToUpper();
						t = t.Replace("-","_");
						t = t.Replace("+","_");
						t = t.Replace(" ","_");
						t = t.Replace(":","_");
						if(IsNumeric(t[0])==true)
						{
							t = "_" + t;
						}

						if(h.ContainsKey(t)==true)
						{
							t = val.ToUpper();
							t = t.Replace("-","_minus_");
							t = t.Replace("+","_plus_");
							t = t.Replace(" ","_");
							t = t.Replace(":","_colon_");
						}
						h.Add(t,t);
						d = new EnumStruct();
						d.EnumName = t;
						d.EnumValue = val;
						((VarData)hlist[V.Name]).Enumerations.Add(d);
					}
				}
			}
			return(hlist);
		}
Example #25
0
 protected void CurrentConnectionIDs_ModifiedSink(UPnPStateVariable Var, object NewValue)
 {
      if(OnStateVariable_CurrentConnectionIDs != null) OnStateVariable_CurrentConnectionIDs((System.String)NewValue);
      WeakReference[] w = (WeakReference[])WeakList_CurrentConnectionIDs.ToArray(typeof(WeakReference));
      foreach(WeakReference wr in w)
      {
          if(wr.IsAlive==true)
          {
              ((StateVariableModifiedHandler_CurrentConnectionIDs)wr.Target)((System.String)NewValue);
          }
          else
          {
              WeakList_CurrentConnectionIDs.Remove(wr);
          }
      }
 }
Example #26
0
 protected void SinkProtocolInfo_ModifiedSink(UPnPStateVariable Var, object NewValue)
 {
      if(OnStateVariable_SinkProtocolInfo != null) OnStateVariable_SinkProtocolInfo((System.String)NewValue);
      WeakReference[] w = (WeakReference[])WeakList_SinkProtocolInfo.ToArray(typeof(WeakReference));
      foreach(WeakReference wr in w)
      {
          if(wr.IsAlive==true)
          {
              ((StateVariableModifiedHandler_SinkProtocolInfo)wr.Target)((System.String)NewValue);
          }
          else
          {
              WeakList_SinkProtocolInfo.Remove(wr);
          }
      }
 }
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[7];
                RetVal[0] = new UPnPModeratedStateVariable("A_ARG_TYPE_EndpointID", typeof(System.String), false);
                RetVal[0].AddAssociation("Commit", "HostID");
                RetVal[0].AddAssociation("Confirm", "HostID");
                RetVal[0].AddAssociation("Exchange", "HostID");
                RetVal[0].AddAssociation("Exchange", "DeviceID");
                RetVal[0].AddAssociation("Validate", "HostID");
                RetVal[1] = new UPnPModeratedStateVariable("TrustState", typeof(System.Byte), false);
                RetVal[1].SetRange((System.Byte)(0), (System.Byte)(4), null);
                RetVal[2] = new UPnPModeratedStateVariable("A_ARG_TYPE_Rounds", typeof(System.Byte), false);
                RetVal[2].SetRange((System.Byte)(2), (System.Byte)(20), null);
                RetVal[2].AddAssociation("Confirm", "IterationsRequired");
                RetVal[2].AddAssociation("Exchange", "IterationsRequired");
                RetVal[3] = new UPnPModeratedStateVariable("A_ARG_TYPE_Nonce", typeof(System.String), false);
                RetVal[3].AddAssociation("Confirm", "HostConfirmNonce");
                RetVal[3].AddAssociation("Confirm", "DeviceConfirmNonce");
                RetVal[3].AddAssociation("Validate", "HostValidateNonce");
                RetVal[3].AddAssociation("Validate", "DeviceValidateNonce");
                RetVal[4] = new UPnPModeratedStateVariable("A_ARG_TYPE_Authenticator", typeof(System.String), false);
                RetVal[4].AddAssociation("Commit", "HostValidateAuthenticator");
                RetVal[4].AddAssociation("Commit", "DeviceValidateAuthenticator");
                RetVal[4].AddAssociation("Exchange", "HostConfirmAuthenticator");
                RetVal[4].AddAssociation("Exchange", "DeviceConfirmAuthenticator");
                RetVal[5] = new UPnPModeratedStateVariable("A_ARG_TYPE_Certificate", typeof(System.String), false);
                RetVal[5].AddAssociation("Exchange", "HostCertificate");
                RetVal[5].AddAssociation("Exchange", "DeviceCertificate");
                RetVal[6] = new UPnPModeratedStateVariable("A_ARG_TYPE_Iteration", typeof(System.Byte), false);
                RetVal[6].SetRange((System.Byte)(1), (System.Byte)(20), null);
                RetVal[6].AddAssociation("Commit", "Iteration");
                RetVal[6].AddAssociation("Validate", "Iteration");

                UPnPService S = new UPnPService(1, "urn:microsoft-com:serviceId:MSTA", "urn:schemas-microsoft-com:service:mstrustagreement:1", true, this);

                for (int i = 0; i < RetVal.Length; ++i)
                {
                    S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("Commit");
                S.AddMethod("Confirm");
                S.AddMethod("Exchange");
                S.AddMethod("Validate");
                return(S);
            }
Example #28
0
        private void LastChange_Handler(UPnPStateVariable sender, object value)
        {
            var newState = sender.Value;

            Console.WriteLine(newState);
            var instanceXml = ParseChangeXML((string)newState);

            //Update state of Renderer av-transport
            string transportState    = Utilities.TryGetAttributeFromTrackInstance(instanceXml, "TransportState");
            string nextTrackMetaData = Utilities.TryGetAttributeFromTrackInstance(instanceXml, "NextTrackMetaData");
            string numberOfTracks    = Utilities.TryGetAttributeFromTrackInstance(instanceXml, "NumberOfTracks");
            var    info = new Info()
            {
                TransportState = transportState, NextTrackMetaData = nextTrackMetaData, NumberOfTracks = numberOfTracks
            };

            FireInfoChangedEvent(info);
        }
Example #29
0
 protected void CurrentConnectionIDs_ModifiedSink(UPnPStateVariable Var, object NewValue)
 {
     if (OnStateVariable_CurrentConnectionIDs != null)
     {
         OnStateVariable_CurrentConnectionIDs((System.String)NewValue);
     }
     WeakReference[] w = (WeakReference[])WeakList_CurrentConnectionIDs.ToArray(typeof(WeakReference));
     foreach (WeakReference wr in w)
     {
         if (wr.IsAlive == true)
         {
             ((StateVariableModifiedHandler_CurrentConnectionIDs)wr.Target)((System.String)NewValue);
         }
         else
         {
             WeakList_CurrentConnectionIDs.Remove(wr);
         }
     }
 }
Example #30
0
 protected void SinkProtocolInfo_ModifiedSink(UPnPStateVariable Var, object NewValue)
 {
     if (OnStateVariable_SinkProtocolInfo != null)
     {
         OnStateVariable_SinkProtocolInfo((System.String)NewValue);
     }
     WeakReference[] w = (WeakReference[])WeakList_SinkProtocolInfo.ToArray(typeof(WeakReference));
     foreach (WeakReference wr in w)
     {
         if (wr.IsAlive == true)
         {
             ((StateVariableModifiedHandler_SinkProtocolInfo)wr.Target)((System.String)NewValue);
         }
         else
         {
             WeakList_SinkProtocolInfo.Remove(wr);
         }
     }
 }
Example #31
0
 private void OnModifiedSink_Power(UPnPStateVariable sender, object NewValue)
 {
     if(OnStateVariableModified_Power != null) OnStateVariableModified_Power(this);
 }
Example #32
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[5];
                RetVal[0] = new UPnPModeratedStateVariable("PageMax", typeof(System.Int32), true);
                RetVal[0].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"1");
                RetVal[0].AddAssociation("PowerOn", "PageMax");
                RetVal[1] = new UPnPModeratedStateVariable("Power", typeof(System.Boolean), true);
                RetVal[1].AddAssociation("GetStatus", "Power");
                RetVal[1].AddAssociation("PowerOff", "Power");
                RetVal[1].AddAssociation("PowerOn", "Power");
                RetVal[2] = new UPnPModeratedStateVariable("File", typeof(System.String), true);
                RetVal[2].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"default.ppt");
                RetVal[2].AddAssociation("GetStatus", "File");
                RetVal[2].AddAssociation("PowerOn", "File");
                RetVal[3] = new UPnPModeratedStateVariable("PageNumber", typeof(System.Int32), true);
                RetVal[3].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"1");
                RetVal[3].AddAssociation("GetStatus", "PageNumber");
                RetVal[3].AddAssociation("Go", "PageNumber");
                RetVal[3].AddAssociation("NextPage", "PageNumber");
                RetVal[3].AddAssociation("PowerOn", "PageNumber");
                RetVal[3].AddAssociation("PreviousPage", "PageNumber");
                RetVal[4] = new UPnPModeratedStateVariable("Files", typeof(System.String), true);
                RetVal[4].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"default.ppt");
                RetVal[4].AddAssociation("GetFiles", "Files");

                UPnPService S = new UPnPService(1, "control", "urn:schemas-upnp-org:service:control:1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetFiles");
                S.AddMethod("GetStatus");
                S.AddMethod("Go");
                S.AddMethod("NextPage");
                S.AddMethod("PowerOff");
                S.AddMethod("PowerOn");
                S.AddMethod("PreviousPage");
                return(S);
            }
Example #33
0
 private void OnModifiedSink_A_ARG_TYPE_Iteration(UPnPStateVariable sender, object NewValue)
 {
     OnStateVariableModified_A_ARG_TYPE_Iteration?.Invoke(this);
 }
Example #34
0
 private void OnModifiedSink_A_ARG_TYPE_Certificate(UPnPStateVariable sender, object NewValue)
 {
     OnStateVariableModified_A_ARG_TYPE_Certificate?.Invoke(this);
 }
Example #35
0
 private void OnModifiedSink_A_ARG_TYPE_Authenticator(UPnPStateVariable sender, object NewValue)
 {
     OnStateVariableModified_A_ARG_TYPE_Authenticator?.Invoke(this);
 }
Example #36
0
 private void OnModifiedSink_OysterConnectionAddress(UPnPStateVariable sender, object NewValue)
 {
     if(OnStateVariableModified_OysterConnectionAddress != null) OnStateVariableModified_OysterConnectionAddress(this);
 }
Example #37
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[3];
                RetVal[0] = new UPnPModeratedStateVariable("OysterConnectionPort", typeof(System.Int32), false);
                RetVal[0].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"13075");
                RetVal[0].AddAssociation("GetConnectionVariables", "int32ConnectionPort");
                RetVal[1] = new UPnPModeratedStateVariable("OysterFilePort", typeof(System.Int32), false);
                RetVal[1].AddAssociation("GetConnectionVariables", "int32FilePort");
                RetVal[2] = new UPnPModeratedStateVariable("OysterConnectionAddress", typeof(System.String), false);
                RetVal[2].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"OysterMini");
                RetVal[2].AddAssociation("GetConnectionVariables", "stringConnectionAddress");

                UPnPService S = new UPnPService(1, "ConnectionService", "urn:schemas-upnp-org:OysterConnection::1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetConnectionVariables");
                return(S);
            }
Example #38
0
 private void OnModifiedSink_OysterFilePort(UPnPStateVariable sender, object NewValue)
 {
     if(OnStateVariableModified_OysterFilePort != null) OnStateVariableModified_OysterFilePort(this);
 }