gpt4 book ai didi

com.zsmartsystems.zigbee.dongle.cc2531.ZigBeeDongleTiCc2531类的使用及代码示例

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

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

  • #setMagicNumber(int) to set the bootloader exit sequence
    [中]用于CC2531处理器的ZigBee Dongle TI实现。
    实现ZigBeetTransportTransmit接口,并提供以下特定于加密狗的方法来配置加密狗-:
    *#setMagicNumber(int)设置引导加载程序退出顺序

代码示例

代码示例来源: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()));
    }
  }
}

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