Search in sources :

Example 6 with EzspVersionResponse

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

the class EzspSingleResponseTransactionTest method testResponseMatchFails.

@Test
public void testResponseMatchFails() {
    EzspVersionRequest version = new EzspVersionRequest();
    version.setSequenceNumber(4);
    version.setDesiredProtocolVersion(4);
    EzspTransaction versionTransaction = new EzspSingleResponseTransaction(version, EzspVersionResponse.class);
    EzspVersionResponse versionResponse = new EzspVersionResponse(getPacketData("03 80 00 04 02 00 58"));
    assertFalse(versionTransaction.isMatch(versionResponse));
    assertNull(versionTransaction.getResponse());
    assertNull(versionTransaction.getResponses());
}
Also used : EzspVersionRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionRequest) EzspTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction) EzspVersionResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionResponse) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction) EzspFrameTest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.EzspFrameTest) Test(org.junit.Test)

Example 7 with EzspVersionResponse

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

the class EmberNcp method getVersion.

/**
 * The command allows the Host to specify the desired EZSP version and must be sent before any other command. The
 * response provides information about the firmware running on the NCP.
 *
 * @param desiredVersion the requested version we support
 * @return the {@link EzspVersionResponse}
 */
public EzspVersionResponse getVersion(int desiredVersion) {
    EzspVersionRequest request = new EzspVersionRequest();
    request.setDesiredProtocolVersion(EzspFrame.getEzspVersion());
    EzspTransaction transaction = ashHandler.sendEzspTransaction(new EzspSingleResponseTransaction(request, EzspVersionResponse.class));
    EzspVersionResponse response = (EzspVersionResponse) transaction.getResponse();
    logger.debug(response.toString());
    lastStatus = null;
    return response;
}
Also used : EzspVersionRequest(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionRequest) EzspTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction) EzspVersionResponse(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionResponse) EzspSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)

Aggregations

EzspVersionResponse (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionResponse)7 Test (org.junit.Test)4 EzspVersionRequest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.command.EzspVersionRequest)3 EzspSingleResponseTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspSingleResponseTransaction)3 EzspTransaction (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.transaction.EzspTransaction)3 EzspFrameTest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.EzspFrameTest)2 EmberNcp (com.zsmartsystems.zigbee.dongle.ember.EmberNcp)1 AshFrameHandler (com.zsmartsystems.zigbee.dongle.ember.internal.ash.AshFrameHandler)1