Browse Source

lwm2m - info about previous update Ota

pull/5624/head
nickAS21 5 years ago
parent
commit
19ab4f498a
  1. 14
      common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/ota/DefaultLwM2MOtaUpdateService.java

14
common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/ota/DefaultLwM2MOtaUpdateService.java

@ -399,12 +399,12 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl
log.debug("[{}] Starting update to [{}{}] using binary", client.getEndpoint(), fwInfo.getTargetName(), fwInfo.getTargetVersion());
startUpdateUsingBinary(client, fwInfo);
}
} else if (fwInfo.updateState != null) {
log.debug("[{}] failed to process firmware update: [{}]. Previous update failed.", client.getEndpoint(), fwInfo);
logService.log(client, "Failed to process firmware update: " + fwInfo + ". Previous update failed.");
} else if (fwInfo.getResult() != null && fwInfo.getResult().getCode() > 1) {
log.trace("[{}] Previous update failed. [{}]", client.getEndpoint(), fwInfo);
logService.log(client, "Previous update firmware failed. Result: " + fwInfo.getResult().name());
}
} catch (Exception e) {
log.info("[{}] failed to update client: {}", client.getEndpoint(), fwInfo, e);
log.error("[{}] failed to update client: {}", client.getEndpoint(), fwInfo, e);
sendStateUpdateToTelemetry(client, fwInfo, OtaPackageUpdateStatus.FAILED, "Internal server error: " + e.getMessage());
}
}
@ -427,9 +427,9 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl
startUpdateUsingBinary(client, swInfo);
}
}
} else if (swInfo.updateState != null) {
log.debug("[{}] failed to update client: [{}], previous update failed.", client.getEndpoint(), swInfo);
logService.log(client, "Failed to process software update: " + swInfo + ". Previous update failed.");
} else if (swInfo.getResult() != null && swInfo.getResult().code >= 50) {
log.trace("[{}] Previous update failed. [{}]", client.getEndpoint(), swInfo);
logService.log(client, "Previous update software failed. Result: " + swInfo.getResult().name());
}
} catch (Exception e) {
log.info("[{}] failed to update client: {}", client.getEndpoint(), swInfo, e);

Loading…
Cancel
Save