Skip to content

Commit

Permalink
[ota] use matter_ota_get_total_header_size instead of hardcoding it a…
Browse files Browse the repository at this point in the history
…s 32
  • Loading branch information
step0035 committed Jun 27, 2023
1 parent be833ed commit bc50699
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/Ameba/AmebaOTAImageProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void AmebaOTAImageProcessor::HandleProcessBlock(intptr_t context)

ByteSpan block = imageProcessor->mBlock;
CHIP_ERROR error = imageProcessor->ProcessHeader(block); // process matter ota header
uint8_t remainHeader = 32 - matter_ota_get_header_size(); // size of ameba header received
uint8_t remainHeader = matter_ota_get_total_header_size() - matter_ota_get_current_header_size(); // size of ameba header received
uint16_t writeLength = block.size(); // length of actual data to write to flash, excluding header
uint8_t *writePointer = (uint8_t*) block.data(); // pointer to the actual data to write to flash, excluding header

Expand Down

0 comments on commit bc50699

Please sign in to comment.