Skip to content

Commit

Permalink
Update BdxOtaSender to only cease polling upon successful transfer of…
Browse files Browse the repository at this point in the history
… the bulk data
  • Loading branch information
harsha-rajendran committed Nov 16, 2022
1 parent 700ee0e commit 954986a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/ota-provider-app/esp32/main/BdxOtaSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ void BdxOtaSender::HandleTransferSessionOutput(TransferSession::OutputEvent & ev
{
ChipLogError(BDX, "onTransferComplete Callback not set");
}
mStopPolling = true; // Stop polling the TransferSession only after receiving BlockAckEOF
Reset();
break;
case TransferSession::OutputEventType::kStatusReceived:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ void BdxOtaSender::HandleTransferSessionOutput(TransferSession::OutputEvent & ev
break;
case TransferSession::OutputEventType::kAckEOFReceived:
ChipLogDetail(BDX, "Transfer completed, got AckEOF");
mStopPolling = true; // Stop polling the TransferSession only after receiving BlockAckEOF
Reset();
break;
case TransferSession::OutputEventType::kStatusReceived:
Expand Down
4 changes: 2 additions & 2 deletions scripts/tests/ota_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux "$OTA_PROVI

echo "Test" >"$FIRMWARE_BIN"

rm /tmp/chip_*
rm -f /tmp/chip_*

./src/app/ota_image_tool.py create -v 0xDEAD -p 0xBEEF -vn 10 -vs "10.0" -da sha256 "$FIRMWARE_BIN" "$FIRMWARE_OTA"

Expand Down Expand Up @@ -75,7 +75,7 @@ else
RETURN_VALUE=1
fi

killall -e "$OTA_PROVIDER_APP" "$OTA_REQUESTOR_APP"
killall -s SIGKILL -e "$OTA_PROVIDER_APP" "$OTA_REQUESTOR_APP"
rm -f "$FIRMWARE_OTA" "$FIRMWARE_BIN" "$OTA_DOWNLOAD_PATH"

echo "$TEST_RESULT"
Expand Down
1 change: 0 additions & 1 deletion src/protocols/bdx/TransferFacilitator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ CHIP_ERROR Responder::PrepareForTransfer(System::Layer * layer, TransferRole rol
void Responder::ResetTransfer()
{
mTransfer.Reset();
mStopPolling = true;
}

CHIP_ERROR Initiator::InitiateTransfer(System::Layer * layer, TransferRole role, const TransferSession::TransferInitData & initData,
Expand Down

0 comments on commit 954986a

Please sign in to comment.