Search in sources :

Example 6 with EmberNcp

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;
}
Also used : EmberNcp(com.zsmartsystems.zigbee.dongle.ember.EmberNcp) EzspDecisionId(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EzspDecisionId) EzspPolicyId(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EzspPolicyId)

Example 7 with EmberNcp

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());
}
Also used : EmberNcp(com.zsmartsystems.zigbee.dongle.ember.EmberNcp) EmberNetworkParameters(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberNetworkParameters)

Example 8 with EmberNcp

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);
}
Also used : EmberNcp(com.zsmartsystems.zigbee.dongle.ember.EmberNcp) EmberNetworkStatus(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberNetworkStatus)

Example 9 with EmberNcp

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());
}
Also used : EmberNcp(com.zsmartsystems.zigbee.dongle.ember.EmberNcp) EzspVersionResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionResponse)

Example 10 with EmberNcp

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;
}
Also used : EmberNcp(com.zsmartsystems.zigbee.dongle.ember.EmberNcp) HashMap(java.util.HashMap) EzspConfigId(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EzspConfigId)

Aggregations

EmberNcp (com.zsmartsystems.zigbee.dongle.ember.EmberNcp)10 EzspDecisionId (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EzspDecisionId)3 EzspConfigId (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EzspConfigId)2 EzspPolicyId (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EzspPolicyId)2 HashMap (java.util.HashMap)2 EzspGetChildDataResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetChildDataResponse)1 EzspGetParentChildParametersResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetParentChildParametersResponse)1 EzspVersionResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionResponse)1 EmberCurrentSecurityBitmask (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberCurrentSecurityBitmask)1 EmberCurrentSecurityState (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberCurrentSecurityState)1 EmberKeyStruct (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberKeyStruct)1 EmberNetworkParameters (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberNetworkParameters)1 EmberNetworkStatus (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberNetworkStatus)1 ArrayList (java.util.ArrayList)1