gpt4 book ai didi

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

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

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

ZigBeeSerializer.getPayload介绍

暂无

代码示例

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

/**
   * Gets payload.
   *
   * @return the payload
   */
  public int[] getPayload() {
    return serializer.getPayload();
  }
}

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

@Test
  public void testSendEndpoint2() {
    MatchDescriptorResponse matchResponse = new MatchDescriptorResponse();
    matchResponse.setStatus(ZdoStatus.SUCCESS);
    List<Integer> matchList = new ArrayList<Integer>();
    matchList.add(1);
    matchList.add(2);
    matchResponse.setMatchList(matchList);

    matchResponse.setDestinationAddress(new ZigBeeEndpointAddress(1234, 5));
    matchResponse.setNwkAddrOfInterest(1234);
    System.out.println(matchResponse);

    ZigBeeSerializer serializer = new DefaultSerializer();
    ZclFieldSerializer fieldSerializer = new ZclFieldSerializer(serializer);
    matchResponse.serialize(fieldSerializer);
    assertTrue(Arrays.equals(getPacketData("00 00 D2 04 02 01 02"), serializer.getPayload()));
  }
}

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

@Test
public void testSendEndpoint1() {
  MatchDescriptorResponse matchResponse = new MatchDescriptorResponse();
  matchResponse.setStatus(ZdoStatus.SUCCESS);
  List<Integer> matchList = new ArrayList<Integer>();
  matchList.add(1);
  matchResponse.setMatchList(matchList);
  matchResponse.setDestinationAddress(new ZigBeeEndpointAddress(1234, 5));
  matchResponse.setNwkAddrOfInterest(1234);
  System.out.println(matchResponse);
  ZigBeeSerializer serializer = new DefaultSerializer();
  ZclFieldSerializer fieldSerializer = new ZclFieldSerializer(serializer);
  matchResponse.serialize(fieldSerializer);
  assertTrue(Arrays.equals(getPacketData("00 00 D2 04 01 01"), serializer.getPayload()));
}

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

command.setPayloadType(0);
command.serialize(fieldSerializer);
assertTrue(Arrays.equals(getPacketData("00 48"), serializer.getPayload()));
command.setPayloadType(1);
command.serialize(fieldSerializer);
assertTrue(Arrays.equals(getPacketData("01 48 0C 11"), serializer.getPayload()));
command.setPayloadType(1);
command.serialize(fieldSerializer);
assertTrue(Arrays.equals(getPacketData("01 48 0C 11"), serializer.getPayload()));
command.setPayloadType(2);
command.serialize(fieldSerializer);
assertTrue(Arrays.equals(getPacketData("02 48 0C 11 06 00"), serializer.getPayload()));
command.setPayloadType(3);
command.serialize(fieldSerializer);
assertTrue(Arrays.equals(getPacketData("03 48 0C 11 06 00 07 03 02 01"), serializer.getPayload()));

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