Skip to content

Commit

Permalink
Code review changes.
Browse files Browse the repository at this point in the history
- Renamed prevPercentageComplete to mPrevPercentageComplete
  • Loading branch information
isiu-apple committed Mar 3, 2022
1 parent e771a84 commit 0c6e727
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/app/clusters/ota-requestor/BDXDownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ System::Clock::Timeout BDXDownloader::GetTimeout()

void BDXDownloader::Reset()
{
prevPercentageComplete = 0;
mPrevPercentageComplete = 0;
DeviceLayer::SystemLayer().StartTimer(mTimeout, TransferTimeoutCheckHandler, this);
}

Expand All @@ -69,9 +69,9 @@ bool BDXDownloader::CheckTransferTimeout()
uint8_t curPercentageComplete =
mImageProcessor->GetPercentComplete().IsNull() ? 0 : mImageProcessor->GetPercentComplete().Value();

if (curPercentageComplete > prevPercentageComplete)
if (curPercentageComplete > mPrevPercentageComplete)
{
prevPercentageComplete = curPercentageComplete;
mPrevPercentageComplete = curPercentageComplete;
return false;
}
else
Expand Down Expand Up @@ -118,7 +118,7 @@ CHIP_ERROR BDXDownloader::BeginPrepareDownload()
VerifyOrReturnError(mState == State::kIdle, CHIP_ERROR_INCORRECT_STATE);
VerifyOrReturnError(mImageProcessor != nullptr, CHIP_ERROR_INCORRECT_STATE);

prevPercentageComplete = 0;
mPrevPercentageComplete = 0;
DeviceLayer::SystemLayer().StartTimer(mTimeout, TransferTimeoutCheckHandler, this);

ReturnErrorOnFailure(mImageProcessor->PrepareDownload());
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/ota-requestor/BDXDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class BDXDownloader : public chip::OTADownloader
// Timeout value in seconds to abort the download if there's no progress in the transfer session.
System::Clock::Timeout mTimeout = System::Clock::kZero;
// Tracks the percentage of transfer session complete from as of the previous check.
uint8_t prevPercentageComplete = 0;
uint8_t mPrevPercentageComplete = 0;
};

} // namespace chip

0 comments on commit 0c6e727

Please sign in to comment.