Browse Source
Merge pull request #10703 from ivy-gmbh/fix/coap-blockwise-block-num-3.6.3
Always send back block num
pull/10713/head
Andrew Shvayka
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
1 deletions
-
common/transport/coap/src/main/java/org/thingsboard/server/transport/coap/OtaPackageTransportResource.java
|
|
|
@ -143,8 +143,9 @@ public class OtaPackageTransportResource extends AbstractCoapTransportResource { |
|
|
|
response.setPayload(data); |
|
|
|
if (exchange.getRequestOptions().getBlock2() != null) { |
|
|
|
int chunkSize = exchange.getRequestOptions().getBlock2().getSzx(); |
|
|
|
int blockNum = exchange.getRequestOptions().getBlock2().getNum(); |
|
|
|
boolean lastFlag = data.length <= chunkSize; |
|
|
|
response.getOptions().setBlock2(chunkSize, lastFlag, 0); |
|
|
|
response.getOptions().setBlock2(chunkSize, lastFlag, blockNum); |
|
|
|
} |
|
|
|
transportContext.getExecutor().submit(() -> exchange.respond(response)); |
|
|
|
} |
|
|
|
|