本文整理了Java中com.zsmartsystems.zigbee.dongle.cc2531.ZigBeeDongleTiCc2531
类的一些代码示例,展示了ZigBeeDongleTiCc2531
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeDongleTiCc2531
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.dongle.cc2531.ZigBeeDongleTiCc2531
类名称:ZigBeeDongleTiCc2531
[英]ZigBee Dongle TI implementation for the CC2531 processor.
Implements the ZigBeeTransportTransmit interface and provides the following dongle specific methods for configuring the dongle -:
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
dongle = new ZigBeeDongleTiCc2531(serialPort);
transportOptions.addOption(TransportConfigOption.RADIO_TX_POWER, 3);
} else if (dongleName.toUpperCase().equals("EMBER")) {
tiDongle.setLedMode(1, false);
tiDongle.setLedMode(2, false);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public ZigBeeStatus startup(boolean reinitialize) {
logger.debug("CC2531 transport startup");
// Add listeners for ZCL and ZDO received messages
networkManager.addAFMessageListener(this);
networkManager.addAsynchronousCommandListener(this);
if (!networkManager.initializeZigBeeNetwork(reinitialize)) {
return ZigBeeStatus.INVALID_STATE;
}
while (true) {
if (networkManager.getDriverStatus() == DriverStatus.NETWORK_READY) {
break;
}
if (networkManager.getDriverStatus() == DriverStatus.CLOSED) {
return ZigBeeStatus.BAD_RESPONSE;
}
try {
Thread.sleep(50);
} catch (final InterruptedException e) {
return ZigBeeStatus.BAD_RESPONSE;
}
}
createEndPoint(1, 0x104);
return ZigBeeStatus.SUCCESS;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@SuppressWarnings("unchecked")
@Override
public void updateTransportConfig(TransportConfig configuration) {
for (TransportConfigOption option : configuration.getOptions()) {
try {
switch (option) {
case SUPPORTED_INPUT_CLUSTERS:
configuration.setResult(option, setSupportedInputClusters(
new ArrayList<Integer>((Collection<Integer>) configuration.getValue(option))));
break;
case SUPPORTED_OUTPUT_CLUSTERS:
configuration.setResult(option, setSupportedOutputClusters(
new ArrayList<Integer>((Collection<Integer>) configuration.getValue(option))));
break;
case RADIO_TX_POWER:
configuration.setResult(option,
networkManager.setTxPower((int) configuration.getValue(option)));
break;
default:
configuration.setResult(option, ZigBeeStatus.UNSUPPORTED);
logger.debug("Unsupported configuration option \"{}\" in CC2531 dongle", option);
break;
}
} catch (ClassCastException e) {
configuration.setResult(option, ZigBeeStatus.INVALID_ARGUMENTS);
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public boolean notify(final AF_INCOMING_MSG clusterMessage) {
ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
apsFrame.setCluster(clusterMessage.getClusterId());
apsFrame.setDestinationEndpoint(clusterMessage.getDstEndpoint());
apsFrame.setSourceEndpoint(clusterMessage.getSrcEndpoint());
apsFrame.setProfile(getEndpointProfile(clusterMessage.getDstEndpoint()));
// nwkHeader.setDestinationAddress(clusterMessage.geta);
apsFrame.setSourceAddress(clusterMessage.getSrcAddr());
apsFrame.setApsCounter(clusterMessage.getTransId());
apsFrame.setPayload(clusterMessage.getData());
zigbeeNetworkReceive.receiveCommand(apsFrame);
return true;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void sendCommand(final ZigBeeApsFrame apsFrame) {
synchronized (networkManager) {
final short sender;
if (apsFrame.getProfile() == 0) {
sender = 0;
} else {
sender = (short) getSendingEndpoint(apsFrame.getProfile());
}
// TODO: How to differentiate group and device addressing?????
boolean groupCommand = false;
if (!groupCommand) {
networkManager.sendCommand(new AF_DATA_REQUEST(apsFrame.getDestinationAddress(),
(short) apsFrame.getDestinationEndpoint(), sender, apsFrame.getCluster(),
apsFrame.getApsCounter(), (byte) 0x30, (byte) apsFrame.getRadius(), apsFrame.getPayload()));
} else {
networkManager.sendCommand(new AF_DATA_REQUEST_EXT(apsFrame.getDestinationAddress(), sender,
apsFrame.getCluster(), apsFrame.getApsCounter(), (byte) (0), (byte) 0, apsFrame.getPayload()));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!