gpt4 book ai didi

com.zsmartsystems.zigbee.security.ZigBeeKey.hasAddress()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 03:21:31 26 4
gpt4 key购买 nike

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

ZigBeeKey.hasAddress介绍

[英]Returns true if this key has an address associated with it
[中]如果此密钥有与其关联的地址,则返回true

代码示例

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

/**
 * Adds an installation key for the specified address. The {@link ZigBeeKey} should have an address associated with
 * it.
 *
 * @param key the install key as {@link ZigBeeKey} to be used. The key must contain a partner address.
 * @return {@link ZigBeeStatus} with the status of function
 */
public ZigBeeStatus setZigBeeInstallKey(final ZigBeeKey key) {
  if (!key.hasAddress()) {
    return ZigBeeStatus.INVALID_ARGUMENTS;
  }
  TransportConfig config = new TransportConfig(TransportConfigOption.INSTALL_KEY, key);
  transport.updateTransportConfig(config);
  return config.getResult(TransportConfigOption.INSTALL_KEY);
}

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

@Test
public void testAddress() {
  ZigBeeKey key = new ZigBeeKey("11223344556677889900AABBCCDDEEFF");
  assertFalse(key.hasAddress());
  assertNull(key.getAddress());
  key.setAddress(new IeeeAddress("1234567890ABCDE"));
  assertTrue(key.hasAddress());
  assertEquals(new IeeeAddress("1234567890ABCDE"), key.getAddress());
}

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