|
|
|
@ -104,9 +104,9 @@ export class CoapDeviceProfileTransportConfigurationComponent implements Control |
|
|
|
}), |
|
|
|
clientSettings: this.fb.group({ |
|
|
|
powerMode: [PowerMode.DRX, Validators.required], |
|
|
|
edrxCycle: [{disabled: true, value: 0}], |
|
|
|
psmActivityTimer: [{disabled: true, value: 0}], |
|
|
|
pagingTransmissionWindow: [{disabled: true, value: 0}] |
|
|
|
edrxCycle: [{disabled: true, value: 0}, [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]], |
|
|
|
psmActivityTimer: [{disabled: true, value: 0}, [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]], |
|
|
|
pagingTransmissionWindow: [{disabled: true, value: 0}, [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]] |
|
|
|
})} |
|
|
|
); |
|
|
|
this.coapTransportConfigurationFormGroup.get('coapDeviceTypeConfiguration.coapDeviceType').valueChanges.pipe( |
|
|
|
@ -120,23 +120,14 @@ export class CoapDeviceProfileTransportConfigurationComponent implements Control |
|
|
|
if (powerMode === PowerMode.E_DRX) { |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.edrxCycle').enable({emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.pagingTransmissionWindow').enable({emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.edrxCycle') |
|
|
|
.setValidators([Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.pagingTransmissionWindow') |
|
|
|
.setValidators([Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]); |
|
|
|
this.clearValidatorsPSKMode(); |
|
|
|
this.disablePSKMode(); |
|
|
|
} else if (powerMode === PowerMode.PSM) { |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.psmActivityTimer').enable({emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.psmActivityTimer') |
|
|
|
.setValidators([Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]); |
|
|
|
this.clearValidatorsEdrxMode(); |
|
|
|
this.disableEdrxMode(); |
|
|
|
} else { |
|
|
|
this.clearValidatorsEdrxMode(); |
|
|
|
this.clearValidatorsPSKMode(); |
|
|
|
this.disableEdrxMode(); |
|
|
|
this.disablePSKMode(); |
|
|
|
} |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.edrxCycle').updateValueAndValidity({emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.pagingTransmissionWindow').updateValueAndValidity({emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.psmActivityTimer').updateValueAndValidity({emitEvent: false}); |
|
|
|
}); |
|
|
|
this.coapTransportConfigurationFormGroup.valueChanges.pipe( |
|
|
|
takeUntil(this.destroy$) |
|
|
|
@ -189,7 +180,15 @@ export class CoapDeviceProfileTransportConfigurationComponent implements Control |
|
|
|
|
|
|
|
writeValue(value: CoapDeviceProfileTransportConfiguration | null): void { |
|
|
|
if (isDefinedAndNotNull(value)) { |
|
|
|
if (!value.clientSettings) { |
|
|
|
value.clientSettings = { |
|
|
|
powerMode: PowerMode.DRX |
|
|
|
}; |
|
|
|
} |
|
|
|
this.coapTransportConfigurationFormGroup.patchValue(value, {emitEvent: false}); |
|
|
|
if (!this.disabled) { |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.powerMode').updateValueAndValidity({onlySelf: true}); |
|
|
|
} |
|
|
|
this.updateCoapDeviceTypeBasedControls(value.coapDeviceTypeConfiguration?.coapDeviceType); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -203,18 +202,15 @@ export class CoapDeviceProfileTransportConfigurationComponent implements Control |
|
|
|
this.propagateChange(configuration); |
|
|
|
} |
|
|
|
|
|
|
|
private clearValidatorsPSKMode() { |
|
|
|
private disablePSKMode() { |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.psmActivityTimer').disable({emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.psmActivityTimer').reset(0, {emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.psmActivityTimer').clearValidators(); |
|
|
|
} |
|
|
|
|
|
|
|
private clearValidatorsEdrxMode() { |
|
|
|
private disableEdrxMode() { |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.edrxCycle').disable({emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.edrxCycle').reset(0, {emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.edrxCycle').clearValidators(); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.pagingTransmissionWindow').disable({emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.pagingTransmissionWindow').reset(0, {emitEvent: false}); |
|
|
|
this.coapTransportConfigurationFormGroup.get('clientSettings.pagingTransmissionWindow').clearValidators(); |
|
|
|
} |
|
|
|
} |
|
|
|
|