use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspSetPolicyResponse in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberNcp method setPolicy.
/**
* Set a policy used by the NCP to make fast decisions.
*
* @param policyId the {@link EzspPolicyId} to set
* @param decisionId the {@link EzspDecisionId} to set to
* @return true if the policy setting was successful
*/
public boolean setPolicy(EzspPolicyId policyId, EzspDecisionId decisionId) {
EzspSetPolicyRequest setPolicyRequest = new EzspSetPolicyRequest();
setPolicyRequest.setPolicyId(policyId);
setPolicyRequest.setDecisionId(decisionId);
EzspSingleResponseTransaction transaction = new EzspSingleResponseTransaction(setPolicyRequest, EzspSetPolicyResponse.class);
ashHandler.sendEzspTransaction(transaction);
EzspSetPolicyResponse setPolicyResponse = (EzspSetPolicyResponse) transaction.getResponse();
lastStatus = null;
logger.debug(setPolicyResponse.toString());
if (setPolicyResponse.getStatus() != EzspStatus.EZSP_SUCCESS) {
logger.debug("Error during setting policy: {}", setPolicyResponse);
return false;
}
return true;
}
Aggregations