Search in sources :

Example 1 with BindResponse

use of com.zsmartsystems.zigbee.zdo.command.BindResponse in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZdoResponseMatcherTest method testMatch.

@Test
public void testMatch() {
    ZdoTransactionMatcher matcher = new ZdoTransactionMatcher();
    ZdoRequest zdoCommand = new BindRequest();
    BindResponse zdoResponse = new BindResponse();
    zdoCommand.setDestinationAddress(new ZigBeeEndpointAddress(1234));
    zdoResponse.setSourceAddress(new ZigBeeEndpointAddress(1234));
    assertTrue(matcher.isTransactionMatch(zdoCommand, zdoResponse));
    zdoResponse.setSourceAddress(new ZigBeeEndpointAddress(5678));
    assertFalse(matcher.isTransactionMatch(zdoCommand, zdoResponse));
    ZclCommand zclResponse = new OffCommand();
    assertFalse(matcher.isTransactionMatch(zdoCommand, zclResponse));
}
Also used : ZigBeeEndpointAddress(com.zsmartsystems.zigbee.ZigBeeEndpointAddress) BindRequest(com.zsmartsystems.zigbee.zdo.command.BindRequest) OffCommand(com.zsmartsystems.zigbee.zcl.clusters.onoff.OffCommand) BindResponse(com.zsmartsystems.zigbee.zdo.command.BindResponse) ZclCommand(com.zsmartsystems.zigbee.zcl.ZclCommand) Test(org.junit.Test)

Aggregations

ZigBeeEndpointAddress (com.zsmartsystems.zigbee.ZigBeeEndpointAddress)1 ZclCommand (com.zsmartsystems.zigbee.zcl.ZclCommand)1 OffCommand (com.zsmartsystems.zigbee.zcl.clusters.onoff.OffCommand)1 BindRequest (com.zsmartsystems.zigbee.zdo.command.BindRequest)1 BindResponse (com.zsmartsystems.zigbee.zdo.command.BindResponse)1 Test (org.junit.Test)1