Browse Source

Added PowerSavingConfiguretion for Coap device and profile

pull/4958/head
YevhenBondarenko 5 years ago
committed by Andrew Shvayka
parent
commit
b3d988cbbf
  1. 2
      common/data/src/main/java/org/thingsboard/server/common/data/device/data/CoapDeviceTransportConfiguration.java
  2. 6
      common/data/src/main/java/org/thingsboard/server/common/data/device/data/Lwm2mDeviceTransportConfiguration.java
  3. 26
      common/data/src/main/java/org/thingsboard/server/common/data/device/data/PowerSavingConfiguration.java
  4. 6
      common/data/src/main/java/org/thingsboard/server/common/data/device/data/lwm2m/OtherConfiguration.java
  5. 2
      common/data/src/main/java/org/thingsboard/server/common/data/device/profile/CoapDeviceProfileTransportConfiguration.java

2
common/data/src/main/java/org/thingsboard/server/common/data/device/data/CoapDeviceTransportConfiguration.java

@ -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<>();

6
common/data/src/main/java/org/thingsboard/server/common/data/device/data/Lwm2mDeviceTransportConfiguration.java

@ -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<>();

26
common/data/src/main/java/org/thingsboard/server/common/data/device/data/PowerSavingConfiguration.java

@ -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;
}

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

@ -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;

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

@ -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() {

Loading…
Cancel
Save