Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ef879ed
Example to check if we can register when the ApplyUpdatRequest is sen…
jtrejoespinoza-grid May 22, 2026
8a36708
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 25, 2026
6621c56
Added example to analyse the ApplyUpdateRequesSent from the provider
jtrejoespinoza-grid May 26, 2026
726f47d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 26, 2026
5beefde
Reduced version with steps 3,4,5
jtrejoespinoza-grid May 27, 2026
4f7ad30
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 27, 2026
567caa6
Log messages udpated
jtrejoespinoza-grid May 27, 2026
f4a985d
fix: Updated comments and typos in variable names
jtrejoespinoza-grid May 28, 2026
f95e1f5
Added test TC_SU_2_5 into nightly and uncomment the test CI job. Rest…
jtrejoespinoza-grid May 28, 2026
0d0b268
Added quiet to avoid requestor logs inthe stdout
jtrejoespinoza-grid May 28, 2026
391363c
Revert "Added quiet to avoid requestor logs inthe stdout"
jtrejoespinoza-grid May 28, 2026
6968d86
Revert "Added test TC_SU_2_5 into nightly and uncomment the test CI j…
jtrejoespinoza-grid May 28, 2026
78f3318
Test TC_SU_2_5 on CI. Revert when is ready
jtrejoespinoza-grid May 28, 2026
6632f7c
Terminate the provider after sendingtheapplyupdate request to avoid r…
jtrejoespinoza-grid Jun 2, 2026
b30dfe4
Removed extra asssert that is not needed
jtrejoespinoza-grid Jun 2, 2026
8a3aaa5
Merge branch 'master' into provide_apply_update_request_read
jtrejoespinoza-grid Jun 15, 2026
f7fdf7c
fix: lint issues replaced f strings
jtrejoespinoza-grid Jun 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

name: Daily Run for slow tests
on:
schedule:
- cron: '0 0 * * *'
# schedule:
# - cron: '0 0 * * *'
# --- TEST SECTION: Uncomment below to test on PRs ---
# push:
# branches:
# - master
# - 'v*-branch'
# pull_request:
# merge_group:
push:
branches:
- master
- 'v*-branch'
pull_request:
merge_group:
# --- END TEST SECTION ---
workflow_dispatch:
inputs:
Expand Down
28 changes: 28 additions & 0 deletions examples/ota-provider-app/linux/OtaProviderAppCommandDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ static std::string ToString(const Json::Value & v)
return Json::writeString(w, v);
}

Json::Value OtaProviderAppCommandHandler::BuildApplyUpdateRequestSnapshot(uint16_t endpoint)
{
Json::Value payload(Json::objectValue);
payload["VendorID"] = GetOtaProviderExample().GetVendorId();
payload["ProductID"] = GetOtaProviderExample().GetProductId();
payload["SoftwareVersion"] = GetOtaProviderExample().GetSoftwareVersion();
payload["ApplyUpdateRequestSentStatus"] = GetOtaProviderExample().GetApplyRequestSentStatus();
payload["ApplyUpdateRequestActionResponse"] = Json::UInt(GetOtaProviderExample().GetApplyRequestActionStatus());
payload["ApplyUpdateRequestDelayResponse"] = GetOtaProviderExample().GetApplyRequestDelayStatus();
payload["ApplyUpdateRequestCount"] = GetOtaProviderExample().GetApplyRequestCount();
return payload;
}

Json::Value OtaProviderAppCommandHandler::BuildOtaProviderSnapshot(uint16_t endpoint)
{
Json::Value payload(Json::objectValue);
Expand Down Expand Up @@ -132,6 +145,21 @@ void OtaProviderAppCommandHandler::HandleCommand(intptr_t context)
return;
}

if (name == "GetApplyUpdateRequestStatus")
{
Json::Value out(Json::objectValue);
out["Name"] = "ApplyUpdateRequestResponse";
out["Cluster"] = cluster;
out["Endpoint"] = endpoint;
out["Payload"] = self->BuildApplyUpdateRequestSnapshot(endpoint);

if (delegate && delegate->GetPipes())
{
delegate->GetPipes()->WriteToOutPipe(ToString(out));
}
return;
}

ChipLogError(NotSpecified, "Unhandled command: Should never happen");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class OtaProviderAppCommandHandler

static void HandleCommand(intptr_t context);

Json::Value BuildApplyUpdateRequestSnapshot(uint16_t endpoint);
Json::Value BuildOtaProviderSnapshot(uint16_t endpoint);

struct PrivateCtorTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ void OTAProviderExample::HandleApplyUpdateRequest(app::CommandHandler * commandO
response.action = mUpdateAction;
response.delayedActionTime = mDelayedApplyActionTimeSec;

// Values for named pipes
mApplyUpdateRequestCount++;
mApplyUpdateRequestSent = true;
mApplyUpdateRequestActionSent = mUpdateAction;
mApplyUpdateRequestDelaySent = mDelayedApplyActionTimeSec;

// Reset delay back to 0 for subsequent uses
mDelayedApplyActionTimeSec = 0;
// Reset back to success case for subsequent uses
Expand All @@ -525,6 +531,8 @@ void OTAProviderExample::HandleNotifyUpdateApplied(app::CommandHandler * command

GetUpdateTokenString(commandData.updateToken, tokenBuf, kUpdateTokenStrLen);
ChipLogDetail(SoftwareUpdate, "%s: token: %s, version: %" PRIu32, __FUNCTION__, tokenBuf, commandData.softwareVersion);
mApplyUpdateRequestSent = false;
mApplyUpdateRequestCount = 0;

commandObj->AddStatus(commandPath, Status::Success);
}
Expand Down
13 changes: 13 additions & 0 deletions examples/ota-provider-app/ota-provider-common/OTAProviderExample.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ class OTAProviderExample : public chip::app::Clusters::OTAProviderDelegate
uint16_t GetProductId() const { return mProductId; }
uint16_t GetHardwareVersion() const { return mHardwareVersion; }
uint32_t GetSoftwareVersion() const { return mRequestorSoftwareVersion; }
// Variables used for named pipes
bool GetApplyRequestSentStatus() const { return mApplyUpdateRequestSent; }
chip::app::Clusters::OtaSoftwareUpdateProvider::OTAApplyUpdateAction GetApplyRequestActionStatus() const
{
return mApplyUpdateRequestActionSent;
}
uint32_t GetApplyRequestDelayStatus() const { return mApplyUpdateRequestDelaySent; }
uint16_t GetApplyRequestCount() const { return mApplyUpdateRequestCount; }
// End of variables used for named pipes
chip::Span<const DownloadProtocolEnum> GetProtocolsSupported() const
{
return chip::Span<const DownloadProtocolEnum>(mProtocolsSupported);
Expand Down Expand Up @@ -161,4 +170,8 @@ class OTAProviderExample : public chip::app::Clusters::OTAProviderDelegate
DownloadProtocolEnum mProtocolsSupported[kMaxProtocolsSupported];
bool mRequestorCanConsent;
char mLocation[kMaxLocation] = { 0, 0, 0 };
bool mApplyUpdateRequestSent = false;
OTAApplyUpdateAction mApplyUpdateRequestActionSent;
uint32_t mApplyUpdateRequestDelaySent;
u_int16_t mApplyUpdateRequestCount = 0;
};
Loading
Loading