use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetNetworkParametersResponse in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberNcp method getNetworkParameters.
/**
* Gets the current network parameters, or an empty parameters class if there's an error
*
* @return {@link EmberNetworkParameters}
*/
public EmberNetworkParameters getNetworkParameters() {
EzspGetNetworkParametersRequest request = new EzspGetNetworkParametersRequest();
EzspSingleResponseTransaction transaction = new EzspSingleResponseTransaction(request, EzspGetNetworkParametersResponse.class);
ashHandler.sendEzspTransaction(transaction);
EzspGetNetworkParametersResponse response = (EzspGetNetworkParametersResponse) transaction.getResponse();
logger.debug(response.toString());
lastStatus = response.getStatus();
if (response.getStatus() != EmberStatus.EMBER_SUCCESS && response.getStatus() != EmberStatus.EMBER_NOT_JOINED) {
logger.debug("Error during retrieval of network parameters: {}", response);
return new EmberNetworkParameters();
}
return response.getParameters();
}
use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetNetworkParametersResponse in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberNetworkInitialisation method getNetworkParameters.
/**
* Get the current network parameters
*
* @return the {@link EmberNetworkParameters} or null on error
*/
private EmberNetworkParameters getNetworkParameters() {
EzspGetNetworkParametersRequest networkParms = new EzspGetNetworkParametersRequest();
EzspSingleResponseTransaction transaction = new EzspSingleResponseTransaction(networkParms, EzspGetNetworkParametersResponse.class);
ashHandler.sendEzspTransaction(transaction);
EzspGetNetworkParametersResponse getNetworkParametersResponse = (EzspGetNetworkParametersResponse) transaction.getResponse();
logger.debug(getNetworkParametersResponse.toString());
if (getNetworkParametersResponse.getStatus() != EmberStatus.EMBER_SUCCESS) {
logger.debug("Error during retrieval of network parameters: {}", getNetworkParametersResponse);
return null;
}
return getNetworkParametersResponse.getParameters();
}
Aggregations