gpt4 book ai didi

com.zsmartsystems.zigbee.ZigBeeApsFrame.setApsCounter()方法的使用及代码示例

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

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

ZigBeeApsFrame.setApsCounter介绍

暂无

代码示例

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

break;
case "apsCounter":
  apsFrame.setApsCounter(Integer.parseInt(key[1], 16));
  break;
case "payload":

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(packet.getPacket()[7] + (packet.getPacket()[8] << 8));
    apsFrame.setDestinationAddress(packet.getPacket()[11] + (packet.getPacket()[12] << 8));
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setApsCounter(packet.getPacket()[10]);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 12, packet.getPacket().length - 1));

    return apsFrame;
  }
}

代码示例来源: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

apsFrame.setApsCounter(apsCounter.getAndIncrement() & 0xff);
apsFrame.setSecurityEnabled(command.getApsSecurity());

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

@Test
public void testReceiveZclCommand() {
  ZigBeeNetworkManager networkManager = mockZigBeeNetworkManager();
  networkManager.setSerializer(DefaultSerializer.class, DefaultDeserializer.class);
  ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
  apsFrame.setSourceAddress(1234);
  apsFrame.setDestinationAddress(0);
  apsFrame.setApsCounter(1);
  apsFrame.setCluster(6);
  apsFrame.setDestinationEndpoint(2);
  apsFrame.setProfile(0x104);
  apsFrame.setSourceEndpoint(5);
  ZclHeader zclHeader = new ZclHeader();
  zclHeader.setCommandId(0);
  zclHeader.setFrameType(ZclFrameType.ENTIRE_PROFILE_COMMAND);
  zclHeader.setSequenceNumber(1);
  DefaultSerializer serializer = new DefaultSerializer();
  ZclFieldSerializer fieldSerializer = new ZclFieldSerializer(serializer);
  apsFrame.setPayload(zclHeader.serialize(fieldSerializer, new int[] {}));
  networkManager.receiveCommand(apsFrame);
  Awaitility.await().until(() -> commandListenerUpdated());
  ReadAttributesCommand response = (ReadAttributesCommand) commandListenerCapture.get(0);
  assertEquals(6, (int) response.getClusterId());
  assertEquals(0, (int) response.getCommandId());
  assertEquals(1, (int) response.getTransactionId());
  assertEquals(new ZigBeeEndpointAddress(1234, 5), response.getSourceAddress());
}

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