com.zsmartsystems.zigbee.zdo.ZdoCommandType.getClusterId()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中com.zsmartsystems.zigbee.zdo.ZdoCommandType.getClusterId()方法的一些代码示例,展示了ZdoCommandType.getClusterId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZdoCommandType.getClusterId()方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zdo.ZdoCommandType
类名称:ZdoCommandType
方法名:getClusterId

ZdoCommandType.getClusterId介绍

暂无

代码示例

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.MANAGEMENT_LEAVE_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.ACTIVE_ENDPOINTS_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.MANAGEMENT_ROUTING_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.SIMPLE_DESCRIPTOR_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.MANAGEMENT_LQI_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
  ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
  apsFrame.setCluster(ZdoCommandType.DEVICE_ANNOUNCE.getClusterId());
  apsFrame.setDestinationEndpoint(0);
  apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
  apsFrame.setSourceEndpoint(0);
  apsFrame.setProfile(0);
  apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));
  return apsFrame;
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.POWER_DESCRIPTOR_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.NODE_DESCRIPTOR_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.IEEE_ADDRESS_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[13] + (packet.getPacket()[14] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    int temp[] = Arrays.copyOfRange(packet.getPacket(), 3, packet.getPacket().length - 1);
    int a = temp[12];
    temp[12] = temp[13];
    temp[13] = a;
    temp[0] = 0;
    apsFrame.setPayload(temp);

    return apsFrame;
  }
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

@Test
public void testNormal() {
  // Add all the required responses to a list
  IeeeAddressResponse ieeeResponse = new IeeeAddressResponse();
  ieeeResponse.setStatus(ZdoStatus.SUCCESS);
  ieeeResponse.setSourceAddress(new ZigBeeEndpointAddress(0));
  ieeeResponse.setDestinationAddress(new ZigBeeEndpointAddress(0));
  ieeeResponse.setIeeeAddrRemoteDev(new IeeeAddress("1234567890ABCDEF"));
  responses.put(ZdoCommandType.IEEE_ADDRESS_REQUEST.getClusterId(), ieeeResponse);
  ZigBeeNetworkDiscoverer discoverer = new ZigBeeNetworkDiscoverer(networkManager);
  discoverer.setRetryPeriod(1);
  discoverer.startup();
  // Check it registers listeners
  Mockito.verify(networkManager).addCommandListener(discoverer);
  Mockito.verify(networkManager).addAnnounceListener(discoverer);
  // Then wait for the node to be added
  Mockito.verify(networkManager, Mockito.timeout(TIMEOUT).times(1)).addNode(nodeCapture.capture());
  ZigBeeNode node = nodeCapture.getValue();
  assertNotNull(node);
  assertEquals(Integer.valueOf(0), node.getNetworkAddress());
  assertEquals(new IeeeAddress("1234567890ABCDEF"), node.getIeeeAddress());
  assertEquals(0, node.getEndpoints().size());
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

nwkResponse.setDestinationAddress(new ZigBeeEndpointAddress(0));
nwkResponse.setNwkAddrRemoteDev(123);
responses.put(ZdoCommandType.NETWORK_ADDRESS_REQUEST.getClusterId(), nwkResponse);
ieeeResponse.setDestinationAddress(new ZigBeeEndpointAddress(0));
ieeeResponse.setIeeeAddrRemoteDev(new IeeeAddress("1234567890ABCDEF"));
responses.put(ZdoCommandType.IEEE_ADDRESS_REQUEST.getClusterId(), ieeeResponse);
NodeDescriptor nodeDescriptor = new NodeDescriptor();
nodeResponse.setNodeDescriptor(nodeDescriptor);
responses.put(ZdoCommandType.NODE_DESCRIPTOR_REQUEST.getClusterId(), nodeResponse);
PowerDescriptor powerDescriptor = new PowerDescriptor();
powerResponse.setPowerDescriptor(powerDescriptor);
responses.put(ZdoCommandType.POWER_DESCRIPTOR_REQUEST.getClusterId(), powerResponse);
activeEpList.add(1);
endpointsResponse.setActiveEpList(activeEpList);
responses.put(ZdoCommandType.ACTIVE_ENDPOINTS_REQUEST.getClusterId(), endpointsResponse);
simpleDescriptor.setOutputClusterList(outputClusterList);
simpleResponse.setSimpleDescriptor(simpleDescriptor);
responses.put(ZdoCommandType.SIMPLE_DESCRIPTOR_REQUEST.getClusterId(), simpleResponse);
lqiRequest.setNeighborTableEntries(0);
lqiRequest.setNeighborTableList(new ArrayList<NeighborTable>());
responses.put(ZdoCommandType.MANAGEMENT_LQI_REQUEST.getClusterId(), lqiRequest);
routingResponse.setRoutingTableList(new ArrayList<RoutingTable>());

相关文章

ZdoCommandType类方法