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

x33g5p2x  于2022-02-05 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(134)

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

ZigBeeApsFrame.getSourceAddress介绍

暂无

代码示例

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

command.setSourceAddress(new ZigBeeEndpointAddress(apsFrame.getSourceAddress(), apsFrame.getSourceEndpoint()));
command.setDestinationAddress(
    new ZigBeeEndpointAddress(apsFrame.getDestinationAddress(), apsFrame.getDestinationEndpoint()));

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

@Test
public void testReceive2() {
  ZToolPacket data = getPacket(
      "FE 18 45 84 21 A4 00 21 A4 12 02 04 01 01 00 00 02 00 00 03 00 03 05 00 06 00 08 00 C4");
  ZigBeeApsFrame apsFrame = ZdoSimpleDescriptor.create(data);
  assertEquals(42017, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("A4 00 21 A4 12 02 04 01 01 00 00 02 00 00 03 00 03 05 00 06 00 08 00"),
      apsFrame.getPayload()));
}

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

@Test
public void testReceive1() {
  ZToolPacket data = getPacket("FE 11 45 81 00 14 D4 F1 02 00 4B 12 00 00 00 00 02 8F 22 2A 2F 15");
  ZigBeeApsFrame apsFrame = ZdoIeeeAddress.create(data);
  assertEquals(0x0000, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("00 00 14 D4 F1 02 00 4B 12 00 00 00 02 00 8F 22 2A 2F"),
      apsFrame.getPayload()));
}

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

@Test
public void testReceive() {
  ZToolPacket data = getPacket("FE 07 45 83 00 00 00 00 00 10 C1 10");
  ZigBeeApsFrame apsFrame = ZdoPowerDescriptor.create(data);
  assertEquals(0x0000, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("00 00 00 00 10 C1"), apsFrame.getPayload()));
}

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

@Test
public void testReceive() {
  ZToolPacket data = getPacket("FE 0D 45 C1 2A 2F 2A 2F F9 41 F6 02 00 4B 12 00 00 9C");
  ZigBeeApsFrame apsFrame = ZdoEndDeviceAnnounce.create(data);
  assertEquals(0x2f2a, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("2F 2A 2F F9 41 F6 02 00 4B 12 00 00"), apsFrame.getPayload()));
}

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

@Test
public void testReceive() {
  ZToolPacket data = getPacket("FE 0B 45 B2 00 00 00 01 00 01 2A 2F 00 35 38 F4");
  ZigBeeApsFrame apsFrame = ZdoManagementRouting.create(data);
  assertEquals(0x0000, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("00 00 01 00 01 2A 2F 00 35 38"), apsFrame.getPayload()));
}

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

@Test
public void testReceive() {
  ZToolPacket data = getPacket("FE 03 45 B4 E6 D2 00 C6");
  ZigBeeApsFrame apsFrame = ZdoManagementLeave.create(data);
  assertEquals(53990, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("D2 00"), apsFrame.getPayload()));
}

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

@Test
public void testReceive() {
  ZToolPacket data = getPacket("FE 12 45 82 00 00 00 00 00 00 40 0F 00 00 50 A0 00 01 00 A0 00 00 CB");
  ZigBeeApsFrame apsFrame = ZdoNodeDescriptor.create(data);
  assertEquals(0x0000, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("00 00 00 00 00 40 0F 00 00 50 A0 00 01 00 A0 00 00"),
      apsFrame.getPayload()));
}

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

@Test
public void testReceive2() {
  ZToolPacket data = getPacket("FE 0F 45 81 00 86 06 00 00 00 EE 1F 00 21 A4 00 01 00 00 3E");
  ZigBeeApsFrame apsFrame = ZdoIeeeAddress.create(data);
  assertEquals(42017, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(
      Arrays.equals(getPacketData("00 00 86 06 00 00 00 EE 1F 00 21 A4 01 00 00 00"), apsFrame.getPayload()));
}

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

@Test
public void testReceive() {
  ZToolPacket data = getPacket(
      "FE 32 45 B1 00 00 00 02 00 02 14 D4 F1 02 00 4B 12 00 0B 88 DC 00 01 88 17 00 8F 22 15 02 01 3B 14 D4 F1 02 00 4B 12 00 EC A1 A5 01 00 8D 15 00 35 38 15 02 01 58 B5");
  ZigBeeApsFrame apsFrame = ZdoManagementLqi.create(data);
  assertEquals(0x0000, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(
      getPacketData(
          "00 00 02 00 02 14 D4 F1 02 00 4B 12 00 0B 88 DC 00 01 88 17 00 8F 22 15 02 01 3B 14 D4 F1 02 00 4B 12 00 EC A1 A5 01 00 8D 15 00 35 38 15 02 01 58"),
      apsFrame.getPayload()));
}

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

@Test
public void testReceive1() {
  ZToolPacket data = getPacket(
      "FE 2E 45 84 00 00 00 00 00 28 01 04 01 00 00 00 00 10 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 09 00 0F 00 0A 00 0C 00 15 00 00 01 01 01 CF");
  ZigBeeApsFrame apsFrame = ZdoSimpleDescriptor.create(data);
  assertEquals(0x0000, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(
      getPacketData(
          "00 00 00 00 28 01 04 01 00 00 00 00 10 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 09 00 0F 00 0A 00 0C 00 15 00 00 01 01 01"),
      apsFrame.getPayload()));
}

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

@Test
public void testReceive() {
  String packetString = "FE 08 45 85 00 00 00 00 00 02 02 01 C9";
  ZToolPacket data = getPacket(packetString);
  assertEquals(packetString, data.getPacketString());
  ZigBeeApsFrame apsFrame = ZdoActiveEndpoint.create(data);
  assertEquals(0x0000, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("00 00 00 00 02 02 01"), apsFrame.getPayload()));
}

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

@Test
public void testReceive() {
  ZToolPacket data = getPacket("FE 15 45 FF 00 00 00 01 80 00 00 00 1B 00 5B 23 EB 09 00 4B 12 00 00 00 00 F6");
  ZigBeeApsFrame apsFrame = ZdoCallbackIncoming.create(data);
  assertEquals(0x8001, apsFrame.getCluster());
  assertEquals(0x0000, apsFrame.getSourceAddress());
  assertEquals(0, apsFrame.getProfile());
  assertEquals(0, apsFrame.getDestinationEndpoint());
  assertTrue(Arrays.equals(getPacketData("1B 00 5B 23 EB 09 00 4B 12 00 00 00 00"), apsFrame.getPayload()));
}

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

@Test
public void testSendCommandZCL() {
  ZigBeeNetworkManager networkManager = mockZigBeeNetworkManager();
  networkManager.setSerializer(DefaultSerializer.class, DefaultDeserializer.class);
  ZigBeeEndpointAddress deviceAddress = new ZigBeeEndpointAddress(1234, 56);
  OnCommand cmd = new OnCommand();
  cmd.setClusterId(6);
  cmd.setDestinationAddress(deviceAddress);
  boolean error = false;
  networkManager.sendCommand(cmd);
  assertFalse(error);
  assertEquals(1, mockedApsFrameListener.getAllValues().size());
  ZigBeeApsFrame apsFrame = mockedApsFrameListener.getValue();
  assertEquals(ZigBeeNwkAddressMode.DEVICE, apsFrame.getAddressMode());
  assertEquals(1234, apsFrame.getDestinationAddress());
  assertEquals(0, apsFrame.getSourceAddress());
  assertEquals(0x104, apsFrame.getProfile());
  assertEquals(6, apsFrame.getCluster());
  assertEquals(56, apsFrame.getDestinationEndpoint());
}

相关文章