use of com.zsmartsystems.zigbee.dongle.ember.EmberNcp in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberStackConfiguration method setPolicy.
/**
* Configuration utility. Takes a {@link Map} of {@link EzspConfigId} to {@link EzspDecisionId} and will work
* through setting them before returning.
*
* @param policies {@link Map} of {@link EzspPolicyId} to {@link EzspDecisionId} with configuration to set
* @return true if all policies were set successfully
*/
public boolean setPolicy(Map<EzspPolicyId, EzspDecisionId> policies) {
boolean success = true;
EmberNcp ncp = new EmberNcp(ashHandler);
for (Entry<EzspPolicyId, EzspDecisionId> policy : policies.entrySet()) {
if (!ncp.setPolicy(policy.getKey(), policy.getValue())) {
success = false;
}
}
return success;
}
use of com.zsmartsystems.zigbee.dongle.ember.EmberNcp in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberConsoleNetworkStateCommand method process.
@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out) throws IllegalArgumentException {
EmberNcp ncp = getEmberNcp(networkManager);
EmberNetworkParameters networkState = ncp.getNetworkParameters();
out.println("PAN ID : " + networkState.getPanId());
out.println("Extended PAN ID: " + networkState.getExtendedPanId());
out.println("Radio Channel : " + networkState.getRadioChannel());
out.println("Transmit Power : " + networkState.getRadioTxPower());
out.println("Join Method : " + networkState.getJoinMethod());
out.println("Network Manager: " + networkState.getNwkManagerId());
}
use of com.zsmartsystems.zigbee.dongle.ember.EmberNcp in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberConsoleNcpStateCommand method process.
@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out) throws IllegalArgumentException {
EmberNcp ncp = getEmberNcp(networkManager);
EmberNetworkStatus status = ncp.getNetworkState();
out.println("Ember NCP state is " + status);
}
use of com.zsmartsystems.zigbee.dongle.ember.EmberNcp in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberConsoleNcpVersionCommand method process.
@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out) throws IllegalArgumentException {
EmberNcp ncp = getEmberNcp(networkManager);
EzspVersionResponse version = ncp.getVersion(0);
out.println("Ember NCP version " + getVersionString(version.getStackVersion()) + ", EZSP version " + EzspFrame.getEzspVersion());
}
use of com.zsmartsystems.zigbee.dongle.ember.EmberNcp in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberStackConfiguration method getConfiguration.
/**
* Configuration utility. Takes a {@link Set} of {@link EzspConfigId} and will work through
* requesting them before returning.
*
* @param configuration {@link Set} of {@link EzspConfigId} to request
* @return map of configuration data mapping {@link EzspConfigId} to {@link Integer}. Value will be null if error
* occurred.
*/
public Map<EzspConfigId, Integer> getConfiguration(Set<EzspConfigId> configuration) {
Map<EzspConfigId, Integer> response = new HashMap<EzspConfigId, Integer>();
EmberNcp ncp = new EmberNcp(ashHandler);
for (EzspConfigId configId : configuration) {
response.put(configId, ncp.getConfiguration(configId));
}
return response;
}
Aggregations