/** * 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()); }
/** * 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()); }
/// <summary> /// The configId to set as <see cref="EzspConfigId"/> </summary> public void SetConfigId(EzspConfigId configId) { _configId = configId; }
public void SerializeEzspConfigId(EzspConfigId configId) { _buffer[_length++] = (int)configId; }