use of com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeTransaction in project com.zsmartsystems.zigbee by zsmartsystems.
the class ConBeeSingleResponseTransactionTest method testResponseMatches.
@Test
public void testResponseMatches() {
ConBeeDeviceStateRequest request = new ConBeeDeviceStateRequest();
ConBeeTransaction transaction = new ConBeeSingleResponseTransaction(request, ConBeeDeviceStateResponse.class);
ConBeeDeviceStateResponse response = new ConBeeDeviceStateResponse(new int[] { 0x07, 0x00, 0x00, 0x08, 0x00, 0xA2, 0x00, 0x00, 0x4F, 0xFF });
assertTrue(transaction.isMatch(response));
transaction.getRequest();
assertEquals(1, transaction.getResponses().size());
assertNotNull(transaction.getResponses());
assertEquals(transaction.getResponses().get(0), transaction.getResponse());
}
use of com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeTransaction in project com.zsmartsystems.zigbee by zsmartsystems.
the class ConBeeSingleResponseTransactionTest method testResponseMatchFails.
@Test
public void testResponseMatchFails() {
ConBeeDeviceStateRequest request = new ConBeeDeviceStateRequest();
ConBeeTransaction transaction = new ConBeeSingleResponseTransaction(request, ConBeeDeviceStateResponse.class);
ConBeeEnqueueSendDataResponse response = new ConBeeEnqueueSendDataResponse(new int[] { 0x12, 0x0D, 0x00, 0x09, 0x00, 0x02, 0x00, 0x22, 0x00, 0xB4, 0xFF });
assertFalse(transaction.isMatch(response));
assertNull(transaction.getResponse());
}
Aggregations