use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetChildDataResponse in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberConsoleNcpChildrenCommand method process.
@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out) throws IllegalArgumentException {
EmberNcp ncp = getEmberNcp(networkManager);
EzspGetParentChildParametersResponse childParameters = ncp.getChildParameters();
out.println("Ember NCP contains " + childParameters.getChildCount() + " children" + ((childParameters.getChildCount() == 0) ? "." : ":"));
for (int childId = 0; childId < childParameters.getChildCount(); childId++) {
EzspGetChildDataResponse child = ncp.getChildInformation(childId);
out.println(String.format("%2d %-10s %-10s %s", child.getChildId(), child.getStatus(), child.getChildType(), child.getChildEui64()));
}
}
use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetChildDataResponse in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberNcp method getChildInformation.
/**
* Returns information about a child of the local node.
*
* @param childId the ID of the child to get information on
* @return the {@link EzspGetChildDataResponse} of the requested childId or null on error
*/
public EzspGetChildDataResponse getChildInformation(int childId) {
EzspGetChildDataRequest request = new EzspGetChildDataRequest();
request.setIndex(childId);
EzspTransaction transaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(request, EzspGetChildDataResponse.class));
EzspGetChildDataResponse response = (EzspGetChildDataResponse) transaction.getResponse();
logger.debug(response.toString());
lastStatus = response.getStatus();
if (lastStatus != EmberStatus.EMBER_SUCCESS) {
return null;
}
return response;
}
Aggregations