本文整理了Java中com.zsmartsystems.zigbee.ZigBeeChannel
类的一些代码示例,展示了ZigBeeChannel
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeChannel
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeChannel
类名称:ZigBeeChannel
[英]Provides a list of channel mask values used for channel scans.
The 868MHz frequency band has only one channel and is used in Europe with a data rate of 20kbps.
The 915MHz frequency band band has 10 channels ranging from channel-1 to channel-10. It delivers data rate of 40 Kbps and used in Americas. The 2.4GHz frequency band is used worldwide and has total of 16 channels from channel-11 to channel-26 delivering a data rate of 250kbps.
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Gets the channels in this channel mask
*
* return the {@link List} of {@link ZigBeeChannel}s in this mask
*/
public List<ZigBeeChannel> getChannels() {
List<ZigBeeChannel> channels = new ArrayList<ZigBeeChannel>();
for (int channelCnt = 0; channelCnt < 32; channelCnt++) {
if ((channelMask & 1 << channelCnt) == 0) {
continue;
}
ZigBeeChannel channel = ZigBeeChannel.create(channelCnt);
if (channel != ZigBeeChannel.UNKNOWN) {
channels.add(channel);
}
}
return channels;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public ZigBeeStatus setZigBeeChannel(ZigBeeChannel channel) {
return networkManager.setZigBeeChannel(channel.getChannel()) ? ZigBeeStatus.SUCCESS : ZigBeeStatus.FAILURE;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Tests of the specified channel number is included in the bitmask
*
* @param channel the {@link ZigBeeChannel} number
* @return true if the mask contains the channel
*/
public boolean containsChannel(ZigBeeChannel channel) {
return ((channelMask & channel.getMask()) != 0);
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testChannel() {
assertEquals(1 << 1, ZigBeeChannel.create(1).getMask());
assertEquals(ZigBeeChannel.CHANNEL_11, ZigBeeChannel.create(11));
assertEquals(1 << 11, ZigBeeChannel.create(11).getMask());
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
networkManager.setZigBeeLinkKey(linkKey);
networkManager.setZigBeeNetworkKey(networkKey);
networkManager.setZigBeeChannel(ZigBeeChannel.create(channelId));
networkManager.setZigBeePanId(panId);
networkManager.setZigBeeExtendedPanId(extendedPanId);
configuration.put(CONFIGURATION_EXTENDEDPANID, currentExtendedPanId.toString());
configuration.put(CONFIGURATION_CHANNEL, currentChannel.getChannel());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Lookup function based on the ZigBeeChannel channel number. Returns null
* if the channel does not exist.
*
* @param channel the channel to lookup
* @return enumeration value of the {@link ZigBeeChannel}.
*/
public static ZigBeeChannel create(int channel) {
if (codeMapping == null) {
initMapping();
}
if (codeMapping.get(channel) == null) {
return UNKNOWN;
}
return codeMapping.get(channel);
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
builder.append(epan.toString());
builder.append('>');
builder.append(channel.toString());
builder.append('>');
builder.append(networkKey.toString());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
ZigBeeChannel channel = ZigBeeChannel.valueOf(parameters[4]);
ZigBeeKey networkKey = parseKey(secondsSinceBackup, parameters[5], parameters[6], parameters[7], parameters[8]);
ZigBeeKey linkKey = parseKey(secondsSinceBackup, parameters[9], parameters[10], parameters[11], parameters[12]);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public ZigBeeChannel getZigBeeChannel() {
return ZigBeeChannel.create(networkManager.getCurrentChannel());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Adds a new channel to the channel mask
*
* @param channel {@link ZigBeeChannel} to add to the mask
*/
public void addChannel(ZigBeeChannel channel) {
channelMask |= channel.getMask();
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
networkManager.setZigBeeChannel(ZigBeeChannel.create(channel));
networkManager.setZigBeePanId(pan);
networkManager.setZigBeeExtendedPanId(extendedPan);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public ZigBeeChannel getZigBeeChannel() {
ConBeeReadParameterRequest readParameter = new ConBeeReadParameterRequest();
readParameter.setParameter(ConBeeNetworkParameter.CURRENT_CHANNEL);
ConBeeReadParameterResponse response = (ConBeeReadParameterResponse) conbeeHandler
.sendTransaction(new ConBeeSingleResponseTransaction(readParameter, ConBeeReadParameterResponse.class))
.getResponse();
return ZigBeeChannel.create((int) response.getValue());
}
内容来源于网络,如有侵权,请联系作者删除!