Search in sources :

Example 1 with EzspGetCurrentSecurityStateRequest

use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetCurrentSecurityStateRequest in project com.zsmartsystems.zigbee by zsmartsystems.

the class EmberNcp method getCurrentSecurityState.

/**
 * Gets the current security state that is being used by a device that is joined in the network.
 *
 * @return the {@link EmberNetworkParameters} or null on error
 */
public EmberCurrentSecurityState getCurrentSecurityState() {
    EzspGetCurrentSecurityStateRequest request = new EzspGetCurrentSecurityStateRequest();
    EzspSingleResponseTransaction transaction = new EzspSingleResponseTransaction(request, EzspGetCurrentSecurityStateResponse.class);
    ashHandler.sendEzspTransaction(transaction);
    EzspGetCurrentSecurityStateResponse response = (EzspGetCurrentSecurityStateResponse) transaction.getResponse();
    logger.debug(response.toString());
    lastStatus = response.getStatus();
    if (response.getStatus() != EmberStatus.EMBER_SUCCESS) {
        logger.debug("Error during retrieval of security parameters: {}", response);
        return null;
    }
    return response.getState();
}
Also used : EzspGetCurrentSecurityStateResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetCurrentSecurityStateResponse) EzspGetCurrentSecurityStateRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetCurrentSecurityStateRequest) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)

Aggregations

EzspGetCurrentSecurityStateRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetCurrentSecurityStateRequest)1 EzspGetCurrentSecurityStateResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetCurrentSecurityStateResponse)1 EzspSingleResponseTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)1