Skip to content

Commit

Permalink
[ota] Fix BDX downloader timeout (#16068)
Browse files Browse the repository at this point in the history
The code for checking the progress used a wrong counter.
That is, the counter of sent rather than queried blocks.
Consequently, the transfer would be interrupted after
5 minutes (the current timeout).
  • Loading branch information
Damian-Nordic authored and pull[bot] committed Dec 6, 2023
1 parent c325439 commit 7ded780
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/clusters/ota-requestor/BDXDownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void BDXDownloader::Reset()

bool BDXDownloader::HasTransferTimedOut()
{
uint32_t curBlockCounter = mBdxTransfer.GetNextBlockNum();
uint32_t curBlockCounter = mBdxTransfer.GetNextQueryNum();

if (curBlockCounter > mPrevBlockCounter)
{
Expand Down
3 changes: 2 additions & 1 deletion src/protocols/bdx/BdxTransferSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ class DLL_EXPORT TransferSession
uint64_t GetStartOffset() const { return mStartOffset; }
uint64_t GetTransferLength() const { return mTransferLength; }
uint16_t GetTransferBlockSize() const { return mTransferMaxBlockSize; }
uint32_t GetNextBlockNum() { return mNextBlockNum; }
uint32_t GetNextBlockNum() const { return mNextBlockNum; }
uint32_t GetNextQueryNum() const { return mNextQueryNum; }
size_t GetNumBytesProcessed() const { return mNumBytesProcessed; }
const uint8_t * GetFileDesignator(uint16_t & fileDesignatorLen) const
{
Expand Down

0 comments on commit 7ded780

Please sign in to comment.