UI: Add support use Obj19 for OTA updated in LWM2M transport configuration
This commit is contained in:
parent
d419212684
commit
6e6d57e60a
@ -52,39 +52,47 @@
|
|||||||
<ng-template matTabContent [formGroup]="lwm2mDeviceProfileFormGroup">
|
<ng-template matTabContent [formGroup]="lwm2mDeviceProfileFormGroup">
|
||||||
<section formGroupName="clientLwM2mSettings">
|
<section formGroupName="clientLwM2mSettings">
|
||||||
<fieldset class="fields-group">
|
<fieldset class="fields-group">
|
||||||
<legend class="group-title" translate>device-profile.lwm2m.fw-update</legend>
|
<legend class="group-title" translate>device-profile.lwm2m.ota-update</legend>
|
||||||
<mat-form-field class="mat-block flex-1">
|
<mat-checkbox formControlName="useObject19ForOta">
|
||||||
<mat-label>{{ 'device-profile.lwm2m.fw-update-strategy' | translate }}</mat-label>
|
<span tb-hint-tooltip-icon="{{ 'device-profile.lwm2m.use-object-19-for-ota-update-hint' | translate }}">
|
||||||
<mat-select formControlName="fwUpdateStrategy">
|
{{ 'device-profile.lwm2m.use-object-19-for-ota-update' | translate }}
|
||||||
<mat-option [value]=1>{{ 'device-profile.lwm2m.fw-update-strategy-package' | translate }}</mat-option>
|
</span>
|
||||||
<mat-option [value]=2>{{ 'device-profile.lwm2m.fw-update-strategy-package-uri' | translate }}</mat-option>
|
</mat-checkbox>
|
||||||
<mat-option [value]=3>{{ 'device-profile.lwm2m.fw-update-strategy-data' | translate }}</mat-option>
|
<fieldset class="fields-group">
|
||||||
</mat-select>
|
<legend class="group-title" translate>device-profile.lwm2m.fw-update</legend>
|
||||||
</mat-form-field>
|
<mat-form-field class="mat-block flex-1">
|
||||||
<mat-form-field class="mat-block flex-1" *ngIf="lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.fwUpdateStrategy').value === 2">
|
<mat-label>{{ 'device-profile.lwm2m.fw-update-strategy' | translate }}</mat-label>
|
||||||
<mat-label>{{ 'device-profile.lwm2m.fw-update-resource' | translate }}</mat-label>
|
<mat-select formControlName="fwUpdateStrategy">
|
||||||
<input matInput formControlName="fwUpdateResource" required>
|
<mat-option [value]=1>{{ 'device-profile.lwm2m.fw-update-strategy-package' | translate }}</mat-option>
|
||||||
<mat-error *ngIf="lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.fwUpdateResource').hasError('required')">
|
<mat-option [value]=2>{{ 'device-profile.lwm2m.fw-update-strategy-package-uri' | translate }}</mat-option>
|
||||||
{{ 'device-profile.lwm2m.fw-update-resource-required' | translate }}
|
<mat-option [value]=3>{{ 'device-profile.lwm2m.fw-update-strategy-data' | translate }}</mat-option>
|
||||||
</mat-error>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</fieldset>
|
<mat-form-field class="mat-block flex-1" *ngIf="lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.fwUpdateStrategy').value === 2">
|
||||||
<fieldset class="fields-group">
|
<mat-label>{{ 'device-profile.lwm2m.fw-update-resource' | translate }}</mat-label>
|
||||||
<legend class="group-title" translate>device-profile.lwm2m.sw-update</legend>
|
<input matInput formControlName="fwUpdateResource" required>
|
||||||
<mat-form-field class="mat-block flex-1">
|
<mat-error *ngIf="lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.fwUpdateResource').hasError('required')">
|
||||||
<mat-label>{{ 'device-profile.lwm2m.sw-update-strategy' | translate }}</mat-label>
|
{{ 'device-profile.lwm2m.fw-update-resource-required' | translate }}
|
||||||
<mat-select formControlName="swUpdateStrategy">
|
</mat-error>
|
||||||
<mat-option [value]=1>{{ 'device-profile.lwm2m.sw-update-strategy-package' | translate }}</mat-option>
|
</mat-form-field>
|
||||||
<mat-option [value]=2>{{ 'device-profile.lwm2m.sw-update-strategy-package-uri' | translate }}</mat-option>
|
</fieldset>
|
||||||
</mat-select>
|
<fieldset class="fields-group">
|
||||||
</mat-form-field>
|
<legend class="group-title" translate>device-profile.lwm2m.sw-update</legend>
|
||||||
<mat-form-field class="mat-block flex-1" *ngIf="lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.swUpdateStrategy').value === 2">
|
<mat-form-field class="mat-block flex-1">
|
||||||
<mat-label>{{ 'device-profile.lwm2m.sw-update-resource' | translate }}</mat-label>
|
<mat-label>{{ 'device-profile.lwm2m.sw-update-strategy' | translate }}</mat-label>
|
||||||
<input matInput formControlName="swUpdateResource" required>
|
<mat-select formControlName="swUpdateStrategy">
|
||||||
<mat-error *ngIf="lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.swUpdateResource').hasError('required')">
|
<mat-option [value]=1>{{ 'device-profile.lwm2m.sw-update-strategy-package' | translate }}</mat-option>
|
||||||
{{ 'device-profile.lwm2m.sw-update-resource-required' | translate }}
|
<mat-option [value]=2>{{ 'device-profile.lwm2m.sw-update-strategy-package-uri' | translate }}</mat-option>
|
||||||
</mat-error>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<mat-form-field class="mat-block flex-1" *ngIf="lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.swUpdateStrategy').value === 2">
|
||||||
|
<mat-label>{{ 'device-profile.lwm2m.sw-update-resource' | translate }}</mat-label>
|
||||||
|
<input matInput formControlName="swUpdateResource" required>
|
||||||
|
<mat-error *ngIf="lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.swUpdateResource').hasError('required')">
|
||||||
|
{{ 'device-profile.lwm2m.sw-update-resource-required' | translate }}
|
||||||
|
</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
</fieldset>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="fields-group">
|
<fieldset class="fields-group">
|
||||||
<legend class="group-title" translate>device-profile.power-saving-mode</legend>
|
<legend class="group-title" translate>device-profile.power-saving-mode</legend>
|
||||||
|
|||||||
@ -104,6 +104,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro
|
|||||||
bootstrap: [[]],
|
bootstrap: [[]],
|
||||||
clientLwM2mSettings: this.fb.group({
|
clientLwM2mSettings: this.fb.group({
|
||||||
clientOnlyObserveAfterConnect: [1, []],
|
clientOnlyObserveAfterConnect: [1, []],
|
||||||
|
useObject19ForOta: [false],
|
||||||
fwUpdateStrategy: [1, []],
|
fwUpdateStrategy: [1, []],
|
||||||
swUpdateStrategy: [1, []],
|
swUpdateStrategy: [1, []],
|
||||||
fwUpdateResource: [{value: '', disabled: true}, []],
|
fwUpdateResource: [{value: '', disabled: true}, []],
|
||||||
@ -262,6 +263,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro
|
|||||||
bootstrapServerUpdateEnable: this.configurationValue.bootstrapServerUpdateEnable || false,
|
bootstrapServerUpdateEnable: this.configurationValue.bootstrapServerUpdateEnable || false,
|
||||||
clientLwM2mSettings: {
|
clientLwM2mSettings: {
|
||||||
clientOnlyObserveAfterConnect: this.configurationValue.clientLwM2mSettings.clientOnlyObserveAfterConnect,
|
clientOnlyObserveAfterConnect: this.configurationValue.clientLwM2mSettings.clientOnlyObserveAfterConnect,
|
||||||
|
useObject19ForOta: this.configurationValue.clientLwM2mSettings.useObject19ForOta ?? false,
|
||||||
fwUpdateStrategy: this.configurationValue.clientLwM2mSettings.fwUpdateStrategy || 1,
|
fwUpdateStrategy: this.configurationValue.clientLwM2mSettings.fwUpdateStrategy || 1,
|
||||||
swUpdateStrategy: this.configurationValue.clientLwM2mSettings.swUpdateStrategy || 1,
|
swUpdateStrategy: this.configurationValue.clientLwM2mSettings.swUpdateStrategy || 1,
|
||||||
fwUpdateResource: this.configurationValue.clientLwM2mSettings.fwUpdateResource || '',
|
fwUpdateResource: this.configurationValue.clientLwM2mSettings.fwUpdateResource || '',
|
||||||
|
|||||||
@ -124,13 +124,15 @@ export const PowerModeTranslationMap = new Map<PowerMode, string>(
|
|||||||
|
|
||||||
export enum ObjectIDVer {
|
export enum ObjectIDVer {
|
||||||
V1_0 = '1.0',
|
V1_0 = '1.0',
|
||||||
V1_1 = '1.1'
|
V1_1 = '1.1',
|
||||||
|
V1_2 = '1.2',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ObjectIDVerTranslationMap = new Map<ObjectIDVer, string>(
|
export const ObjectIDVerTranslationMap = new Map<ObjectIDVer, string>(
|
||||||
[
|
[
|
||||||
[ObjectIDVer.V1_0, 'device-profile.lwm2m.default-object-id-ver.v1-0'],
|
[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 {
|
export interface ClientLwM2mSettings {
|
||||||
clientOnlyObserveAfterConnect: number;
|
clientOnlyObserveAfterConnect: number;
|
||||||
|
useObject19ForOta?: boolean;
|
||||||
fwUpdateStrategy: number;
|
fwUpdateStrategy: number;
|
||||||
swUpdateStrategy: number;
|
swUpdateStrategy: number;
|
||||||
fwUpdateResource?: string;
|
fwUpdateResource?: string;
|
||||||
|
|||||||
@ -2077,6 +2077,9 @@
|
|||||||
"add-lwm2m-server-config": "Add LwM2M server",
|
"add-lwm2m-server-config": "Add LwM2M server",
|
||||||
"no-config-servers": "No servers configured",
|
"no-config-servers": "No servers configured",
|
||||||
"others-tab": "Other settings",
|
"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": "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",
|
||||||
@ -2107,7 +2110,8 @@
|
|||||||
"default-object-id": "Default Object Version (Attribute)",
|
"default-object-id": "Default Object Version (Attribute)",
|
||||||
"default-object-id-ver": {
|
"default-object-id-ver": {
|
||||||
"v1-0": "1.0",
|
"v1-0": "1.0",
|
||||||
"v1-1": "1.1"
|
"v1-1": "1.1",
|
||||||
|
"v1-2": "1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snmp": {
|
"snmp": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user