From 6e6d57e60ab1e9ba4bf375b4eef60166ad66ac4a Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 28 Feb 2025 15:34:21 +0200 Subject: [PATCH] UI: Add support use Obj19 for OTA updated in LWM2M transport configuration --- ...ile-transport-configuration.component.html | 74 ++++++++++--------- ...ofile-transport-configuration.component.ts | 2 + .../lwm2m/lwm2m-profile-config.models.ts | 7 +- .../assets/locale/locale.constant-en_US.json | 6 +- 4 files changed, 53 insertions(+), 36 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html index 0ad27b23ef..bb37b5784a 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html @@ -52,39 +52,47 @@
- device-profile.lwm2m.fw-update - - {{ 'device-profile.lwm2m.fw-update-strategy' | translate }} - - {{ 'device-profile.lwm2m.fw-update-strategy-package' | translate }} - {{ 'device-profile.lwm2m.fw-update-strategy-package-uri' | translate }} - {{ 'device-profile.lwm2m.fw-update-strategy-data' | translate }} - - - - {{ 'device-profile.lwm2m.fw-update-resource' | translate }} - - - {{ 'device-profile.lwm2m.fw-update-resource-required' | translate }} - - -
-
- device-profile.lwm2m.sw-update - - {{ 'device-profile.lwm2m.sw-update-strategy' | translate }} - - {{ 'device-profile.lwm2m.sw-update-strategy-package' | translate }} - {{ 'device-profile.lwm2m.sw-update-strategy-package-uri' | translate }} - - - - {{ 'device-profile.lwm2m.sw-update-resource' | translate }} - - - {{ 'device-profile.lwm2m.sw-update-resource-required' | translate }} - - + device-profile.lwm2m.ota-update + + + {{ 'device-profile.lwm2m.use-object-19-for-ota-update' | translate }} + + +
+ device-profile.lwm2m.fw-update + + {{ 'device-profile.lwm2m.fw-update-strategy' | translate }} + + {{ 'device-profile.lwm2m.fw-update-strategy-package' | translate }} + {{ 'device-profile.lwm2m.fw-update-strategy-package-uri' | translate }} + {{ 'device-profile.lwm2m.fw-update-strategy-data' | translate }} + + + + {{ 'device-profile.lwm2m.fw-update-resource' | translate }} + + + {{ 'device-profile.lwm2m.fw-update-resource-required' | translate }} + + +
+
+ device-profile.lwm2m.sw-update + + {{ 'device-profile.lwm2m.sw-update-strategy' | translate }} + + {{ 'device-profile.lwm2m.sw-update-strategy-package' | translate }} + {{ 'device-profile.lwm2m.sw-update-strategy-package-uri' | translate }} + + + + {{ 'device-profile.lwm2m.sw-update-resource' | translate }} + + + {{ 'device-profile.lwm2m.sw-update-resource-required' | translate }} + + +
device-profile.power-saving-mode diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts index a9fbb7b249..46c439cf33 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts @@ -104,6 +104,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro bootstrap: [[]], clientLwM2mSettings: this.fb.group({ clientOnlyObserveAfterConnect: [1, []], + useObject19ForOta: [false], fwUpdateStrategy: [1, []], swUpdateStrategy: [1, []], fwUpdateResource: [{value: '', disabled: true}, []], @@ -262,6 +263,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro bootstrapServerUpdateEnable: this.configurationValue.bootstrapServerUpdateEnable || false, clientLwM2mSettings: { clientOnlyObserveAfterConnect: this.configurationValue.clientLwM2mSettings.clientOnlyObserveAfterConnect, + useObject19ForOta: this.configurationValue.clientLwM2mSettings.useObject19ForOta ?? false, fwUpdateStrategy: this.configurationValue.clientLwM2mSettings.fwUpdateStrategy || 1, swUpdateStrategy: this.configurationValue.clientLwM2mSettings.swUpdateStrategy || 1, fwUpdateResource: this.configurationValue.clientLwM2mSettings.fwUpdateResource || '', diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-profile-config.models.ts b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-profile-config.models.ts index e5706cf39b..33b358e581 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-profile-config.models.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-profile-config.models.ts @@ -124,13 +124,15 @@ export const PowerModeTranslationMap = new Map( export enum ObjectIDVer { V1_0 = '1.0', - V1_1 = '1.1' + V1_1 = '1.1', + V1_2 = '1.2', } export const ObjectIDVerTranslationMap = new Map( [ [ObjectIDVer.V1_0, 'device-profile.lwm2m.default-object-id-ver.v1-0'], - [ObjectIDVer.V1_1, 'device-profile.lwm2m.default-object-id-ver.v1-1'] + [ObjectIDVer.V1_1, 'device-profile.lwm2m.default-object-id-ver.v1-1'], + [ObjectIDVer.V1_2, 'device-profile.lwm2m.default-object-id-ver.v1-2'], ] ); @@ -167,6 +169,7 @@ export interface Lwm2mProfileConfigModels { export interface ClientLwM2mSettings { clientOnlyObserveAfterConnect: number; + useObject19ForOta?: boolean; fwUpdateStrategy: number; swUpdateStrategy: number; fwUpdateResource?: string; diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index de97184f5a..67b406fc40 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -2077,6 +2077,9 @@ "add-lwm2m-server-config": "Add LwM2M server", "no-config-servers": "No servers configured", "others-tab": "Other settings", + "ota-update": "OTA update", + "use-object-19-for-ota-update": "Use Object 19 for OTA update", + "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).", "client-strategy": "Client strategy when connecting", "client-strategy-label": "Strategy", "client-strategy-only-observe": "Only Observe Request to the client after the initial connection", @@ -2107,7 +2110,8 @@ "default-object-id": "Default Object Version (Attribute)", "default-object-id-ver": { "v1-0": "1.0", - "v1-1": "1.1" + "v1-1": "1.1", + "v1-2": "1.2" } }, "snmp": {