use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetPolicyRequest in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberNcp method getPolicy.
/**
* Get a policy used by the NCP to make fast decisions.
*
* @param policyId the {@link EzspPolicyId} to set
* @return the returned {@link EzspDecisionId} if the policy was retrieved successfully or null if there was an
* error
*/
public EzspDecisionId getPolicy(EzspPolicyId policyId) {
EzspGetPolicyRequest getPolicyRequest = new EzspGetPolicyRequest();
getPolicyRequest.setPolicyId(policyId);
EzspSingleResponseTransaction transaction = new EzspSingleResponseTransaction(getPolicyRequest, EzspGetPolicyResponse.class);
ashHandler.sendEzspTransaction(transaction);
EzspGetPolicyResponse getPolicyResponse = (EzspGetPolicyResponse) transaction.getResponse();
lastStatus = null;
logger.debug(getPolicyResponse.toString());
if (getPolicyResponse.getStatus() != EzspStatus.EZSP_SUCCESS) {
logger.debug("Error getting policy: {}", getPolicyResponse);
return null;
}
return getPolicyResponse.getDecisionId();
}
Aggregations