SetResponseData() public méthode

Sets the response data
public SetResponseData ( SiLA.Provider.ResponseData data ) : void
data SiLA.Provider.ResponseData The data.
Résultat void
Exemple #1
0
        /// <summary>
        /// The SetParameters command is used to set device class and device specific parameters in the state idle so that the new values are used for the next command invocation.
        /// Only the parameters that need to be changed have to be transmitted to the device.
        /// </summary>
        /// <param name="paramsXML">ParameterSet XML</param>
        /// <returns>SiLAReturnValue</returns>
        public SiLAReturnValue SetParameters(string paramsXML)
        {
            // Example of a valid value for paramsXML:
            //<?xml version="1.0" encoding="utf-8"?>
            //<ParameterSet>
            //  <Parameter name="Temperature">
            //    <Int32>33</Int32>
            //  </Parameter>
            //  <Parameter name="TimeInSeconds">
            //    <Int32>1500</Int32>
            //  </Parameter>
            //</ParameterSet>

            SiLAReturnValue returnValue = this.ExecuteAsync(this.RequestId, (noexec) =>
            {
                if (noexec)
                {
                    // calculates the estimated duration and returns AsynchronousCommandAccepted
                    return(this.CreateReturnValue(ReturnCode.AsynchronousCommandAccepted, 100));
                }

                // The paramsXML represents a ParameterSet
                ParameterSet data        = Tools.FromXML <ParameterSet>(paramsXML);
                SiLAReturnValue retParam = this.CreateReturnValue();

                // ResponseData contains a list of device parameters
                ResponseData responseData = this.GetIncubatorParameters();
                retParam.SetResponseData(responseData);

                return(retParam);
            });

            return(returnValue);
        }
Exemple #2
0
        /// <summary>
        /// With this command the device reports the available parameters that can be set during the idle state to the PMS.
        /// The content of the response data is ParameterSet that contains a list of device parameters.
        /// </summary>
        /// <returns>SiLAReturnValue</returns>
        public SiLAReturnValue GetParameters()
        {
            SiLAReturnValue returnValue = this.ExecuteAsync(this.RequestId, (noexec) =>
            {
                if (noexec)
                {
                    // calculates the estimated duration and returns AsynchronousCommandAccepted
                    return(this.CreateReturnValue(ReturnCode.AsynchronousCommandAccepted, 100));
                }

                SiLAReturnValue retParam = this.CreateReturnValue();

                // ResponseData contains a list of device parameters
                ResponseData responseData = this.GetIncubatorParameters();
                retParam.SetResponseData(responseData);

                return(retParam);
            });

            return(returnValue);
        }