Search in sources :

Example 6 with MatchDescriptorRequest

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

the class ClusterMatcherTest method testMatcherMatchInOut.

@Test
public void testMatcherMatchInOut() {
    ClusterMatcher matcher = getMatcher();
    matcher.addCluster(0x500);
    matcher.addCluster(0x600);
    List<Integer> clusterListIn = new ArrayList<Integer>();
    List<Integer> clusterListOut = new ArrayList<Integer>();
    clusterListIn.add(0x500);
    clusterListOut.add(0x500);
    MatchDescriptorRequest request = new MatchDescriptorRequest();
    request.setSourceAddress(new ZigBeeEndpointAddress(1234, 5));
    request.setProfileId(0x104);
    request.setInClusterList(clusterListIn);
    request.setOutClusterList(clusterListOut);
    matcher.commandReceived(request);
    assertEquals(1, mockedCommandCaptor.getAllValues().size());
}
Also used : ZigBeeEndpointAddress(com.zsmartsystems.zigbee.ZigBeeEndpointAddress) ArrayList(java.util.ArrayList) MatchDescriptorRequest(com.zsmartsystems.zigbee.zdo.command.MatchDescriptorRequest) Test(org.junit.Test)

Aggregations

MatchDescriptorRequest (com.zsmartsystems.zigbee.zdo.command.MatchDescriptorRequest)6 ArrayList (java.util.ArrayList)6 ZigBeeEndpointAddress (com.zsmartsystems.zigbee.ZigBeeEndpointAddress)4 Test (org.junit.Test)4 MatchDescriptorResponse (com.zsmartsystems.zigbee.zdo.command.MatchDescriptorResponse)2 ZclCommand (com.zsmartsystems.zigbee.zcl.ZclCommand)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1