gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 13:17:31 25 4
gpt4 key购买 nike

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

ZigBeeApsFrame.<init>介绍

暂无

代码示例

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

@Test
public void testGroupAddress() {
  ZigBeeApsFrame frame = new ZigBeeApsFrame();
  System.out.println(frame);
  frame.setGroupAddress(1);
  assertEquals(1, frame.getGroupAddress());
}

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

@Test
public void testToString() {
  ZigBeeApsFrame frame = new ZigBeeApsFrame();
  assertNotNull(frame.toString());
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.ACTIVE_ENDPOINTS_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.MANAGEMENT_ROUTING_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.SIMPLE_DESCRIPTOR_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.MANAGEMENT_LQI_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
  ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
  apsFrame.setCluster(ZdoCommandType.DEVICE_ANNOUNCE.getClusterId());
  apsFrame.setDestinationEndpoint(0);
  apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
  apsFrame.setSourceEndpoint(0);
  apsFrame.setProfile(0);
  apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));
  return apsFrame;
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.POWER_DESCRIPTOR_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.NODE_DESCRIPTOR_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.MANAGEMENT_LEAVE_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[4] + (packet.getPacket()[5] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    apsFrame.setPayload(Arrays.copyOfRange(packet.getPacket(), 5, packet.getPacket().length - 1));

    return apsFrame;
  }
}

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

@Test
public void testRadius() {
  ZigBeeApsFrame frame = new ZigBeeApsFrame();
  frame.setRadius(4);
  assertEquals(4, frame.getRadius());
}

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

@Test
public void testNonMemberRadius() {
  ZigBeeApsFrame frame = new ZigBeeApsFrame();
  frame.setNonMemberRadius(4);
  assertEquals(4, frame.getNonMemberRadius());
}

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

public static ZigBeeApsFrame create(ZToolPacket packet) {
    ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();
    apsFrame.setCluster(ZdoCommandType.IEEE_ADDRESS_RESPONSE.getClusterId());
    apsFrame.setDestinationEndpoint(0);
    apsFrame.setSourceAddress(packet.getPacket()[13] + (packet.getPacket()[14] << 8));
    apsFrame.setSourceEndpoint(0);
    apsFrame.setProfile(0);
    int temp[] = Arrays.copyOfRange(packet.getPacket(), 3, packet.getPacket().length - 1);
    int a = temp[12];
    temp[12] = temp[13];
    temp[13] = a;
    temp[0] = 0;
    apsFrame.setPayload(temp);

    return apsFrame;
  }
}

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

ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();

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

@Test
public void testSecurityEnable() {
  ZigBeeApsFrame frame = new ZigBeeApsFrame();
  frame.setSecurityEnabled(true);
  assertTrue(frame.getSecurityEnabled());
  frame.setSecurityEnabled(false);
  assertFalse(frame.getSecurityEnabled());
  System.out.println(frame);
}

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

ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();

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

ZigBeeApsFrame apsFrame = new ZigBeeApsFrame();

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

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