use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspSetConcentratorResponse in project com.zsmartsystems.zigbee by zsmartsystems.
the class ZigBeeDongleEzsp method setConcentrator.
private TransportConfigResult setConcentrator(ConcentratorConfig concentratorConfig) {
EzspSetConcentratorRequest concentratorRequest = new EzspSetConcentratorRequest();
concentratorRequest.setMinTime(concentratorConfig.getRefreshMinimum());
concentratorRequest.setMaxTime(concentratorConfig.getRefreshMaximum());
concentratorRequest.setMaxHops(concentratorConfig.getMaxHops());
concentratorRequest.setRouteErrorThreshold(concentratorConfig.getMaxFailures());
concentratorRequest.setDeliveryFailureThreshold(concentratorConfig.getMaxFailures());
switch(concentratorConfig.getType()) {
case DISABLED:
concentratorRequest.setEnable(false);
break;
case HIGH_RAM:
concentratorRequest.setConcentratorType(EmberConcentratorType.EMBER_HIGH_RAM_CONCENTRATOR);
concentratorRequest.setEnable(true);
break;
case LOW_RAM:
concentratorRequest.setConcentratorType(EmberConcentratorType.EMBER_LOW_RAM_CONCENTRATOR);
concentratorRequest.setEnable(true);
break;
default:
break;
}
EzspTransaction concentratorTransaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(concentratorRequest, EzspSetConcentratorResponse.class));
EzspSetConcentratorResponse concentratorResponse = (EzspSetConcentratorResponse) concentratorTransaction.getResponse();
logger.debug(concentratorResponse.toString());
if (concentratorResponse.getStatus() == EzspStatus.EZSP_SUCCESS) {
return TransportConfigResult.SUCCESS;
}
return TransportConfigResult.FAILURE;
}
Aggregations