gpt4 book ai didi

com.zsmartsystems.zigbee.ZigBeeBroadcastDestination类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:51:24 29 4
gpt4 key购买 nike

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

ZigBeeBroadcastDestination介绍

[英]Defines the broadcast destination addresses defined in the ZigBee protocol.

Broadcast transmissions shall not use the MAC sub-layer acknowledgement; instead, a passive acknowledgement mechanism may be used. Passive acknowledgement means that every ZigBee router and ZigBee coordinator keeps track of which of its neighboring devices have successfully relayed the broadcast transmission. The MAC sub-layer acknowledgement is disabled by setting the acknowledged transmission flag of the TxOptions parameter to FALSE. All other flags of the TxOptions parameter shall be set based on the network configuration
[中]定义ZigBee协议中定义的广播目标地址。
广播传输不得使用MAC子层确认;相反,可以使用被动确认机制。被动确认意味着每个ZigBee路由器和ZigBee协调器都会跟踪其相邻设备中的哪些设备已成功中继广播传输。通过将TxOptions参数的已确认传输标志设置为FALSE,可以禁用MAC子层确认。TxOptions参数的所有其他标志应根据网络配置进行设置

代码示例

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

/**
   * Tests the supplied address to determine if it is a broadcast address
   *
   * @param address the address to test
   * @return true if the address is in the broadcast address range
   */
  public static boolean isBroadcast(int address) {
    return (address >= BROADCAST_RESERVED_FFF8.getKey() && address <= BROADCAST_ALL_DEVICES.getKey());
  }
}

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

/**
 * Lookup function based on the broadcast address. Returns null if the address does not exist.
 *
 * @param address the address to lookup
 * @return enumeration value of the broadcast address.
 */
public static ZigBeeBroadcastDestination getBroadcastDestination(int address) {
  if (codeMapping == null) {
    initMapping();
  }
  return codeMapping.get(address);
}

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

private static void initMapping() {
  codeMapping = new HashMap<Integer, ZigBeeBroadcastDestination>();
  for (ZigBeeBroadcastDestination s : values()) {
    codeMapping.put(s.key, s);
  }
}

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

@Test
  public void getDestination() {
    ZigBeeBroadcastDestination destination = ZigBeeBroadcastDestination.getBroadcastDestination(0);
    assertEquals(null, destination);

    destination = ZigBeeBroadcastDestination.getBroadcastDestination(0xFFFC);
    assertEquals(ZigBeeBroadcastDestination.BROADCAST_ROUTERS_AND_COORD, destination);

    destination = ZigBeeBroadcastDestination.getBroadcastDestination(0xFFFB);
    assertEquals(ZigBeeBroadcastDestination.BROADCAST_LOW_POWER_ROUTERS, destination);

    assertEquals(0xFFFF, ZigBeeBroadcastDestination.BROADCAST_ALL_DEVICES.getKey());

    assertTrue(ZigBeeBroadcastDestination.isBroadcast(0xfff8));
    assertTrue(ZigBeeBroadcastDestination.isBroadcast(0xffff));
    assertFalse(ZigBeeBroadcastDestination.isBroadcast(0xfff7));
    assertFalse(ZigBeeBroadcastDestination.isBroadcast(0x10000));
  }
}

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

if (ZigBeeBroadcastDestination.getBroadcastDestination(destination.getAddress()) != null) {
  command = new ManagementPermitJoiningRequest();
  command.setPermitDuration(duration);

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

/**
 * Enables or disables devices to join the whole network.
 * <p>
 * Devices can only join the network when joining is enabled. It is not advised to leave joining enabled permanently
 * since it allows devices to join the network without the installer knowing.
 *
 * @param duration sets the duration of the join enable. Setting this to 0 disables joining. As per ZigBee 3, a
 *            value of 255 is not permitted and will be ignored.
 * @return {@link ZigBeeStatus} with the status of function
 */
public ZigBeeStatus permitJoin(final int duration) {
  return permitJoin(new ZigBeeEndpointAddress(ZigBeeBroadcastDestination.BROADCAST_ROUTERS_AND_COORD.getKey()),
      duration);
}

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

request.setStartIndex(0);
request.setDestinationAddress(
    new ZigBeeEndpointAddress(ZigBeeBroadcastDestination.BROADCAST_RX_ON.getKey()));
CommandResult response;
response = networkManager.sendTransaction(request, request).get();

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

/**
 * Get node descriptor
 *
 * @return true if the message was processed ok
 * @throws ExecutionException
 * @throws InterruptedException
 */
private boolean requestNetworkAddress() throws InterruptedException, ExecutionException {
  NetworkAddressRequest networkAddressRequest = new NetworkAddressRequest();
  networkAddressRequest.setIeeeAddr(node.getIeeeAddress());
  networkAddressRequest.setRequestType(0);
  networkAddressRequest.setStartIndex(0);
  networkAddressRequest.setDestinationAddress(
      new ZigBeeEndpointAddress(ZigBeeBroadcastDestination.BROADCAST_ALL_DEVICES.getKey()));
  CommandResult response = networkManager.sendTransaction(networkAddressRequest, networkAddressRequest).get();
  final NetworkAddressResponse networkAddressResponse = (NetworkAddressResponse) response.getResponse();
  logger.debug("{}: Node SVC Discovery: NetworkAddressRequest returned {}", node.getNetworkAddress(),
      networkAddressResponse);
  if (networkAddressResponse == null) {
    return false;
  }
  if (networkAddressResponse.getStatus() == ZdoStatus.SUCCESS) {
    node.setNetworkAddress(networkAddressResponse.getNwkAddrRemoteDev());
    return true;
  }
  return false;
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com