Search in sources :

Example 1 with EzspGetKeyTableEntryResponse

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

the class EmberNcp method getKeyTableEntry.

/**
 * Gets a Security Key based on the passed key type.
 *
 * @param index the index of the key to get
 * @return the {@link EmberKeyStruct} of the requested key or null on error
 */
public EmberKeyStruct getKeyTableEntry(int index) {
    EzspGetKeyTableEntryRequest request = new EzspGetKeyTableEntryRequest();
    request.setIndex(index);
    EzspTransaction transaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(request, EzspGetKeyTableEntryResponse.class));
    EzspGetKeyTableEntryResponse response = (EzspGetKeyTableEntryResponse) transaction.getResponse();
    logger.debug(response.toString());
    lastStatus = response.getStatus();
    if (lastStatus != EmberStatus.EMBER_SUCCESS) {
        return null;
    }
    return response.getKeyStruct();
}
Also used : EzspGetKeyTableEntryRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetKeyTableEntryRequest) EzspTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction) EzspGetKeyTableEntryResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetKeyTableEntryResponse)

Aggregations

EzspGetKeyTableEntryRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetKeyTableEntryRequest)1 EzspGetKeyTableEntryResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetKeyTableEntryResponse)1 EzspSingleResponseTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)1 EzspTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction)1