Search in sources :

Example 1 with EzspGetConfigurationValueResponse

use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class EzspNeighborTable method getConfiguration.

/**
 * Get a configuration value
 *
 * @param configId the {@link EzspConfigId} to set
 * @return the configuration value as {@link Integer} or null on error
 */
private Integer getConfiguration(EzspConfigId configId) {
    EzspGetConfigurationValueRequest configValue = new EzspGetConfigurationValueRequest();
    configValue.setConfigId(configId);
    EzspTransaction configTransaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(configValue, EzspGetConfigurationValueResponse.class));
    EzspGetConfigurationValueResponse configResponse = (EzspGetConfigurationValueResponse) configTransaction.getResponse();
    logger.debug(configResponse.toString());
    if (configResponse.getStatus() != EzspStatus.EZSP_SUCCESS) {
        return null;
    }
    return configResponse.getValue();
}
Also used : EzspTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction) EzspGetConfigurationValueResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueResponse) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction) EzspGetConfigurationValueRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueRequest)

Example 2 with EzspGetConfigurationValueResponse

use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class EmberNcp method getConfiguration.

/**
 * Get a configuration value
 *
 * @param configId the {@link EzspConfigId} to set
 * @return the configuration value as {@link Integer} or null on error
 */
public Integer getConfiguration(EzspConfigId configId) {
    EzspGetConfigurationValueRequest request = new EzspGetConfigurationValueRequest();
    request.setConfigId(configId);
    EzspTransaction transaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(request, EzspGetConfigurationValueResponse.class));
    EzspGetConfigurationValueResponse response = (EzspGetConfigurationValueResponse) transaction.getResponse();
    lastStatus = null;
    logger.debug(response.toString());
    if (response.getStatus() != EzspStatus.EZSP_SUCCESS) {
        return null;
    }
    return response.getValue();
}
Also used : EzspTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction) EzspGetConfigurationValueResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueResponse) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction) EzspGetConfigurationValueRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueRequest)

Aggregations

EzspGetConfigurationValueRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueRequest)2 EzspGetConfigurationValueResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueResponse)2 EzspSingleResponseTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)2 EzspTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction)2