gpt4 book ai didi

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

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

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

ZigBeeApsFrame.getProfile介绍

暂无

代码示例

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

switch (apsFrame.getProfile()) { // TODO: Use ZigBeeProfileType
  case 0x0000:
    command = receiveZdoCommand(fieldDeserializer, apsFrame);
    break;
  default:
    logger.debug("Received message with unknown profile {}", String.format("%04X", apsFrame.getProfile()));
    break;

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

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

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

@Override
public void sendCommand(final ZigBeeApsFrame apsFrame) {
  ConBeeEnqueueSendDataRequest request = new ConBeeEnqueueSendDataRequest();
  request.setRequestId(apsFrame.getApsCounter());
  request.setClusterId(apsFrame.getCluster());
  switch (apsFrame.getAddressMode()) {
    case DEVICE:
      request.setDestinationAddress(
          new ZigBeeEndpointAddress(apsFrame.getDestinationAddress(), apsFrame.getDestinationEndpoint()));
      request.setDestinationAddressMode(ConBeeAddressMode.NWK);
      if (apsFrame.getDestinationAddress() > 0xfff8) {
        //
        request.setTxOptions(0);
      }
      break;
    case GROUP:
      request.setDestinationAddress(new ZigBeeGroupAddress(apsFrame.getDestinationAddress()));
      request.setDestinationAddressMode(ConBeeAddressMode.GROUP);
      break;
    default:
      break;
  }
  request.setProfileId(apsFrame.getProfile());
  request.setRadius(apsFrame.getRadius());
  request.setSourceEndpoint(apsFrame.getSourceEndpoint());
  // request.setTxOptions(txOptions);
  request.setAdsuData(apsFrame.getPayload());
  conbeeHandler.queueFrame(request);
}

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