Commit c03893fb570ae659e41493f4801d62463207d956

Authored by nickAS21
1 parent 427ab874

LWM2M: fix bug update FwUrl in client after change in profile

... ... @@ -36,6 +36,8 @@ import java.util.concurrent.Executors;
36 36 import java.util.concurrent.ScheduledExecutorService;
37 37 import java.util.concurrent.TimeUnit;
38 38
  39 +import static org.eclipse.californium.core.network.config.NetworkConfigDefaults.DEFAULT_BLOCKWISE_STATUS_LIFETIME;
  40 +
39 41 @Slf4j
40 42 @Component
41 43 @TbCoapServerComponent
... ... @@ -91,7 +93,21 @@ public class DefaultCoapServerService implements CoapServerService {
91 93 InetAddress addr = InetAddress.getByName(coapServerContext.getHost());
92 94 InetSocketAddress sockAddr = new InetSocketAddress(addr, coapServerContext.getPort());
93 95 noSecCoapEndpointBuilder.setInetSocketAddress(sockAddr);
94   - noSecCoapEndpointBuilder.setNetworkConfig(NetworkConfig.getStandard());
  96 +
  97 + NetworkConfig coapConfig = new NetworkConfig();
  98 + coapConfig.setInt(NetworkConfig.Keys.COAP_PORT, 5683);
  99 + coapConfig.setInt(NetworkConfig.Keys.COAP_SECURE_PORT, 5684);
  100 + coapConfig.setBoolean(NetworkConfig.Keys.BLOCKWISE_STRICT_BLOCK2_OPTION, true);
  101 + coapConfig.setBoolean(NetworkConfig.Keys.BLOCKWISE_ENTITY_TOO_LARGE_AUTO_FAILOVER, true);
  102 + coapConfig.setLong(NetworkConfig.Keys.BLOCKWISE_STATUS_LIFETIME, DEFAULT_BLOCKWISE_STATUS_LIFETIME);
  103 + coapConfig.setInt(NetworkConfig.Keys.MAX_RESOURCE_BODY_SIZE, 256 * 1024 * 1024);
  104 + coapConfig.setString(NetworkConfig.Keys.RESPONSE_MATCHING, "RELAXED");
  105 + coapConfig.setInt(NetworkConfig.Keys.PREFERRED_BLOCK_SIZE, 1024);
  106 + coapConfig.setInt(NetworkConfig.Keys.MAX_MESSAGE_SIZE, 1024);
  107 +
  108 + coapConfig.setInt(NetworkConfig.Keys.MAX_RETRANSMIT, 10);
  109 +
  110 + noSecCoapEndpointBuilder.setNetworkConfig(coapConfig);
95 111 CoapEndpoint noSecCoapEndpoint = noSecCoapEndpointBuilder.build();
96 112 server.addEndpoint(noSecCoapEndpoint);
97 113
... ...
... ... @@ -18,11 +18,12 @@ package org.thingsboard.server.transport.coap;
18 18 import lombok.extern.slf4j.Slf4j;
19 19 import org.eclipse.californium.core.CoapResource;
20 20 import org.eclipse.californium.core.CoapServer;
  21 +import org.eclipse.californium.core.network.config.NetworkConfig;
21 22 import org.springframework.beans.factory.annotation.Autowired;
22 23 import org.springframework.stereotype.Service;
23   -import org.thingsboard.server.common.data.TbTransportService;
24 24 import org.thingsboard.server.coapserver.CoapServerService;
25 25 import org.thingsboard.server.coapserver.TbCoapServerComponent;
  26 +import org.thingsboard.server.common.data.TbTransportService;
26 27 import org.thingsboard.server.common.data.ota.OtaPackageType;
27 28 import org.thingsboard.server.transport.coap.efento.CoapEfentoTransportResource;
28 29
... ... @@ -30,6 +31,8 @@ import javax.annotation.PostConstruct;
30 31 import javax.annotation.PreDestroy;
31 32 import java.net.UnknownHostException;
32 33
  34 +import static org.eclipse.californium.core.network.config.NetworkConfigDefaults.DEFAULT_BLOCKWISE_STATUS_LIFETIME;
  35 +
33 36 @Service("CoapTransportService")
34 37 @TbCoapServerComponent
35 38 @Slf4j
... ... @@ -52,6 +55,14 @@ public class CoapTransportService implements TbTransportService {
52 55 public void init() throws UnknownHostException {
53 56 log.info("Starting CoAP transport...");
54 57 coapServer = coapServerService.getCoapServer();
  58 + coapServer.getConfig().setBoolean(NetworkConfig.Keys.BLOCKWISE_STRICT_BLOCK2_OPTION, true);
  59 + coapServer.getConfig().setBoolean(NetworkConfig.Keys.BLOCKWISE_ENTITY_TOO_LARGE_AUTO_FAILOVER, true);
  60 + coapServer.getConfig().setLong(NetworkConfig.Keys.BLOCKWISE_STATUS_LIFETIME, DEFAULT_BLOCKWISE_STATUS_LIFETIME);
  61 + coapServer.getConfig().setInt(NetworkConfig.Keys.MAX_RESOURCE_BODY_SIZE, 256 * 1024 * 1024);
  62 + coapServer.getConfig().setString(NetworkConfig.Keys.RESPONSE_MATCHING, "RELAXED");
  63 + coapServer.getConfig().setInt(NetworkConfig.Keys.PREFERRED_BLOCK_SIZE, 1024);
  64 + coapServer.getConfig().setInt(NetworkConfig.Keys.MAX_MESSAGE_SIZE, 1024);
  65 + coapServer.getConfig().setInt(NetworkConfig.Keys.MAX_RETRANSMIT, 10);
55 66 CoapResource api = new CoapResource(API);
56 67 api.add(new CoapTransportResource(coapTransportContext, coapServerService, V1));
57 68
... ...
... ... @@ -17,11 +17,13 @@ package org.thingsboard.server.transport.coap;
17 17
18 18 import lombok.extern.slf4j.Slf4j;
19 19 import org.eclipse.californium.core.coap.CoAP;
  20 +import org.eclipse.californium.core.coap.MediaTypeRegistry;
20 21 import org.eclipse.californium.core.coap.Request;
21 22 import org.eclipse.californium.core.coap.Response;
22 23 import org.eclipse.californium.core.network.Exchange;
23 24 import org.eclipse.californium.core.server.resources.CoapExchange;
24 25 import org.eclipse.californium.core.server.resources.Resource;
  26 +import org.thingsboard.common.util.ThingsBoardExecutors;
25 27 import org.thingsboard.server.common.data.DeviceTransportType;
26 28 import org.thingsboard.server.common.data.StringUtils;
27 29 import org.thingsboard.server.common.data.ota.OtaPackageType;
... ... @@ -32,16 +34,21 @@ import org.thingsboard.server.gen.transport.TransportProtos;
32 34 import java.util.List;
33 35 import java.util.Optional;
34 36 import java.util.UUID;
  37 +import java.util.concurrent.ExecutorService;
35 38
36 39 @Slf4j
37 40 public class OtaPackageTransportResource extends AbstractCoapTransportResource {
38 41 private static final int ACCESS_TOKEN_POSITION = 2;
39 42
40 43 private final OtaPackageType otaPackageType;
  44 + private final ExecutorService sendOtaDataOutUriLarge;
41 45
42 46 public OtaPackageTransportResource(CoapTransportContext ctx, OtaPackageType otaPackageType) {
43 47 super(ctx, otaPackageType.getKeyPrefix());
44 48 this.otaPackageType = otaPackageType;
  49 +
  50 + this.setObservable(true);
  51 + this.sendOtaDataOutUriLarge = ThingsBoardExecutors.newWorkStealingPool(10, "LwM2M sendOtaDataOutUriLarge");
45 52 }
46 53
47 54 @Override
... ... @@ -132,11 +139,13 @@ public class OtaPackageTransportResource extends AbstractCoapTransportResource {
132 139 Response response = new Response(CoAP.ResponseCode.CONTENT);
133 140 if (data != null && data.length > 0) {
134 141 response.setPayload(data);
  142 + response.getOptions().setAccept(MediaTypeRegistry.APPLICATION_OCTET_STREAM);
135 143 if (exchange.getRequestOptions().getBlock2() != null) {
136 144 int chunkSize = exchange.getRequestOptions().getBlock2().getSzx();
137   - boolean lastFlag = data.length > chunkSize;
138   - response.getOptions().setBlock2(chunkSize, lastFlag, 0);
139   - }
  145 + boolean lastFlag = data.length <= chunkSize;
  146 + this.sendOtaDataOutUriLarge.submit(() -> {
  147 + response.getOptions().setBlock2(chunkSize, lastFlag, 0);
  148 + }); }
140 149 exchange.respond(response);
141 150 }
142 151 }
... ...
... ... @@ -58,10 +58,12 @@ public class LwM2mCredentialsSecurityInfoValidator {
58 58 public TbLwM2MSecurityInfo getEndpointSecurityInfoByCredentialsId(String credentialsId, LwM2mTransportUtil.LwM2mTypeServer keyValue) {
59 59 CountDownLatch latch = new CountDownLatch(1);
60 60 final TbLwM2MSecurityInfo[] resultSecurityStore = new TbLwM2MSecurityInfo[1];
  61 + log.warn("001) [{}]", credentialsId);
61 62 context.getTransportService().process(ValidateDeviceLwM2MCredentialsRequestMsg.newBuilder().setCredentialsId(credentialsId).build(),
62 63 new TransportServiceCallback<>() {
63 64 @Override
64 65 public void onSuccess(ValidateDeviceCredentialsResponse msg) {
  66 + log.warn("002) [{}] [{}]", credentialsId, msg);
65 67 String credentialsBody = msg.getCredentials();
66 68 resultSecurityStore[0] = createSecurityInfo(credentialsId, credentialsBody, keyValue);
67 69 resultSecurityStore[0].setMsg(msg);
... ... @@ -71,6 +73,7 @@ public class LwM2mCredentialsSecurityInfoValidator {
71 73
72 74 @Override
73 75 public void onError(Throwable e) {
  76 + log.warn("003) [{}] [{}] Failed to process credentials ", credentialsId, e);
74 77 log.trace("[{}] [{}] Failed to process credentials ", credentialsId, e);
75 78 resultSecurityStore[0] = createSecurityInfo(credentialsId, null, null);
76 79 latch.countDown();
... ...
... ... @@ -25,8 +25,6 @@ import org.eclipse.californium.core.server.resources.CoapExchange;
25 25 import org.eclipse.californium.core.server.resources.Resource;
26 26 import org.eclipse.californium.core.server.resources.ResourceObserver;
27 27 import org.thingsboard.server.cache.ota.OtaPackageDataCache;
28   -import org.thingsboard.server.transport.lwm2m.server.uplink.DefaultLwM2MUplinkMsgHandler;
29   -import org.thingsboard.server.transport.lwm2m.server.uplink.LwM2mUplinkMsgHandler;
30 28
31 29 import java.util.UUID;
32 30 import java.util.concurrent.ConcurrentHashMap;
... ... @@ -143,7 +141,7 @@ public class LwM2mTransportCoapResource extends AbstractLwM2mTransportResource {
143 141 response.setPayload(fwData);
144 142 if (exchange.getRequestOptions().getBlock2() != null) {
145 143 int chunkSize = exchange.getRequestOptions().getBlock2().getSzx();
146   - boolean lastFlag = fwData.length > chunkSize;
  144 + boolean lastFlag = fwData.length <= chunkSize;
147 145 response.getOptions().setBlock2(chunkSize, lastFlag, 0);
148 146 log.warn("92) with blokc2 Send currentId: [{}], length: [{}], chunkSize [{}], moreFlag [{}]", currentId.toString(), fwData.length, chunkSize, lastFlag);
149 147 }
... ...
... ... @@ -33,6 +33,7 @@ import org.thingsboard.server.gen.transport.TransportProtos;
33 33 import org.thingsboard.server.queue.util.TbLwM2mTransportComponent;
34 34 import org.thingsboard.server.transport.lwm2m.config.LwM2MTransportServerConfig;
35 35 import org.thingsboard.server.transport.lwm2m.server.LwM2MFirmwareUpdateStrategy;
  36 +import org.thingsboard.server.transport.lwm2m.server.LwM2MSoftwareUpdateStrategy;
36 37 import org.thingsboard.server.transport.lwm2m.server.LwM2mTransportServerHelper;
37 38 import org.thingsboard.server.transport.lwm2m.server.LwM2mTransportUtil;
38 39 import org.thingsboard.server.transport.lwm2m.server.UpdateResultFw;
... ... @@ -175,6 +176,24 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl
175 176 }
176 177
177 178 @Override
  179 + public void onCurrentFirmwareStrategyUpdate(LwM2mClient client, Integer newStrategy, String newBaseUrl) {
  180 + log.debug("[{}] Current fw strategy: {}", client.getEndpoint(), newStrategy);
  181 + LwM2MClientOtaInfo fwInfo = getOrInitFwInfo(client);
  182 + fwInfo.setFwStrategy(LwM2MFirmwareUpdateStrategy.fromStrategyFwByCode(newStrategy));
  183 + fwInfo.setBaseUrl(newBaseUrl);
  184 + startFirmwareUpdateIfNeeded(client, fwInfo);
  185 + }
  186 +
  187 + @Override
  188 + public void onCurrentSoftwareStrategyUpdate(LwM2mClient client, Integer newStrategy, String newBaseUrl) {
  189 + log.debug("[{}] Current sw strategy: {}", client.getEndpoint(), newStrategy);
  190 + LwM2MClientOtaInfo swInfo = getOrInitSwInfo(client);
  191 + swInfo.setSwStrategy(LwM2MSoftwareUpdateStrategy.fromStrategySwByCode(newStrategy));
  192 + swInfo.setBaseUrl(newBaseUrl);
  193 + startSoftwareUpdateIfNeeded(client, swInfo);
  194 + }
  195 +
  196 + @Override
178 197 public void onCurrentFirmwareVersion3Update(LwM2mClient client, String version) {
179 198 log.debug("[{}] Current fw version: {}", client.getEndpoint(), version);
180 199 LwM2MClientOtaInfo fwInfo = getOrInitFwInfo(client);
... ... @@ -250,6 +269,10 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl
250 269 }
251 270 }
252 271
  272 + private void startSoftwareUpdateIfNeeded(LwM2mClient client, LwM2MClientOtaInfo swInfo) {
  273 +
  274 + }
  275 +
253 276 private void startFirmwareUpdateUsingUrl(LwM2mClient client, String url) {
254 277 String targetIdVer = convertObjectIdToVersionedId(FW_URL_ID, client.getRegistration());
255 278 TbLwM2MWriteReplaceRequest request = TbLwM2MWriteReplaceRequest.builder().versionedId(targetIdVer).value(url).timeout(config.getTimeout()).build();
... ... @@ -277,7 +300,7 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl
277 300 UUID otaPackageId = new UUID(response.getOtaPackageIdMSB(), response.getOtaPackageIdLSB());
278 301 LwM2MFirmwareUpdateStrategy strategy;
279 302 if (fwInfo.getDeliveryMethod() == null || fwInfo.getDeliveryMethod() == 2) {
280   - strategy = fwInfo.getStrategy();
  303 + strategy = fwInfo.getFwStrategy();
281 304 } else {
282 305 strategy = fwInfo.getDeliveryMethod() == 0 ? LwM2MFirmwareUpdateStrategy.OBJ_5_TEMP_URL : LwM2MFirmwareUpdateStrategy.OBJ_5_BINARY;
283 306 }
... ... @@ -328,9 +351,9 @@ public class DefaultLwM2MOtaUpdateService extends LwM2MExecutorAwareService impl
328 351 return Optional.empty();
329 352 }
330 353
331   - private LwM2MClientOtaInfo getOrInitFwInfo(LwM2mClient client) {
  354 + public LwM2MClientOtaInfo getOrInitFwInfo(LwM2mClient client) {
332 355 //TODO: fetch state from the cache or DB.
333   - return fwStates.computeIfAbsent(client.getEndpoint(), endpoint -> {
  356 + return this.fwStates.computeIfAbsent(client.getEndpoint(), endpoint -> {
334 357 var profile = clientContext.getProfile(client.getProfileId());
335 358 return new LwM2MClientOtaInfo(endpoint, OtaPackageType.FIRMWARE, profile.getClientLwM2mSettings().getFwUpdateStrategy(),
336 359 profile.getClientLwM2mSettings().getFwUpdateRecourse());
... ...
... ... @@ -19,8 +19,9 @@ import lombok.Data;
19 19 import org.thingsboard.server.common.data.StringUtils;
20 20 import org.thingsboard.server.common.data.ota.OtaPackageType;
21 21 import org.thingsboard.server.transport.lwm2m.server.LwM2MFirmwareUpdateStrategy;
22   -import org.thingsboard.server.transport.lwm2m.server.UpdateStateFw;
  22 +import org.thingsboard.server.transport.lwm2m.server.LwM2MSoftwareUpdateStrategy;
23 23 import org.thingsboard.server.transport.lwm2m.server.UpdateResultFw;
  24 +import org.thingsboard.server.transport.lwm2m.server.UpdateStateFw;
24 25
25 26 import java.util.Optional;
26 27
... ... @@ -44,7 +45,8 @@ public class LwM2MClientOtaInfo {
44 45 private Integer deliveryMethod;
45 46
46 47 //TODO: use value from device if applicable;
47   - private LwM2MFirmwareUpdateStrategy strategy;
  48 + private LwM2MFirmwareUpdateStrategy fwStrategy;
  49 + private LwM2MSoftwareUpdateStrategy swStrategy;
48 50 private UpdateStateFw updateState;
49 51 private UpdateResultFw updateResult;
50 52
... ... @@ -54,7 +56,7 @@ public class LwM2MClientOtaInfo {
54 56 public LwM2MClientOtaInfo(String endpoint, OtaPackageType type, Integer strategyCode, String baseUrl) {
55 57 this.endpoint = endpoint;
56 58 this.type = type;
57   - this.strategy = LwM2MFirmwareUpdateStrategy.fromStrategyFwByCode(strategyCode);
  59 + this.fwStrategy = LwM2MFirmwareUpdateStrategy.fromStrategyFwByCode(strategyCode);
58 60 this.baseUrl = baseUrl;
59 61 }
60 62
... ...
... ... @@ -31,6 +31,10 @@ public interface LwM2MOtaUpdateService {
31 31
32 32 void onCurrentFirmwareNameUpdate(LwM2mClient client, String name);
33 33
  34 + void onCurrentFirmwareStrategyUpdate(LwM2mClient client, Integer newStrategy, String newBaseUrl);
  35 +
  36 + void onCurrentSoftwareStrategyUpdate(LwM2mClient client, Integer newStrategy, String newBaseUrl);
  37 +
34 38 void onCurrentFirmwareVersion3Update(LwM2mClient client, String version);
35 39
36 40 void onCurrentFirmwareVersion5Update(LwM2mClient client, String version);
... ...
... ... @@ -37,7 +37,6 @@ import org.eclipse.leshan.server.registration.Registration;
37 37 import org.springframework.context.annotation.Lazy;
38 38 import org.springframework.stereotype.Service;
39 39 import org.thingsboard.common.util.DonAsynchron;
40   -import org.thingsboard.common.util.ThingsBoardExecutors;
41 40 import org.thingsboard.server.cache.ota.OtaPackageDataCache;
42 41 import org.thingsboard.server.common.data.Device;
43 42 import org.thingsboard.server.common.data.DeviceProfile;
... ... @@ -53,6 +52,8 @@ import org.thingsboard.server.gen.transport.TransportProtos.SessionEvent;
53 52 import org.thingsboard.server.gen.transport.TransportProtos.SessionInfoProto;
54 53 import org.thingsboard.server.queue.util.TbLwM2mTransportComponent;
55 54 import org.thingsboard.server.transport.lwm2m.config.LwM2MTransportServerConfig;
  55 +import org.thingsboard.server.transport.lwm2m.server.LwM2MFirmwareUpdateStrategy;
  56 +import org.thingsboard.server.transport.lwm2m.server.LwM2MSoftwareUpdateStrategy;
56 57 import org.thingsboard.server.transport.lwm2m.server.LwM2mOtaConvert;
57 58 import org.thingsboard.server.transport.lwm2m.server.LwM2mQueuedRequest;
58 59 import org.thingsboard.server.transport.lwm2m.server.LwM2mSessionMsgListener;
... ... @@ -100,7 +101,6 @@ import java.util.Set;
100 101 import java.util.UUID;
101 102 import java.util.concurrent.ConcurrentHashMap;
102 103 import java.util.concurrent.CountDownLatch;
103   -import java.util.concurrent.ExecutorService;
104 104 import java.util.concurrent.TimeUnit;
105 105 import java.util.stream.Collectors;
106 106
... ... @@ -779,6 +779,29 @@ public class DefaultLwM2MUplinkMsgHandler extends LwM2MExecutorAwareService impl
779 779 clients.forEach(client -> sendCancelObserveRequest(targetId, client));
780 780 }
781 781 }
  782 +
  783 + // # 7.1
  784 + // update value in fwInfo
  785 + if (!newProfile.getClientLwM2mSettings().getFwUpdateStrategy().equals(oldProfile.getClientLwM2mSettings().getFwUpdateStrategy())
  786 + || (LwM2MFirmwareUpdateStrategy.OBJ_5_TEMP_URL.code == newProfile.getClientLwM2mSettings().getFwUpdateStrategy() &&
  787 + !newProfile.getClientLwM2mSettings().getFwUpdateRecourse().equals(oldProfile.getClientLwM2mSettings().getFwUpdateRecourse()))) {
  788 + clients.forEach(lwM2MClient -> {
  789 + otaService.onCurrentFirmwareStrategyUpdate(lwM2MClient,
  790 + newProfile.getClientLwM2mSettings().getFwUpdateStrategy(),
  791 + newProfile.getClientLwM2mSettings().getFwUpdateRecourse());
  792 + });
  793 + }
  794 +
  795 + //# 7.2 // update value in swInfo
  796 + if (!newProfile.getClientLwM2mSettings().getSwUpdateStrategy().equals(oldProfile.getClientLwM2mSettings().getSwUpdateStrategy())
  797 + || (LwM2MSoftwareUpdateStrategy.TEMP_URL.code == newProfile.getClientLwM2mSettings().getSwUpdateStrategy() &&
  798 + !newProfile.getClientLwM2mSettings().getSwUpdateRecourse().equals(oldProfile.getClientLwM2mSettings().getSwUpdateRecourse()))) {
  799 + clients.forEach(lwM2MClient -> {
  800 + otaService.onCurrentSoftwareStrategyUpdate(lwM2MClient,
  801 + newProfile.getClientLwM2mSettings().getFwUpdateStrategy(),
  802 + newProfile.getClientLwM2mSettings().getFwUpdateRecourse());
  803 + });
  804 + }
782 805 }
783 806 }
784 807
... ...
... ... @@ -160,9 +160,9 @@
160 160 <!-- <div fxLayout="column">-->
161 161 <!-- <mat-form-field class="mat-block">-->
162 162 <!-- <mat-label>{{ 'device-profile.lwm2m.client-strategy-label' | translate }}</mat-label>-->
163   -<!-- <mat-select formControlName="clientStrategy"-->
  163 +<!-- <mat-select formControlName="clientOnlyObserveAfterConnect"-->
164 164 <!-- matTooltip="{{ 'device-profile.lwm2m.client-strategy-tip' | translate:-->
165   -<!-- { count: +lwm2mDeviceProfileFormGroup.get('clientStrategy').value } }}"-->
  165 +<!-- { count: +lwm2mDeviceProfileFormGroup.get('clientOnlyObserveAfterConnect').value } }}"-->
166 166 <!-- matTooltipPosition="above">-->
167 167 <!-- <mat-option value=1>{{ 'device-profile.lwm2m.client-strategy-connect' | translate:-->
168 168 <!-- {count: 1} }}</mat-option>-->
... ...
... ... @@ -97,7 +97,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro
97 97 binding: [],
98 98 bootstrapServer: [null, Validators.required],
99 99 lwm2mServer: [null, Validators.required],
100   - clientStrategy: [1, []],
  100 + clientOnlyObserveAfterConnect: [1, []],
101 101 fwUpdateStrategy: [1, []],
102 102 swUpdateStrategy: [1, []],
103 103 fwUpdateRecourse: [{value: '', disabled: true}, []],
... ... @@ -216,7 +216,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro
216 216 binding: this.configurationValue.bootstrap.servers.binding,
217 217 bootstrapServer: this.configurationValue.bootstrap.bootstrapServer,
218 218 lwm2mServer: this.configurationValue.bootstrap.lwm2mServer,
219   - clientStrategy: this.configurationValue.clientLwM2mSettings.clientStrategy,
  219 + clientOnlyObserveAfterConnect: this.configurationValue.clientLwM2mSettings.clientOnlyObserveAfterConnect,
220 220 fwUpdateStrategy: this.configurationValue.clientLwM2mSettings.fwUpdateStrategy || 1,
221 221 swUpdateStrategy: this.configurationValue.clientLwM2mSettings.swUpdateStrategy || 1,
222 222 fwUpdateRecourse: fwResource,
... ... @@ -257,7 +257,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro
257 257 bootstrapServers.defaultMinPeriod = config.defaultMinPeriod;
258 258 bootstrapServers.notifIfDisabled = config.notifIfDisabled;
259 259 bootstrapServers.binding = config.binding;
260   - this.configurationValue.clientLwM2mSettings.clientStrategy = config.clientStrategy;
  260 + this.configurationValue.clientLwM2mSettings.clientOnlyObserveAfterConnect = config.clientOnlyObserveAfterConnect;
261 261 this.configurationValue.clientLwM2mSettings.fwUpdateStrategy = config.fwUpdateStrategy;
262 262 this.configurationValue.clientLwM2mSettings.swUpdateStrategy = config.swUpdateStrategy;
263 263 this.configurationValue.clientLwM2mSettings.fwUpdateRecourse = config.fwUpdateRecourse;
... ...
... ... @@ -168,7 +168,7 @@ export interface Lwm2mProfileConfigModels {
168 168 }
169 169
170 170 export interface ClientLwM2mSettings {
171   - clientStrategy: string;
  171 + clientOnlyObserveAfterConnect: number;
172 172 fwUpdateStrategy: number;
173 173 swUpdateStrategy: number;
174 174 fwUpdateRecourse: string;
... ... @@ -240,7 +240,7 @@ export function getDefaultProfileConfig(hostname?: any): Lwm2mProfileConfigModel
240 240
241 241 function getDefaultProfileClientLwM2mSettingsConfig(): ClientLwM2mSettings {
242 242 return {
243   - clientStrategy: '1',
  243 + clientOnlyObserveAfterConnect: 1,
244 244 fwUpdateStrategy: 1,
245 245 swUpdateStrategy: 1,
246 246 fwUpdateRecourse: DEFAULT_FW_UPDATE_RESOURCE,
... ...