Search in sources :

Example 26 with EzspSingleResponseTransaction

use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction in project com.zsmartsystems.zigbee by zsmartsystems.

the class EmberNetworkInitialisation method doLeaveNetwork.

private boolean doLeaveNetwork() {
    EzspLeaveNetworkRequest leaveNetworkRequest = new EzspLeaveNetworkRequest();
    EzspTransaction leaveNetworkTransaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(leaveNetworkRequest, EzspLeaveNetworkResponse.class));
    EzspLeaveNetworkResponse leaveNetworkResponse = (EzspLeaveNetworkResponse) leaveNetworkTransaction.getResponse();
    logger.debug(leaveNetworkResponse.toString());
    return leaveNetworkResponse.getStatus() == EmberStatus.EMBER_SUCCESS;
}
Also used : EzspLeaveNetworkRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspLeaveNetworkRequest) EzspLeaveNetworkResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspLeaveNetworkResponse) EzspTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)

Example 27 with EzspSingleResponseTransaction

use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction in project com.zsmartsystems.zigbee by zsmartsystems.

the class EmberNetworkInitialisation method getNetworkParameters.

/**
 * Get the current network parameters
 *
 * @return the {@link EmberNetworkParameters} or null on error
 */
private EmberNetworkParameters getNetworkParameters() {
    EzspGetNetworkParametersRequest networkParms = new EzspGetNetworkParametersRequest();
    EzspSingleResponseTransaction transaction = new EzspSingleResponseTransaction(networkParms, EzspGetNetworkParametersResponse.class);
    ashHandler.sendEzspTransaction(transaction);
    EzspGetNetworkParametersResponse getNetworkParametersResponse = (EzspGetNetworkParametersResponse) transaction.getResponse();
    logger.debug(getNetworkParametersResponse.toString());
    if (getNetworkParametersResponse.getStatus() != EmberStatus.EMBER_SUCCESS) {
        logger.debug("Error during retrieval of network parameters: {}", getNetworkParametersResponse);
        return null;
    }
    return getNetworkParametersResponse.getParameters();
}
Also used : EzspGetNetworkParametersRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetNetworkParametersRequest) EzspGetNetworkParametersResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetNetworkParametersResponse) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)

Example 28 with EzspSingleResponseTransaction

use of com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction in project com.zsmartsystems.zigbee by zsmartsystems.

the class EzspNeighborTable method getRoute.

private void getRoute(int route) {
    EzspGetRouteTableEntryRequest routeRequest = new EzspGetRouteTableEntryRequest();
    routeRequest.setIndex(route);
    EzspTransaction neighborTransaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(routeRequest, EzspGetRouteTableEntryResponse.class));
    EzspGetRouteTableEntryResponse routeResponse = (EzspGetRouteTableEntryResponse) neighborTransaction.getResponse();
    logger.debug(routeResponse.toString());
    logger.debug("EZSP getRouteTableEntry {}", routeResponse);
}
Also used : EzspGetRouteTableEntryRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetRouteTableEntryRequest) EzspTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction) EzspGetRouteTableEntryResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetRouteTableEntryResponse) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)

Aggregations

EzspSingleResponseTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)28 EzspTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction)21 EzspVersionRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionRequest)3 EzspVersionResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionResponse)3 EzspFrameTest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.EzspFrameTest)2 EzspGetConfigurationValueRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueRequest)2 EzspGetConfigurationValueResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetConfigurationValueResponse)2 EzspGetNetworkParametersRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetNetworkParametersRequest)2 EzspGetNetworkParametersResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspGetNetworkParametersResponse)2 EzspNetworkStateRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspNetworkStateRequest)2 EzspNetworkStateResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspNetworkStateResponse)2 EmberNetworkParameters (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberNetworkParameters)2 Test (org.junit.Test)2 IeeeAddress (com.zsmartsystems.zigbee.IeeeAddress)1 EmberFirmwareUpdateHandler (com.zsmartsystems.zigbee.dongle.ember.internal.EmberFirmwareUpdateHandler)1 EmberStackConfiguration (com.zsmartsystems.zigbee.dongle.ember.internal.EmberStackConfiguration)1 EzspAddEndpointRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspAddEndpointRequest)1 EzspAddEndpointResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspAddEndpointResponse)1 EzspFormNetworkRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspFormNetworkRequest)1 EzspFormNetworkResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspFormNetworkResponse)1