@Test public void testSend() { ImageNotifyCommand command = getTestImageNotifyCommandWithPayloadType(0); System.out.println(command); ZigBeeSerializer serializer = new DefaultSerializer(); ZclFieldSerializer fieldSerializer = new ZclFieldSerializer(serializer); command.serialize(fieldSerializer); assertTrue(Arrays.equals(getPacketData("00 48"), serializer.getPayload())); serializer = new DefaultSerializer(); fieldSerializer = new ZclFieldSerializer(serializer); command = getTestImageNotifyCommandWithPayloadType(1); command.serialize(fieldSerializer); assertTrue(Arrays.equals(getPacketData("01 48 0C 11"), serializer.getPayload())); serializer = new DefaultSerializer(); fieldSerializer = new ZclFieldSerializer(serializer); command.serialize(fieldSerializer); assertTrue(Arrays.equals(getPacketData("01 48 0C 11"), serializer.getPayload())); serializer = new DefaultSerializer(); fieldSerializer = new ZclFieldSerializer(serializer); command = getTestImageNotifyCommandWithPayloadType(2); command.serialize(fieldSerializer); assertTrue(Arrays.equals(getPacketData("02 48 0C 11 06 00"), serializer.getPayload())); serializer = new DefaultSerializer(); fieldSerializer = new ZclFieldSerializer(serializer); command = getTestImageNotifyCommandWithPayloadType(3); command.serialize(fieldSerializer); assertTrue(Arrays.equals(getPacketData("03 48 0C 11 06 00 07 03 02 01"), serializer.getPayload())); }
@Override public void serialize(final ZclFieldSerializer serializer) { serializer.serialize(payloadType, ZclDataType.ENUMERATION_8_BIT); if (payloadType >= 0) { serializer.serialize(queryJitter, ZclDataType.UNSIGNED_8_BIT_INTEGER); } if (payloadType >= 1) { serializer.serialize(manufacturerCode, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 2) { serializer.serialize(imageType, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 3) { serializer.serialize(newFileVersion, ZclDataType.UNSIGNED_32_BIT_INTEGER); } }
ImageNotifyCommand extends ZclOtaUpgradeCommand { @Override public void serialize(final ZclFieldSerializer serializer) { serializer.serialize(payloadType, ZclDataType.ENUMERATION_8_BIT); if (payloadType >= 0) { serializer.serialize(queryJitter, ZclDataType.UNSIGNED_8_BIT_INTEGER); } if (payloadType >= 1) { serializer.serialize(manufacturerCode, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 2) { serializer.serialize(imageType, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 3) { serializer.serialize(newFileVersion, ZclDataType.UNSIGNED_32_BIT_INTEGER); } } }
ImageNotifyCommand extends ZclOtaUpgradeCommand { @Override public void serialize(final ZclFieldSerializer serializer) { serializer.serialize(payloadType, ZclDataType.ENUMERATION_8_BIT); if (payloadType >= 0) { serializer.serialize(queryJitter, ZclDataType.UNSIGNED_8_BIT_INTEGER); } if (payloadType >= 1) { serializer.serialize(manufacturerCode, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 2) { serializer.serialize(imageType, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 3) { serializer.serialize(newFileVersion, ZclDataType.UNSIGNED_32_BIT_INTEGER); } } @Deprecated  ImageNotifyCommand();  ImageNotifyCommand(
            Integer payloadType,
            Integer queryJitter,
            Integer manufacturerCode,
            Integer imageType,
            Integer newFileVersion); }
ImageNotifyCommand extends ZclOtaUpgradeCommand { @Override public void serialize(final ZclFieldSerializer serializer) { serializer.serialize(payloadType, ZclDataType.ENUMERATION_8_BIT); if (payloadType >= 0) { serializer.serialize(queryJitter, ZclDataType.UNSIGNED_8_BIT_INTEGER); } if (payloadType >= 1) { serializer.serialize(manufacturerCode, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 2) { serializer.serialize(imageType, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 3) { serializer.serialize(newFileVersion, ZclDataType.UNSIGNED_32_BIT_INTEGER); } } @Deprecated  ImageNotifyCommand();  ImageNotifyCommand(
            Integer payloadType,
            Integer queryJitter,
            Integer manufacturerCode,
            Integer imageType,
            Integer newFileVersion); Integer getPayloadType(); @Deprecated void setPayloadType(final Integer payloadType); Integer getQueryJitter(); @Deprecated void setQueryJitter(final Integer queryJitter); Integer getManufacturerCode(); @Deprecated void setManufacturerCode(final Integer manufacturerCode); Integer getImageType(); @Deprecated void setImageType(final Integer imageType); Integer getNewFileVersion(); @Deprecated void setNewFileVersion(final Integer newFileVersion); @Override void serialize(final ZclFieldSerializer serializer); @Override void deserialize(final ZclFieldDeserializer deserializer); @Override String toString(); }
ImageNotifyCommand extends ZclOtaUpgradeCommand { @Override public void serialize(final ZclFieldSerializer serializer) { serializer.serialize(payloadType, ZclDataType.ENUMERATION_8_BIT); if (payloadType >= 0) { serializer.serialize(queryJitter, ZclDataType.UNSIGNED_8_BIT_INTEGER); } if (payloadType >= 1) { serializer.serialize(manufacturerCode, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 2) { serializer.serialize(imageType, ZclDataType.UNSIGNED_16_BIT_INTEGER); } if (payloadType >= 3) { serializer.serialize(newFileVersion, ZclDataType.UNSIGNED_32_BIT_INTEGER); } } @Deprecated  ImageNotifyCommand();  ImageNotifyCommand(
            Integer payloadType,
            Integer queryJitter,
            Integer manufacturerCode,
            Integer imageType,
            Integer newFileVersion); Integer getPayloadType(); @Deprecated void setPayloadType(final Integer payloadType); Integer getQueryJitter(); @Deprecated void setQueryJitter(final Integer queryJitter); Integer getManufacturerCode(); @Deprecated void setManufacturerCode(final Integer manufacturerCode); Integer getImageType(); @Deprecated void setImageType(final Integer imageType); Integer getNewFileVersion(); @Deprecated void setNewFileVersion(final Integer newFileVersion); @Override void serialize(final ZclFieldSerializer serializer); @Override void deserialize(final ZclFieldDeserializer deserializer); @Override String toString(); static int CLUSTER_ID; static int COMMAND_ID; }