Exemplo n.º 1
0
        /**
         * Set a configuration value
         *
         * @param configId the {@link EzspConfigId} to set
         * @param value the value to set
         * @return the {@link EzspStatus} of the response
         */
        public EzspStatus SetConfiguration(EzspConfigId configId, int value)
        {
            EzspSetConfigurationValueRequest request = new EzspSetConfigurationValueRequest();

            request.SetConfigId(configId);
            request.SetValue(value);
            Log.Debug(request.ToString());

            IEzspTransaction transaction = _protocolHandler.SendEzspTransaction(new EzspSingleResponseTransaction(request, typeof(EzspSetConfigurationValueResponse)));
            EzspSetConfigurationValueResponse response = (EzspSetConfigurationValueResponse)transaction.GetResponse();

            _lastStatus = EmberStatus.UNKNOWN;
            Log.Debug(response.ToString());

            return(response.GetStatus());
        }
Exemplo n.º 2
0
        /**
         * Get a configuration value
         *
         * @param configId the {@link EzspConfigId} to set
         * @return the configuration value as {@link Integer} or null on error
         */
        public int?GetConfiguration(EzspConfigId configId)
        {
            EzspGetConfigurationValueRequest request = new EzspGetConfigurationValueRequest();

            request.SetConfigId(configId);
            IEzspTransaction transaction = _protocolHandler.SendEzspTransaction(new EzspSingleResponseTransaction(request, typeof(EzspGetConfigurationValueResponse)));
            EzspGetConfigurationValueResponse response = (EzspGetConfigurationValueResponse)transaction.GetResponse();

            _lastStatus = EmberStatus.UNKNOWN;
            Log.Debug(response.ToString());

            if (response.GetStatus() != EzspStatus.EZSP_SUCCESS)
            {
                return(null);
            }

            return(response.GetValue());
        }
Exemplo n.º 3
0
 /// <summary>
 /// The configId to set as <see cref="EzspConfigId"/> </summary>
 public void SetConfigId(EzspConfigId configId)
 {
     _configId = configId;
 }
Exemplo n.º 4
0
 public void SerializeEzspConfigId(EzspConfigId configId)
 {
     _buffer[_length++] = (int)configId;
 }