Browse Source

lwm2m: update with master

pull/12799/head
nickAS21 1 year ago
parent
commit
841d3ea33f
  1. 1
      application/src/test/java/org/thingsboard/server/transport/lwm2m/AbstractLwM2MIntegrationTest.java
  2. 2
      common/data/src/main/java/org/thingsboard/server/common/data/device/profile/lwm2m/OtherConfiguration.java
  3. 8
      common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/ota/DefaultLwM2MOtaUpdateService.java
  4. 4
      ui-ngx/src/assets/locale/locale.constant-en_US.json

1
application/src/test/java/org/thingsboard/server/transport/lwm2m/AbstractLwM2MIntegrationTest.java

@ -383,6 +383,7 @@ public abstract class AbstractLwM2MIntegrationTest extends AbstractTransportInte
transportConfiguration.setBootstrap(bootstrapServerCredentials); transportConfiguration.setBootstrap(bootstrapServerCredentials);
return transportConfiguration; return transportConfiguration;
} }
protected Lwm2mDeviceProfileTransportConfiguration getTransportConfiguration19(String observeAttr, List<LwM2MBootstrapServerCredential> bootstrapServerCredentials) { protected Lwm2mDeviceProfileTransportConfiguration getTransportConfiguration19(String observeAttr, List<LwM2MBootstrapServerCredential> bootstrapServerCredentials) {
Lwm2mDeviceProfileTransportConfiguration transportConfiguration = new Lwm2mDeviceProfileTransportConfiguration(); Lwm2mDeviceProfileTransportConfiguration transportConfiguration = new Lwm2mDeviceProfileTransportConfiguration();
TelemetryMappingConfiguration observeAttrConfiguration = JacksonUtil.fromString(observeAttr, TelemetryMappingConfiguration.class); TelemetryMappingConfiguration observeAttrConfiguration = JacksonUtil.fromString(observeAttr, TelemetryMappingConfiguration.class);

2
common/data/src/main/java/org/thingsboard/server/common/data/device/profile/lwm2m/OtherConfiguration.java

@ -30,7 +30,7 @@ import org.thingsboard.server.common.data.device.data.PowerSavingConfiguration;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class OtherConfiguration extends PowerSavingConfiguration { public class OtherConfiguration extends PowerSavingConfiguration {
private Boolean useObject19ForOta; private Boolean useObject19ForOtaInfo;
private Integer fwUpdateStrategy; private Integer fwUpdateStrategy;
private Integer swUpdateStrategy; private Integer swUpdateStrategy;
private Integer clientOnlyObserveAfterConnect; private Integer clientOnlyObserveAfterConnect;

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

@ -528,8 +528,8 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl
} else { } else {
strategy = info.getDeliveryMethod() == FirmwareDeliveryMethod.PULL.code ? LwM2MFirmwareUpdateStrategy.OBJ_5_TEMP_URL : LwM2MFirmwareUpdateStrategy.OBJ_5_BINARY; strategy = info.getDeliveryMethod() == FirmwareDeliveryMethod.PULL.code ? LwM2MFirmwareUpdateStrategy.OBJ_5_TEMP_URL : LwM2MFirmwareUpdateStrategy.OBJ_5_BINARY;
} }
Boolean useObject19ForOta = clientContext.getProfile(client.getProfileId()).getClientLwM2mSettings().getUseObject19ForOta(); Boolean useObject19ForOtaInfo = clientContext.getProfile(client.getProfileId()).getClientLwM2mSettings().getUseObject19ForOtaInfo();
if (useObject19ForOta != null && useObject19ForOta){ if (useObject19ForOtaInfo != null && useObject19ForOtaInfo){
sendInfoToObject19ForOta(client, FW_INFO_19_INSTANCE_ID, response, otaPackageId); sendInfoToObject19ForOta(client, FW_INFO_19_INSTANCE_ID, response, otaPackageId);
} }
switch (strategy) { switch (strategy) {
@ -554,8 +554,8 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl
if (TransportProtos.ResponseStatus.SUCCESS.equals(response.getResponseStatus())) { if (TransportProtos.ResponseStatus.SUCCESS.equals(response.getResponseStatus())) {
UUID otaPackageId = new UUID(response.getOtaPackageIdMSB(), response.getOtaPackageIdLSB()); UUID otaPackageId = new UUID(response.getOtaPackageIdMSB(), response.getOtaPackageIdLSB());
LwM2MSoftwareUpdateStrategy strategy = info.getStrategy(); LwM2MSoftwareUpdateStrategy strategy = info.getStrategy();
Boolean useObject19ForOta = clientContext.getProfile(client.getProfileId()).getClientLwM2mSettings().getUseObject19ForOta(); Boolean useObject19ForOtaInfo = clientContext.getProfile(client.getProfileId()).getClientLwM2mSettings().getUseObject19ForOtaInfo();
if (useObject19ForOta != null && useObject19ForOta){ if (useObject19ForOtaInfo != null && useObject19ForOtaInfo){
sendInfoToObject19ForOta(client, SW_INFO_19_INSTANCE_ID, response, otaPackageId); sendInfoToObject19ForOta(client, SW_INFO_19_INSTANCE_ID, response, otaPackageId);
} }
switch (strategy) { switch (strategy) {

4
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -2175,8 +2175,8 @@
"no-config-servers": "No servers configured", "no-config-servers": "No servers configured",
"others-tab": "Other settings", "others-tab": "Other settings",
"ota-update": "OTA update", "ota-update": "OTA update",
"use-object-19-for-ota-update": "Use Object 19 for OTA update", "use-object-19-for-ota-update": "Use Object 19 for OTA file metadata (checksum, size, version, name)",
"use-object-19-for-ota-update-hint": "Use Resource ObjectId = 19 for OTA updates: FirmWare → InstanceId = 65534, SoftWare → InstanceId = 65535. The data format is JSON wrapped in Base64. The main field in JSON: \"Checksum\" (SHA256). Additional fields: \"Title\" (OTA name), \"Version\" (OTA version), \"File Name\" (file name for storing OTA on the client), \"File Size\" (OTA size in bytes).", "use-object-19-for-ota-update-hint": "Use Resource ObjectId = 19 for OTA updates: FirmWare → InstanceId = 65534, SoftWare → InstanceId = 65535. The data format is JSON wrapped in Base64. This JSON contains OTA file metadata (file info): \"Checksum\" (SHA256). Additional fields: \"Title\" (OTA name), \"Version\" (OTA version), \"File Name\" (file name for storing OTA on the client), \"File Size\" (OTA size in bytes).",
"client-strategy": "Client strategy when connecting", "client-strategy": "Client strategy when connecting",
"client-strategy-label": "Strategy", "client-strategy-label": "Strategy",
"client-strategy-only-observe": "Only Observe Request to the client after the initial connection", "client-strategy-only-observe": "Only Observe Request to the client after the initial connection",

Loading…
Cancel
Save