Commit 9720dfac4787343777d765d83149b727a397090b
Committed by
Andrew Shvayka
1 parent
ae996e88
Fixed lwm2m fw/sw logs
Showing
2 changed files
with
7 additions
and
2 deletions
... | ... | @@ -369,7 +369,7 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl |
369 | 369 | |
370 | 370 | private void startFirmwareUpdateIfNeeded(LwM2mClient client, LwM2MClientFwOtaInfo fwInfo) { |
371 | 371 | try { |
372 | - if (!fwInfo.isSupported()) { | |
372 | + if (!fwInfo.isSupported() && fwInfo.isAssigned()) { | |
373 | 373 | log.debug("[{}] Fw update is not supported: {}", client.getEndpoint(), fwInfo); |
374 | 374 | sendStateUpdateToTelemetry(client, fwInfo, OtaPackageUpdateStatus.FAILED, "Client does not support firmware update or profile misconfiguration!"); |
375 | 375 | } else if (fwInfo.isUpdateRequired()) { |
... | ... | @@ -389,7 +389,7 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl |
389 | 389 | |
390 | 390 | private void startSoftwareUpdateIfNeeded(LwM2mClient client, LwM2MClientSwOtaInfo swInfo) { |
391 | 391 | try { |
392 | - if (!swInfo.isSupported()) { | |
392 | + if (!swInfo.isSupported() && swInfo.isAssigned()) { | |
393 | 393 | log.debug("[{}] Sw update is not supported: {}", client.getEndpoint(), swInfo); |
394 | 394 | sendStateUpdateToTelemetry(client, swInfo, OtaPackageUpdateStatus.FAILED, "Client does not support software update or profile misconfiguration!"); |
395 | 395 | } else if (swInfo.isUpdateRequired()) { | ... | ... |
... | ... | @@ -91,6 +91,11 @@ public abstract class LwM2MClientOtaInfo<Strategy, State, Result> { |
91 | 91 | return StringUtils.isNotEmpty(currentName) || StringUtils.isNotEmpty(currentVersion) || StringUtils.isNotEmpty(currentVersion3); |
92 | 92 | } |
93 | 93 | |
94 | + @JsonIgnore | |
95 | + public boolean isAssigned() { | |
96 | + return StringUtils.isNotEmpty(targetName) && StringUtils.isNotEmpty(targetVersion); | |
97 | + } | |
98 | + | |
94 | 99 | public abstract void update(Result result); |
95 | 100 | |
96 | 101 | protected static String getPackageId(String name, String version) { | ... | ... |