gpt4 book ai didi

com.zsmartsystems.zigbee.app.otaserver.ZigBeeOtaFile.getFileVersion()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 11:19:31 27 4
gpt4 key购买 nike

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

ZigBeeOtaFile.getFileVersion介绍

暂无

代码示例

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

/**
 * The purpose of sending Image Notify command is so the server has a way to notify client devices of
 * when the OTA upgrade images are available for them. It eliminates the need for ZR client devices
 * having to check with the server periodically of when the new images are available. However, all client
 * devices still need to send in Query Next Image Request command in order to officially start the OTA
 * upgrade process.
 */
public void notifyClient() {
  // Only send the notify if the file is set
  if (otaFile == null) {
    return;
  }
  cluster.imageNotifyCommand(0, queryJitter, otaFile.getManufacturerCode(), otaFile.getImageType(),
      otaFile.getFileVersion());
}

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

/**
 * Sends an image block to the client
 *
 * @param fileOffset the offset into the {@link ZigBeeOtaFile} to send the block
 * @param maximumDataSize the maximum data size the client can accept
 * @return the number of bytes sent
 */
private int sendImageBlock(int fileOffset, int maximumDataSize) {
  ByteArray imageData = otaFile.getImageData(fileOffset, Math.min(dataSize, maximumDataSize));
  logger.debug("{} OTA Data: Sending {} bytes at offset {}", cluster.getZigBeeAddress(), imageData.size(),
      fileOffset);
  cluster.imageBlockResponse(ZclStatus.SUCCESS, otaFile.getManufacturerCode(), otaFile.getImageType(),
      otaFile.getFileVersion(), fileOffset, imageData);
  return imageData.size();
}

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

otaFile.getImageType(), otaFile.getFileVersion(), 0, 0).get();
if (!(response.isSuccess() || response.isTimeout())) {
  updateStatus(ZigBeeOtaServerStatus.OTA_UPGRADE_FAILED);
  if (fileVersion.equals(otaFile.getFileVersion())) {
    updateStatus(ZigBeeOtaServerStatus.OTA_UPGRADE_COMPLETE);
    return;

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

|| !command.getFileVersion().equals(otaFile.getFileVersion())
  || !command.getImageType().equals(otaFile.getImageType())) {
logger.debug("{} OTA Error: Request is inconsistent with OTA file.", cluster.getZigBeeAddress());

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

|| !command.getFileVersion().equals(otaFile.getFileVersion())
  || !command.getImageType().equals(otaFile.getImageType())) {
logger.debug("{} OTA Error: Request is inconsistent with OTA file.", cluster.getZigBeeAddress());

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

@Test
  public void testOpenFile() throws IOException {
    Path file = FileSystems.getDefault().getPath("./src/test/resource/", "test_ota_file.test");
    byte[] fileData = Files.readAllBytes(file);
    ZigBeeOtaFile otaFile = new ZigBeeOtaFile(fileData);

    System.out.println(otaFile);

    assertEquals(Integer.valueOf(0x1234), otaFile.getManufacturerCode());
    assertEquals(Integer.valueOf(0x0006), otaFile.getImageType());
    assertEquals(Integer.valueOf(0x12345678), otaFile.getFileVersion());
    assertEquals(ZigBeeStackType.ZIGBEE_PRO, otaFile.getStackVersion());
    assertEquals("A.String", otaFile.getHeaderString());
    assertEquals(Integer.valueOf(78), otaFile.getImageSize());
    assertEquals(new ByteArray(new byte[] { 0x1E, (byte) 0xF1, (byte) 0xEE, 0x0B }), otaFile.getImageData(0, 4));
    assertEquals(new ByteArray(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04 }), otaFile.getImageData(62, 5));
  }
}

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

if (!allowExistingFile && command.getFileVersion().equals(otaFile.getFileVersion())) {
  cluster.sendDefaultResponse(command.getTransactionId(), command.getCommandId(),
      ZclStatus.NO_IMAGE_AVAILABLE);
    otaFile.getFileVersion(), otaFile.getImageSize());

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

|| !command.getFileVersion().equals(otaFile.getFileVersion())
  || !command.getImageType().equals(otaFile.getImageType())) {
logger.debug("{} OTA Error: Request is inconsistent with OTA file.", cluster.getZigBeeAddress());

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