本文整理了Java中com.zsmartsystems.zigbee.security.ZigBeeKey.hasAddress()
方法的一些代码示例,展示了ZigBeeKey.hasAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeKey.hasAddress()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.security.ZigBeeKey
类名称: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());
}
内容来源于网络,如有侵权,请联系作者删除!