Search in sources :

Example 1 with TransportConfigOption

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

the class ZigBeeDongleEzsp method updateTransportConfig.

@Override
public void updateTransportConfig(TransportConfig configuration) {
    for (TransportConfigOption option : configuration.getOptions()) {
        try {
            switch(option) {
                case CONCENTRATOR_CONFIG:
                    configuration.setResult(option, setConcentrator((ConcentratorConfig) configuration.getValue(option)));
                    break;
                case TRUST_CENTRE_LINK_KEY:
                case TRUST_CENTRE_JOIN_MODE:
                default:
                    configuration.setResult(option, TransportConfigResult.ERROR_UNSUPPORTED);
                    logger.debug("Unsupported configuration option \"{}\" in EZSP dongle", option);
                    break;
            }
        } catch (ClassCastException e) {
            configuration.setResult(option, TransportConfigResult.ERROR_INVALID_VALUE);
        }
    }
}
Also used : ConcentratorConfig(com.zsmartsystems.zigbee.transport.ConcentratorConfig) TransportConfigOption(com.zsmartsystems.zigbee.transport.TransportConfigOption)

Example 2 with TransportConfigOption

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

the class ZigBeeDongleTiCc2531 method updateTransportConfig.

@Override
public void updateTransportConfig(TransportConfig configuration) {
    for (TransportConfigOption option : configuration.getOptions()) {
        try {
            switch(option) {
                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 : TransportConfigOption(com.zsmartsystems.zigbee.transport.TransportConfigOption)

Example 3 with TransportConfigOption

use of com.zsmartsystems.zigbee.transport.TransportConfigOption 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)

Example 4 with TransportConfigOption

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

the class ZigBeeDongleConBee method updateTransportConfig.

@Override
public void updateTransportConfig(TransportConfig configuration) {
    for (TransportConfigOption option : configuration.getOptions()) {
        try {
            switch(option) {
                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 : TransportConfigOption(com.zsmartsystems.zigbee.transport.TransportConfigOption)

Example 5 with TransportConfigOption

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

the class ZigBeeDongleXBee 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:
                    // 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 XBee dongle", option);
                    break;
            }
        } catch (ClassCastException e) {
            configuration.setResult(option, TransportConfigResult.ERROR_INVALID_VALUE);
        }
    }
}
Also used : Collection(java.util.Collection) TransportConfigOption(com.zsmartsystems.zigbee.transport.TransportConfigOption)

Aggregations

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