use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetKeyRequest in project com.zsmartsystems.zigbee by zsmartsystems.
the class EmberNcp method getKey.
/**
* Gets a Security Key based on the passed key type.
*
* @param keyType the {@link EmberKeyType} of the key to get
* @return the {@link EmberKeyStruct} or null on error
*/
public EmberKeyStruct getKey(EmberKeyType keyType) {
EzspGetKeyRequest request = new EzspGetKeyRequest();
request.setKeyType(keyType);
EzspTransaction transaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(request, EzspGetKeyResponse.class));
EzspGetKeyResponse response = (EzspGetKeyResponse) transaction.getResponse();
logger.debug(response.toString());
lastStatus = response.getStatus();
if (lastStatus != EmberStatus.EMBER_SUCCESS) {
return null;
}
return response.getKeyStruct();
}
Aggregations