Search in sources :

Example 1 with ConBeeEnqueueSendDataResponse

use of com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeEnqueueSendDataResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class ConBeeEnqueueSendDataResponseTest method doRequest.

@Test
public void doRequest() {
    ConBeeEnqueueSendDataResponse response = new ConBeeEnqueueSendDataResponse(new int[] { 0x12, 0x0D, 0x00, 0x09, 0x00, 0x02, 0x00, 0x22, 0x00, 0xB4, 0xFF });
    System.out.print(response);
    assertEquals(13, response.getSequence());
    assertEquals(ConBeeStatus.SUCCESS, response.getStatus());
    assertEquals(ConBeeNetworkState.NET_CONNECTED, response.getDeviceState().getNetworkState());
    assertFalse(response.getDeviceState().isDataConfirm());
    assertFalse(response.getDeviceState().isDataIndication());
    assertFalse(response.getDeviceState().isDataRequest());
    assertFalse(response.getDeviceState().isConfigChanged());
}
Also used : ConBeeEnqueueSendDataResponse(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeEnqueueSendDataResponse) Test(org.junit.Test)

Example 2 with ConBeeEnqueueSendDataResponse

use of com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeEnqueueSendDataResponse 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());
}
Also used : ConBeeSingleResponseTransaction(com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeSingleResponseTransaction) ConBeeDeviceStateRequest(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeDeviceStateRequest) ConBeeTransaction(com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeTransaction) ConBeeEnqueueSendDataResponse(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeEnqueueSendDataResponse) Test(org.junit.Test)

Example 3 with ConBeeEnqueueSendDataResponse

use of com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeEnqueueSendDataResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class ConBeeFrameTest method testCreateEnqueueSendDataResponse.

@Test
public void testCreateEnqueueSendDataResponse() {
    ConBeeFrame frame = ConBeeFrame.create(new int[] { 0x12, 0x0D, 0x00, 0x09, 0x00, 0x02, 0x00, 0x22, 0x00, 0xB4, 0xFF });
    System.out.println(frame);
    assertNotNull(frame);
    assertTrue(frame instanceof ConBeeEnqueueSendDataResponse);
    assertEquals(13, frame.getSequence());
}
Also used : ConBeeEnqueueSendDataResponse(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeEnqueueSendDataResponse) ConBeeFrame(com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeFrame) Test(org.junit.Test)

Aggregations

ConBeeEnqueueSendDataResponse (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeEnqueueSendDataResponse)3 Test (org.junit.Test)3 ConBeeDeviceStateRequest (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeDeviceStateRequest)1 ConBeeFrame (com.zsmartsystems.zigbee.dongle.conbee.internal.frame.ConBeeFrame)1 ConBeeSingleResponseTransaction (com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeSingleResponseTransaction)1 ConBeeTransaction (com.zsmartsystems.zigbee.dongle.conbee.internal.transaction.ConBeeTransaction)1