Merge pull request #5741 from thingsboard/lwm2m_bs_BC68

lwm2m: BootstrapRead_fix_bug
This commit is contained in:
Yevhen Bondarenko 2021-12-17 14:38:41 +02:00 committed by GitHub
commit 3ab3c0caa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@ public class LwM2MBootstrapConfigStoreTaskProvider implements BootstrapTaskProvi
this.initAfterBootstrapDiscover(discoverResponse); this.initAfterBootstrapDiscover(discoverResponse);
findSecurityInstanceId(discoverResponse.getObjectLinks()); findSecurityInstanceId(discoverResponse.getObjectLinks());
} else { } else {
log.info( log.warn(
"Bootstrap Discover return error {} : to continue bootstrap session without autoIdForSecurityObject mode. {}", "Bootstrap Discover return error {} : to continue bootstrap session without autoIdForSecurityObject mode. {}",
discoverResponse, session); discoverResponse, session);
} }
@ -100,7 +100,13 @@ public class LwM2MBootstrapConfigStoreTaskProvider implements BootstrapTaskProvi
return tasks; return tasks;
} }
BootstrapReadResponse readResponse = (BootstrapReadResponse) previousResponse.get(0); BootstrapReadResponse readResponse = (BootstrapReadResponse) previousResponse.get(0);
findServerInstanceId(readResponse); if (readResponse.isSuccess()) {
findServerInstanceId(readResponse);
} else {
log.warn(
"Bootstrap ReadResponse return error {} : to continue bootstrap session without find Server Instance Id. {}",
readResponse, session);
}
// create requests from config // create requests from config
tasks.requestsToSend = this.toRequests(config, tasks.requestsToSend = this.toRequests(config,
config.contentFormat != null ? config.contentFormat : session.getContentFormat()); config.contentFormat != null ? config.contentFormat : session.getContentFormat());