Search in sources :

Example 1 with TrustCentreJoinMode

use of com.zsmartsystems.zigbee.transport.TrustCentreJoinMode in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeDongleTelegesis method updateTransportConfig.

@SuppressWarnings("unchecked")
@Override
public void updateTransportConfig(TransportConfig configuration) {
    for (TransportConfigOption option : configuration.getOptions()) {
        try {
            switch(option) {
                case SUPPORTED_INPUT_CLUSTERS:
                    configuration.setResult(option, setSupportedInputClusters((Collection<Integer>) configuration.getValue(option)));
                    break;
                case SUPPORTED_OUTPUT_CLUSTERS:
                    configuration.setResult(option, setSupportedOutputClusters((Collection<Integer>) configuration.getValue(option)));
                    break;
                case TRUST_CENTRE_JOIN_MODE:
                    configuration.setResult(option, setTcJoinMode((TrustCentreJoinMode) configuration.getValue(option)));
                    break;
                case TRUST_CENTRE_LINK_KEY:
                    configuration.setResult(option, setTcLinkKey((ZigBeeKey) configuration.getValue(option)) ? TransportConfigResult.SUCCESS : TransportConfigResult.FAILURE);
                    break;
                default:
                    configuration.setResult(option, TransportConfigResult.ERROR_UNSUPPORTED);
                    logger.debug("Unsupported configuration option \"{}\" in Telegesis dongle", option);
                    break;
            }
        } catch (ClassCastException e) {
            configuration.setResult(option, TransportConfigResult.ERROR_INVALID_VALUE);
        }
    }
}
Also used : TrustCentreJoinMode(com.zsmartsystems.zigbee.transport.TrustCentreJoinMode) Collection(java.util.Collection) TransportConfigOption(com.zsmartsystems.zigbee.transport.TransportConfigOption)

Aggregations

TransportConfigOption (com.zsmartsystems.zigbee.transport.TransportConfigOption)1 TrustCentreJoinMode (com.zsmartsystems.zigbee.transport.TrustCentreJoinMode)1 Collection (java.util.Collection)1