public void InvokeAsync(UPnPService S, string Action, byte[] InArgs, string Caller, int Handle)
        {
            UPnPAction A     = S.GetAction(Action);
            ArrayList  AList = new ArrayList();

            foreach (UPnPArgument arg in A.ArgumentList)
            {
                if (arg.IsReturnValue == false && arg.Direction == "out")
                {
                    UPnPArgument _arg = (UPnPArgument)arg.Clone();
                    _arg.DataValue = UPnPService.CreateObjectInstance(arg.RelatedStateVar.GetNetType(), null);
                    AList.Add(_arg);
                }
            }

            UPnPArgument[] Temp = ParseArguments(InArgs);
            foreach (UPnPArgument _arg in Temp)
            {
                _arg.DataType  = A.GetArg(_arg.Name).RelatedStateVar.ValueType;
                _arg.Direction = "in";
                AList.Add(_arg);
            }

            UPnPArgument[] Arguments = (UPnPArgument[])AList.ToArray(typeof(UPnPArgument));

            (new UPnPDebugObject(S)).SetProperty("ValidationMode", false);
            S.InvokeAsync(Action, Arguments, new Object[2] {
                Caller, Handle
            }, A_ICB, A_IECB);
        }
 private void InvokeResponseSink(int ErrorCode, string ErrorString, byte[] Args, int Handle)
 {
     try
     {
         UPnPAction A = (UPnPAction)this.PendingActionTable[Handle];
         PendingActionTable.Remove(Handle);
         if (ErrorCode == 0)
         {
             UPnPArgument[] OutArgs = Gatekeeper.ParseArguments(Args);
             object         RetObj  = null;
             if (A.HasReturnValue)
             {
                 UPnPArgument RA = A.GetRetArg();
                 foreach (UPnPArgument OA in OutArgs)
                 {
                     if (OA.Name == RA.Name)
                     {
                         RetObj = OA.DataValue;
                         break;
                     }
                 }
             }
             A.ParentService.DelayedInvokeResponse(0, RetObj, OutArgs, null);
         }
         else
         {
             A.ParentService.DelayedInvokeResponse(0, null, null, new UPnPCustomException(ErrorCode, ErrorString));
         }
     }
     catch (Exception) { }
 }
        private ArrayList BasicControlTest_BuildActionArgs(UPnPAction A)
        {
            ArrayList ArgList = new ArrayList();

            foreach (UPnPArgument arg in A.ArgumentList)
            {
                if (arg.IsReturnValue == false)
                {
                    UPnPArgument NArg;
//					if(arg.RelatedStateVar.GetNetType().FullName=="System.String")
//					{
//						NArg = new UPnPArgument(arg.Name,"Sample String");
//					}
//					else
//					{
                    NArg = new UPnPArgument(arg.Name, UPnPService.CreateObjectInstance(arg.RelatedStateVar.GetNetType(), null));
//					}
                    if (arg.RelatedStateVar.AllowedStringValues != null)
                    {
                        NArg.DataValue = arg.RelatedStateVar.AllowedStringValues[0];
                    }
                    if (arg.RelatedStateVar.Minimum != null)
                    {
                        NArg.DataValue = arg.RelatedStateVar.Minimum;
                    }
                    if (arg.RelatedStateVar.Maximum != null)
                    {
                        NArg.DataValue = arg.RelatedStateVar.Maximum;
                    }
                    ArgList.Add(NArg);
                }
            }
            return(ArgList);
        }
        private void A_InvokeSink(UPnPService sender, String MethodName, UPnPArgument[] Args, Object ReturnValue, object Tag)
        {
            object[] state  = (object[])Tag;
            string   Caller = (string)state[0];
            int      Handle = (int)state[1];


            ArrayList  RetList = new ArrayList();
            UPnPAction A       = sender.GetAction(MethodName);

            if (A.HasReturnValue == true)
            {
                UPnPArgument RA = (UPnPArgument)A.GetRetArg().Clone();
                RA.DataValue = ReturnValue;
                RetList.Add(RA);
            }

            foreach (UPnPArgument OA in Args)
            {
                if (OA.Direction == "out")
                {
                    RetList.Add(OA);
                }
            }

            byte[]       OutArgs = BuildArguments((UPnPArgument[])RetList.ToArray(typeof(UPnPArgument)));
            CpGateKeeper C       = (CpGateKeeper)RegisteredTable[Caller];

            C.InvokeAsyncResponse(Handle, OutArgs, 0, "");
        }
Exemplo n.º 5
0
		public void RequestTermination()
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionRequestTermination == null)
				actionRequestTermination = this.service.GetAction("RequestTermination");

			this.actionRequestTermination.Invoke(out OutputValues);
		}
Exemplo n.º 6
0
		public void SetWarnDisconnectDelay(string NewWarnDisconnectDelay)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionSetWarnDisconnectDelay == null)
				actionSetWarnDisconnectDelay = this.service.GetAction("SetWarnDisconnectDelay");

			this.actionSetWarnDisconnectDelay.Invoke(out OutputValues,
				new KeyValuePair<string, object>("NewWarnDisconnectDelay", NewWarnDisconnectDelay));
		}
Exemplo n.º 7
0
		public void SetIdleDisconnectTime(string NewIdleDisconnectTime)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionSetIdleDisconnectTime == null)
				actionSetIdleDisconnectTime = this.service.GetAction("SetIdleDisconnectTime");

			this.actionSetIdleDisconnectTime.Invoke(out OutputValues,
				new KeyValuePair<string, object>("NewIdleDisconnectTime", NewIdleDisconnectTime));
		}
Exemplo n.º 8
0
		public void SetDefaultConnectionService(string NewDefaultConnectionService)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionSetDefaultConnectionService == null)
				actionSetDefaultConnectionService = this.service.GetAction("SetDefaultConnectionService");

			this.actionSetDefaultConnectionService.Invoke(out OutputValues,
				new KeyValuePair<string, object>("NewDefaultConnectionService", NewDefaultConnectionService));
		}
Exemplo n.º 9
0
		public void DelSTASettings(byte[] NewSTASettings)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionDelSTASettings == null)
				actionDelSTASettings = this.service.GetAction("DelSTASettings");

			this.actionDelSTASettings.Invoke(out OutputValues,
				new KeyValuePair<string, object>("NewSTASettings", NewSTASettings));
		}
Exemplo n.º 10
0
		public void GetIdleDisconnectTime(out string NewIdleDisconnectTime)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetIdleDisconnectTime == null)
				actionGetIdleDisconnectTime = this.service.GetAction("GetIdleDisconnectTime");

			this.actionGetIdleDisconnectTime.Invoke(out OutputValues);

			NewIdleDisconnectTime = (string)OutputValues["NewIdleDisconnectTime"];
		}
		public void GetTotalPacketsReceived(out uint NewTotalPacketsReceived)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetTotalPacketsReceived == null)
				actionGetTotalPacketsReceived = this.service.GetAction("GetTotalPacketsReceived");

			this.actionGetTotalPacketsReceived.Invoke(out OutputValues);

			NewTotalPacketsReceived = (uint)OutputValues["NewTotalPacketsReceived"];
		}
		public void GetTotalPacketsSent(out uint NewTotalPacketsSent)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetTotalPacketsSent == null)
				actionGetTotalPacketsSent = this.service.GetAction("GetTotalPacketsSent");

			this.actionGetTotalPacketsSent.Invoke(out OutputValues);

			NewTotalPacketsSent = (uint)OutputValues["NewTotalPacketsSent"];
		}
Exemplo n.º 13
0
		public void GetDeviceInfo(out byte[] NewDeviceInfo)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetDeviceInfo == null)
				actionGetDeviceInfo = this.service.GetAction("GetDeviceInfo");

			this.actionGetDeviceInfo.Invoke(out OutputValues);

			NewDeviceInfo = (byte[])OutputValues["NewDeviceInfo"];
		}
Exemplo n.º 14
0
		public void GetExternalIPAddress(out string NewExternalIPAddress)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetExternalIPAddress == null)
				actionGetExternalIPAddress = this.service.GetAction("GetExternalIPAddress");

			this.actionGetExternalIPAddress.Invoke(out OutputValues);

			NewExternalIPAddress = (string)OutputValues["NewExternalIPAddress"];
		}
Exemplo n.º 15
0
		public void GetDefaultConnectionService(out string NewDefaultConnectionService)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetDefaultConnectionService == null)
				actionGetDefaultConnectionService = this.service.GetAction("GetDefaultConnectionService");

			this.actionGetDefaultConnectionService.Invoke(out OutputValues);

			NewDefaultConnectionService = (string)OutputValues["NewDefaultConnectionService"];
		}
Exemplo n.º 16
0
		public void GetSortCapabilities(out string SortCaps)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetSortCapabilities == null)
				actionGetSortCapabilities = this.service.GetAction("GetSortCapabilities");

			this.actionGetSortCapabilities.Invoke(out OutputValues);

			SortCaps = (string)OutputValues["SortCaps"];
		}
		public void GetEthernetLinkStatus(out string NewEthernetLinkStatus)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetEthernetLinkStatus == null)
				actionGetEthernetLinkStatus = this.service.GetAction("GetEthernetLinkStatus");

			this.actionGetEthernetLinkStatus.Invoke(out OutputValues);

			NewEthernetLinkStatus = (string)OutputValues["NewEthernetLinkStatus"];
		}
Exemplo n.º 18
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void RequestConnection()
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionRequestConnection is null)
            {
                actionRequestConnection = this.service.GetAction("RequestConnection");
            }

            this.actionRequestConnection.Invoke(out OutputValues);
        }
Exemplo n.º 19
0
		public void GetSystemUpdateID(out uint Id)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetSystemUpdateID == null)
				actionGetSystemUpdateID = this.service.GetAction("GetSystemUpdateID");

			this.actionGetSystemUpdateID.Invoke(out OutputValues);

			Id = (uint)OutputValues["Id"];
		}
        private static void GetPhotos(object State)
        {
            object[]         P           = (object[])State;
            int              i           = (int)P [0];
            IUPnPService     Service     = (IUPnPService)P [1];
            string           ContentType = (string)P [2];
            string           Extension   = (string)P [3];
            MailMessage      Msg         = (MailMessage)P [4];
            ManualResetEvent Done        = (ManualResetEvent)P [5];
            DateTime         Next        = DateTime.Now;

            try
            {
                UPnPAction GetDefaultImageURL = Service ["GetDefaultImageURL"];
                Variables  v = new Variables();
                GetDefaultImageURL.Execute(v);
                string ImageURL = (string)v ["RetImageURL"];

                ParsedUri    ImageURI = Web.ParseUri(ImageURL);
                HttpResponse Response;
                int          ms;
                int          j;

                using (HttpSocketClient Client = new HttpSocketClient(ImageURI.Host, ImageURI.Port, ImageURI.UriScheme is HttpsUriScheme, ImageURI.Credentials))
                {
                    Client.ReceiveTimeout = 20000;

                    for (j = 1; j <= 3; j++)
                    {
                        ms = (int)System.Math.Round((Next - DateTime.Now).TotalMilliseconds);
                        if (ms > 0)
                        {
                            Thread.Sleep(ms);
                        }

                        Response = Client.GET(ImageURI.PathAndQuery, ContentType);
                        Msg.EmbedObject("cam" + (i + 1).ToString() + "img" + j.ToString() + "." + Extension, ContentType, Response.Data);

                        Log.Information("Click.", EventLevel.Minor, Service.Device.FriendlyName);

                        Next = Next.AddSeconds(5);
                    }
                }
            } catch (ThreadAbortException)
            {
                Thread.ResetAbort();
            } catch (Exception ex)
            {
                Log.Exception(ex);
            } finally
            {
                Done.Set();
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void ForceTermination()
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionForceTermination is null)
            {
                actionForceTermination = this.service.GetAction("ForceTermination");
            }

            this.actionForceTermination.Invoke(out OutputValues);
        }
Exemplo n.º 22
0
		public void GetCurrentConnectionIDs(out string ConnectionIDs)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetCurrentConnectionIDs == null)
				actionGetCurrentConnectionIDs = this.service.GetAction("GetCurrentConnectionIDs");

			this.actionGetCurrentConnectionIDs.Invoke(out OutputValues);

			ConnectionIDs = (string)OutputValues["ConnectionIDs"];
		}
Exemplo n.º 23
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void SetWarnDisconnectDelay(string NewWarnDisconnectDelay)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionSetWarnDisconnectDelay is null)
            {
                actionSetWarnDisconnectDelay = this.service.GetAction("SetWarnDisconnectDelay");
            }

            this.actionSetWarnDisconnectDelay.Invoke(out OutputValues,
                                                     new KeyValuePair <string, object>("NewWarnDisconnectDelay", NewWarnDisconnectDelay));
        }
		public void IsValidated(string DeviceID, out long Result)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionIsValidated == null)
				actionIsValidated = this.service.GetAction("IsValidated");

			this.actionIsValidated.Invoke(out OutputValues,
				new KeyValuePair<string, object>("DeviceID", DeviceID));

			Result = (long)OutputValues["Result"];
		}
		public void RegisterDevice(byte[] RegistrationReqMsg, out byte[] RegistrationRespMsg)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionRegisterDevice == null)
				actionRegisterDevice = this.service.GetAction("RegisterDevice");

			this.actionRegisterDevice.Invoke(out OutputValues,
				new KeyValuePair<string, object>("RegistrationReqMsg", RegistrationReqMsg));

			RegistrationRespMsg = (byte[])OutputValues["RegistrationRespMsg"];
		}
Exemplo n.º 26
0
		public void GetSTASettings(byte[] NewMessage, out byte[] NewSTASettings)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetSTASettings == null)
				actionGetSTASettings = this.service.GetAction("GetSTASettings");

			this.actionGetSTASettings.Invoke(out OutputValues,
				new KeyValuePair<string, object>("NewMessage", NewMessage));

			NewSTASettings = (byte[])OutputValues["NewSTASettings"];
		}
Exemplo n.º 27
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void SetIdleDisconnectTime(string NewIdleDisconnectTime)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionSetIdleDisconnectTime is null)
            {
                actionSetIdleDisconnectTime = this.service.GetAction("SetIdleDisconnectTime");
            }

            this.actionSetIdleDisconnectTime.Invoke(out OutputValues,
                                                    new KeyValuePair <string, object>("NewIdleDisconnectTime", NewIdleDisconnectTime));
        }
Exemplo n.º 28
0
		public void GetProtocolInfo(out string Source, out string Sink)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetProtocolInfo == null)
				actionGetProtocolInfo = this.service.GetAction("GetProtocolInfo");

			this.actionGetProtocolInfo.Invoke(out OutputValues);

			Source = (string)OutputValues["Source"];
			Sink = (string)OutputValues["Sink"];
		}
Exemplo n.º 29
0
		public void DeletePortMapping(string NewRemoteHost, ushort NewExternalPort, string NewProtocol)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionDeletePortMapping == null)
				actionDeletePortMapping = this.service.GetAction("DeletePortMapping");

			this.actionDeletePortMapping.Invoke(out OutputValues,
				new KeyValuePair<string, object>("NewRemoteHost", NewRemoteHost),
				new KeyValuePair<string, object>("NewExternalPort", NewExternalPort),
				new KeyValuePair<string, object>("NewProtocol", NewProtocol));
		}
Exemplo n.º 30
0
		public void GetConnectionTypeInfo(out string NewConnectionType, out string NewPossibleConnectionTypes)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetConnectionTypeInfo == null)
				actionGetConnectionTypeInfo = this.service.GetAction("GetConnectionTypeInfo");

			this.actionGetConnectionTypeInfo.Invoke(out OutputValues);

			NewConnectionType = (string)OutputValues["NewConnectionType"];
			NewPossibleConnectionTypes = (string)OutputValues["NewPossibleConnectionTypes"];
		}
Exemplo n.º 31
0
        public void ResetSTA(byte[] NewMessage)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionResetSTA is null)
            {
                actionResetSTA = this.service.GetAction("ResetSTA");
            }

            this.actionResetSTA.Invoke(out OutputValues,
                                       new KeyValuePair <string, object>("NewMessage", NewMessage));
        }
Exemplo n.º 32
0
        public void SetSelectedRegistrar(byte[] NewMessage)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionSetSelectedRegistrar is null)
            {
                actionSetSelectedRegistrar = this.service.GetAction("SetSelectedRegistrar");
            }

            this.actionSetSelectedRegistrar.Invoke(out OutputValues,
                                                   new KeyValuePair <string, object>("NewMessage", NewMessage));
        }
Exemplo n.º 33
0
        public void DelSTASettings(byte[] NewSTASettings)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionDelSTASettings is null)
            {
                actionDelSTASettings = this.service.GetAction("DelSTASettings");
            }

            this.actionDelSTASettings.Invoke(out OutputValues,
                                             new KeyValuePair <string, object>("NewSTASettings", NewSTASettings));
        }
Exemplo n.º 34
0
        public void RebootAP(byte[] NewAPSettings)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionRebootAP is null)
            {
                actionRebootAP = this.service.GetAction("RebootAP");
            }

            this.actionRebootAP.Invoke(out OutputValues,
                                       new KeyValuePair <string, object>("NewAPSettings", NewAPSettings));
        }
Exemplo n.º 35
0
        public void SetDefaultConnectionService(string NewDefaultConnectionService)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionSetDefaultConnectionService is null)
            {
                actionSetDefaultConnectionService = this.service.GetAction("SetDefaultConnectionService");
            }

            this.actionSetDefaultConnectionService.Invoke(out OutputValues,
                                                          new KeyValuePair <string, object>("NewDefaultConnectionService", NewDefaultConnectionService));
        }
Exemplo n.º 36
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void GetSystemUpdateID(out uint Id)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetSystemUpdateID is null)
            {
                actionGetSystemUpdateID = this.service.GetAction("GetSystemUpdateID");
            }

            this.actionGetSystemUpdateID.Invoke(out OutputValues);

            Id = (uint)OutputValues["Id"];
        }
Exemplo n.º 37
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void GetExternalIPAddress(out string NewExternalIPAddress)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetExternalIPAddress is null)
            {
                actionGetExternalIPAddress = this.service.GetAction("GetExternalIPAddress");
            }

            this.actionGetExternalIPAddress.Invoke(out OutputValues);

            NewExternalIPAddress = (string)OutputValues["NewExternalIPAddress"];
        }
Exemplo n.º 38
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void X_GetRemoteSharingStatus(out bool Status)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionX_GetRemoteSharingStatus is null)
            {
                actionX_GetRemoteSharingStatus = this.service.GetAction("X_GetRemoteSharingStatus");
            }

            this.actionX_GetRemoteSharingStatus.Invoke(out OutputValues);

            Status = (bool)OutputValues["Status"];
        }
Exemplo n.º 39
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void GetAutoDisconnectTime(out string NewAutoDisconnectTime)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetAutoDisconnectTime is null)
            {
                actionGetAutoDisconnectTime = this.service.GetAction("GetAutoDisconnectTime");
            }

            this.actionGetAutoDisconnectTime.Invoke(out OutputValues);

            NewAutoDisconnectTime = (string)OutputValues["NewAutoDisconnectTime"];
        }
Exemplo n.º 40
0
        public void GetDeviceInfo(out byte[] NewDeviceInfo)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetDeviceInfo is null)
            {
                actionGetDeviceInfo = this.service.GetAction("GetDeviceInfo");
            }

            this.actionGetDeviceInfo.Invoke(out OutputValues);

            NewDeviceInfo = (byte[])OutputValues["NewDeviceInfo"];
        }
Exemplo n.º 41
0
        public void SetSTASettings(out byte[] NewSTASettings)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionSetSTASettings is null)
            {
                actionSetSTASettings = this.service.GetAction("SetSTASettings");
            }

            this.actionSetSTASettings.Invoke(out OutputValues);

            NewSTASettings = (byte[])OutputValues["NewSTASettings"];
        }
        public void GetTotalPacketsSent(out uint NewTotalPacketsSent)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetTotalPacketsSent is null)
            {
                actionGetTotalPacketsSent = this.service.GetAction("GetTotalPacketsSent");
            }

            this.actionGetTotalPacketsSent.Invoke(out OutputValues);

            NewTotalPacketsSent = (uint)OutputValues["NewTotalPacketsSent"];
        }
Exemplo n.º 43
0
        public void GetCurrentConnectionIDs(out string ConnectionIDs)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetCurrentConnectionIDs is null)
            {
                actionGetCurrentConnectionIDs = this.service.GetAction("GetCurrentConnectionIDs");
            }

            this.actionGetCurrentConnectionIDs.Invoke(out OutputValues);

            ConnectionIDs = (string)OutputValues["ConnectionIDs"];
        }
Exemplo n.º 44
0
        public void GetDefaultConnectionService(out string NewDefaultConnectionService)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetDefaultConnectionService is null)
            {
                actionGetDefaultConnectionService = this.service.GetAction("GetDefaultConnectionService");
            }

            this.actionGetDefaultConnectionService.Invoke(out OutputValues);

            NewDefaultConnectionService = (string)OutputValues["NewDefaultConnectionService"];
        }
        private void SetAction(UPnPAction act)
        {
            actionNameTextBox.Text = act.Name;

            UPnPArgument[] args = act.ArgumentList;
            foreach (UPnPArgument arg in args)
            {
                UPnpArgumentEditControl argEdit = new UPnpArgumentEditControl(this, act, arg);
                argEdit.Dock = DockStyle.Top;
                argPanel.Controls.Add(argEdit);
                argPanel.Controls.SetChildIndex(argEdit, 0);
            }
        }
Exemplo n.º 46
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void GetWarnDisconnectDelay(out string NewWarnDisconnectDelay)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetWarnDisconnectDelay is null)
            {
                actionGetWarnDisconnectDelay = this.service.GetAction("GetWarnDisconnectDelay");
            }

            this.actionGetWarnDisconnectDelay.Invoke(out OutputValues);

            NewWarnDisconnectDelay = (string)OutputValues["NewWarnDisconnectDelay"];
        }
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void GetEthernetLinkStatus(out string NewEthernetLinkStatus)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetEthernetLinkStatus is null)
            {
                actionGetEthernetLinkStatus = this.service.GetAction("GetEthernetLinkStatus");
            }

            this.actionGetEthernetLinkStatus.Invoke(out OutputValues);

            NewEthernetLinkStatus = (string)OutputValues["NewEthernetLinkStatus"];
        }
        public void GetTotalPacketsReceived(out uint NewTotalPacketsReceived)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetTotalPacketsReceived is null)
            {
                actionGetTotalPacketsReceived = this.service.GetAction("GetTotalPacketsReceived");
            }

            this.actionGetTotalPacketsReceived.Invoke(out OutputValues);

            NewTotalPacketsReceived = (uint)OutputValues["NewTotalPacketsReceived"];
        }
Exemplo n.º 49
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void GetSortCapabilities(out string SortCaps)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionGetSortCapabilities is null)
            {
                actionGetSortCapabilities = this.service.GetAction("GetSortCapabilities");
            }

            this.actionGetSortCapabilities.Invoke(out OutputValues);

            SortCaps = (string)OutputValues["SortCaps"];
        }
        private IList <UPnPAction> ParseActions(XContainer xml)
        {
            IList <UPnPAction> actions = new List <UPnPAction>();

            foreach (XElement statevar in xml.Descendants().Where(x => x.Name.LocalName == "actionList").Elements())
            {
                UPnPAction action = new UPnPAction();

                foreach (XElement element in statevar.Elements())
                {
                    switch (element.Name.LocalName)
                    {
                    case "name":
                        action.Name = element.Value;
                        break;

                    case "argumentList":
                        foreach (XElement xElement in element.Elements())
                        {
                            ActionArgument arg = new ActionArgument();
                            foreach (XElement xElement1 in xElement.Elements())
                            {
                                switch (xElement1.Name.LocalName)
                                {
                                case "name":
                                    arg.Name = xElement1.Value;
                                    break;

                                case "direction":
                                    arg.Direction = xElement1.Value == "in"
                                                                                                ? ActionArgument.ArgumentDirection.In
                                                                                                : ActionArgument.ArgumentDirection.Out;
                                    break;

                                case "relatedStateVariable":
                                    arg.RelatedStateVariable = xElement1.Value;
                                    break;
                                }
                            }
                            action.Arguments.Add(arg);
                        }

                        break;
                    }
                }

                actions.Add(action);
            }

            return(actions);
        }
Exemplo n.º 51
0
        /// <summary>
        /// Generated from SCPD
        /// </summary>
        public void DeletePortMapping(string NewRemoteHost, ushort NewExternalPort, string NewProtocol)
        {
            Dictionary <string, object> OutputValues = new Dictionary <string, object>();

            if (actionDeletePortMapping is null)
            {
                actionDeletePortMapping = this.service.GetAction("DeletePortMapping");
            }

            this.actionDeletePortMapping.Invoke(out OutputValues,
                                                new KeyValuePair <string, object>("NewRemoteHost", NewRemoteHost),
                                                new KeyValuePair <string, object>("NewExternalPort", NewExternalPort),
                                                new KeyValuePair <string, object>("NewProtocol", NewProtocol));
        }
		public void GetCommonLinkProperties(out string NewWANAccessType, out uint NewLayer1UpstreamMaxBitRate, out uint NewLayer1DownstreamMaxBitRate, out string NewPhysicalLinkStatus)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetCommonLinkProperties == null)
				actionGetCommonLinkProperties = this.service.GetAction("GetCommonLinkProperties");

			this.actionGetCommonLinkProperties.Invoke(out OutputValues);

			NewWANAccessType = (string)OutputValues["NewWANAccessType"];
			NewLayer1UpstreamMaxBitRate = (uint)OutputValues["NewLayer1UpstreamMaxBitRate"];
			NewLayer1DownstreamMaxBitRate = (uint)OutputValues["NewLayer1DownstreamMaxBitRate"];
			NewPhysicalLinkStatus = (string)OutputValues["NewPhysicalLinkStatus"];
		}
Exemplo n.º 53
0
		public void AddPortMapping(string NewRemoteHost, ushort NewExternalPort, string NewProtocol, ushort NewInternalPort, string NewInternalClient, bool NewEnabled, string NewPortMappingDescription, uint NewLeaseDuration)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionAddPortMapping == null)
				actionAddPortMapping = this.service.GetAction("AddPortMapping");

			this.actionAddPortMapping.Invoke(out OutputValues,
				new KeyValuePair<string, object>("NewRemoteHost", NewRemoteHost),
				new KeyValuePair<string, object>("NewExternalPort", NewExternalPort),
				new KeyValuePair<string, object>("NewProtocol", NewProtocol),
				new KeyValuePair<string, object>("NewInternalPort", NewInternalPort),
				new KeyValuePair<string, object>("NewInternalClient", NewInternalClient),
				new KeyValuePair<string, object>("NewEnabled", NewEnabled),
				new KeyValuePair<string, object>("NewPortMappingDescription", NewPortMappingDescription),
				new KeyValuePair<string, object>("NewLeaseDuration", NewLeaseDuration));
		}
Exemplo n.º 54
0
		public void GetCurrentConnectionInfo(int ConnectionID, out int RcsID, out int AVTransportID, out string ProtocolInfo, out string PeerConnectionManager, out int PeerConnectionID, out string Direction, out string Status)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetCurrentConnectionInfo == null)
				actionGetCurrentConnectionInfo = this.service.GetAction("GetCurrentConnectionInfo");

			this.actionGetCurrentConnectionInfo.Invoke(out OutputValues,
				new KeyValuePair<string, object>("ConnectionID", ConnectionID));

			RcsID = (int)OutputValues["RcsID"];
			AVTransportID = (int)OutputValues["AVTransportID"];
			ProtocolInfo = (string)OutputValues["ProtocolInfo"];
			PeerConnectionManager = (string)OutputValues["PeerConnectionManager"];
			PeerConnectionID = (int)OutputValues["PeerConnectionID"];
			Direction = (string)OutputValues["Direction"];
			Status = (string)OutputValues["Status"];
		}
Exemplo n.º 55
0
		public void Browse(string ObjectID, string BrowseFlag, string Filter, uint StartingIndex, uint RequestedCount, string SortCriteria, out string Result, out uint NumberReturned, out uint TotalMatches, out uint UpdateID)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionBrowse == null)
				actionBrowse = this.service.GetAction("Browse");

			this.actionBrowse.Invoke(out OutputValues,
				new KeyValuePair<string, object>("ObjectID", ObjectID),
				new KeyValuePair<string, object>("BrowseFlag", BrowseFlag),
				new KeyValuePair<string, object>("Filter", Filter),
				new KeyValuePair<string, object>("StartingIndex", StartingIndex),
				new KeyValuePair<string, object>("RequestedCount", RequestedCount),
				new KeyValuePair<string, object>("SortCriteria", SortCriteria));

			Result = (string)OutputValues["Result"];
			NumberReturned = (uint)OutputValues["NumberReturned"];
			TotalMatches = (uint)OutputValues["TotalMatches"];
			UpdateID = (uint)OutputValues["UpdateID"];
		}
Exemplo n.º 56
0
		public void Search(string ContainerID, string SearchCriteria, string Filter, uint StartingIndex, uint RequestedCount, string SortCriteria, out string Result, out uint NumberReturned, out uint TotalMatches, out uint UpdateID)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionSearch == null)
				actionSearch = this.service.GetAction("Search");

			this.actionSearch.Invoke(out OutputValues,
				new KeyValuePair<string, object>("ContainerID", ContainerID),
				new KeyValuePair<string, object>("SearchCriteria", SearchCriteria),
				new KeyValuePair<string, object>("Filter", Filter),
				new KeyValuePair<string, object>("StartingIndex", StartingIndex),
				new KeyValuePair<string, object>("RequestedCount", RequestedCount),
				new KeyValuePair<string, object>("SortCriteria", SortCriteria));

			Result = (string)OutputValues["Result"];
			NumberReturned = (uint)OutputValues["NumberReturned"];
			TotalMatches = (uint)OutputValues["TotalMatches"];
			UpdateID = (uint)OutputValues["UpdateID"];
		}
Exemplo n.º 57
0
		public void X_GetRemoteSharingStatus(out bool Status)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionX_GetRemoteSharingStatus == null)
				actionX_GetRemoteSharingStatus = this.service.GetAction("X_GetRemoteSharingStatus");

			this.actionX_GetRemoteSharingStatus.Invoke(out OutputValues);

			Status = (bool)OutputValues["Status"];
		}
Exemplo n.º 58
0
		public void GetSpecificPortMappingEntry(string NewRemoteHost, ushort NewExternalPort, string NewProtocol, out ushort NewInternalPort, out string NewInternalClient, out bool NewEnabled, out string NewPortMappingDescription, out uint NewLeaseDuration)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionGetSpecificPortMappingEntry == null)
				actionGetSpecificPortMappingEntry = this.service.GetAction("GetSpecificPortMappingEntry");

			this.actionGetSpecificPortMappingEntry.Invoke(out OutputValues,
				new KeyValuePair<string, object>("NewRemoteHost", NewRemoteHost),
				new KeyValuePair<string, object>("NewExternalPort", NewExternalPort),
				new KeyValuePair<string, object>("NewProtocol", NewProtocol));

			NewInternalPort = (ushort)OutputValues["NewInternalPort"];
			NewInternalClient = (string)OutputValues["NewInternalClient"];
			NewEnabled = (bool)OutputValues["NewEnabled"];
			NewPortMappingDescription = (string)OutputValues["NewPortMappingDescription"];
			NewLeaseDuration = (uint)OutputValues["NewLeaseDuration"];
		}
Exemplo n.º 59
0
        protected void InvokeSink(UPnPAction sender, UPnPArgument[] InArgs, out object RetVal, out UPnPArgument[] OutArgs)
        {
            UPnPService S = (UPnPService)ServiceTable [sender.ParentService];
            UPnPAction A = S.GetAction (sender.Name);

            ArrayList TempList = new ArrayList ();
            foreach (UPnPArgument arg in A.Arguments) {
                if ((arg.IsReturnValue == false) && (arg.Direction == "out"))
                    TempList.Add (arg.Clone ());
            }

            foreach (UPnPArgument arg in InArgs) {
                TempList.Add (arg);
            }

            lock (CallQueue) {
                ++InvokeID;
                CallQueue.Enqueue (InvokeID);
                S.InvokeAsync (sender.Name, (UPnPArgument[])TempList.ToArray (typeof(UPnPArgument)),
                    InvokeID,
                    new UPnPService.UPnPServiceInvokeHandler (RealInvokeSink),
                    null);
                InvokeTable [InvokeID] = sender.ParentService;
            }

            UPnPArgument[] OtherArgs;
            sender.ParentService.DelayInvokeRespose (InvokeID, out OtherArgs);
            throw(new DelayedResponseException ());
        }
Exemplo n.º 60
0
		public void UpdateObject(string ObjectID, string CurrentTagValue, string NewTagValue)
		{
			Dictionary<string, object> OutputValues = new Dictionary<string, object>();
			
			if (actionUpdateObject == null)
				actionUpdateObject = this.service.GetAction("UpdateObject");

			this.actionUpdateObject.Invoke(out OutputValues,
				new KeyValuePair<string, object>("ObjectID", ObjectID),
				new KeyValuePair<string, object>("CurrentTagValue", CurrentTagValue),
				new KeyValuePair<string, object>("NewTagValue", NewTagValue));
		}