Added PowerSavingConfiguretion for Coap device and profile

This commit is contained in:
YevhenBondarenko 2021-07-16 15:59:00 +03:00 committed by Andrew Shvayka
parent c173eef6d7
commit b3d988cbbf
5 changed files with 32 additions and 10 deletions

View File

@ -25,7 +25,7 @@ import java.util.HashMap;
import java.util.Map;
@Data
public class CoapDeviceTransportConfiguration implements DeviceTransportConfiguration {
public class CoapDeviceTransportConfiguration extends PowerSavingConfiguration implements DeviceTransportConfiguration {
@JsonIgnore
private Map<String, Object> properties = new HashMap<>();

View File

@ -25,11 +25,7 @@ import java.util.HashMap;
import java.util.Map;
@Data
public class Lwm2mDeviceTransportConfiguration implements DeviceTransportConfiguration {
private PowerMode powerMode;
private Long edrxCycle;
public class Lwm2mDeviceTransportConfiguration extends PowerSavingConfiguration implements DeviceTransportConfiguration {
@JsonIgnore
private Map<String, Object> properties = new HashMap<>();

View File

@ -0,0 +1,26 @@
/**
* Copyright © 2016-2021 The Thingsboard Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.thingsboard.server.common.data.device.data;
import lombok.Data;
@Data
public class PowerSavingConfiguration {
private PowerMode powerMode;
private Long psmActivityTimer;
private Long edrxCycle;
private Long pagingTransmissionWindow;
}

View File

@ -17,17 +17,15 @@ package org.thingsboard.server.common.data.device.data.lwm2m;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.thingsboard.server.common.data.device.data.PowerMode;
import org.thingsboard.server.common.data.device.data.PowerSavingConfiguration;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class OtherConfiguration {
public class OtherConfiguration extends PowerSavingConfiguration {
private Integer fwUpdateStrategy;
private Integer swUpdateStrategy;
private Integer clientOnlyObserveAfterConnect;
private PowerMode powerMode;
private Long edrxCycle;
private String fwUpdateResource;
private String swUpdateResource;
private boolean compositeOperationsSupport;

View File

@ -17,11 +17,13 @@ package org.thingsboard.server.common.data.device.profile;
import lombok.Data;
import org.thingsboard.server.common.data.DeviceTransportType;
import org.thingsboard.server.common.data.device.data.PowerSavingConfiguration;
@Data
public class CoapDeviceProfileTransportConfiguration implements DeviceProfileTransportConfiguration {
private CoapDeviceTypeConfiguration coapDeviceTypeConfiguration;
private PowerSavingConfiguration clientSettings;
@Override
public DeviceTransportType getType() {