Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event support for OTA Requestor breaks m5stack build #13803

Closed
msandstedt opened this issue Jan 21, 2022 · 1 comment · Fixed by #13804
Closed

event support for OTA Requestor breaks m5stack build #13803

msandstedt opened this issue Jan 21, 2022 · 1 comment · Fixed by #13804

Comments

@msandstedt
Copy link
Contributor

Problem

At this commit::

commit d0d6dda77fed3b38864553e85b29465d6a32e56a
Author: Carol Yang <[email protected]>
Date:   Thu Jan 20 05:37:01 2022 -0800

    [OTA] Implement event support for OTA Requestor cluster (#13727)

m5stack build breaks as follows:

../../../../../../config/esp32/third_party/connectedhomeip/src/lib/shell/commands/Ota.cpp: In lambda function:
../../../../../../config/esp32/third_party/connectedhomeip/src/lib/shell/commands/Ota.cpp:72:91: error: no matching function for call to 'chip::OTARequestorInterface::NotifyUpdateApplied()'
     PlatformMgr().ScheduleWork([](intptr_t) { GetRequestorInstance()->NotifyUpdateApplied(); });
                                                                                           ^
In file included from ../../../../../../config/esp32/third_party/connectedhomeip/src/lib/shell/commands/Ota.cpp:24:
../../../../../../config/esp32/third_party/connectedhomeip/src/include/platform/OTARequestorInterface.h:68:18: note: candidate: 'virtual void chip::OTARequestorInterface::NotifyUpdateApplied(uint32_t)'
     virtual void NotifyUpdateApplied(uint32_t version) = 0;
                  ^~~~~~~~~~~~~~~~~~~
../../../../../../config/esp32/third_party/connectedhomeip/src/include/platform/OTARequestorInterface.h:68:18: note:   candidate expects 1 argument, 0 provided
At global scope:
cc1plus: error: unrecognized command line option '-Wno-unknown-warning-option' [-Werror]
cc1plus: all warnings being treated as errors

Proposed Solution

Fix Ota.cpp with something like the following:

diff --git a/src/lib/shell/commands/Ota.cpp b/src/lib/shell/commands/Ota.cpp
index 3d0d7ba6433..48414fbf138 100644
--- a/src/lib/shell/commands/Ota.cpp
+++ b/src/lib/shell/commands/Ota.cpp
@@ -62,14 +62,15 @@ CHIP_ERROR ApplyImageHandler(int argc, char ** argv)
 CHIP_ERROR NotifyImageHandler(int argc, char ** argv)
 {
     VerifyOrReturnError(GetRequestorInstance() != nullptr, CHIP_ERROR_INCORRECT_STATE);
-    VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);
+    VerifyOrReturnError(argc == 4, CHIP_ERROR_INVALID_ARGUMENT);
 
     const FabricIndex fabricIndex       = static_cast<FabricIndex>(strtoul(argv[0], nullptr, 10));
     const NodeId providerNodeId         = static_cast<NodeId>(strtoull(argv[1], nullptr, 10));
     const EndpointId providerEndpointId = static_cast<EndpointId>(strtoul(argv[2], nullptr, 10));
+    const intptr_t version = static_cast<intptr_t>(strtoul(argv[3], nullptr, 10));
 
     GetRequestorInstance()->TestModeSetProviderParameters(providerNodeId, fabricIndex, providerEndpointId);
-    PlatformMgr().ScheduleWork([](intptr_t) { GetRequestorInstance()->NotifyUpdateApplied(); });
+    PlatformMgr().ScheduleWork([](intptr_t arg) { GetRequestorInstance()->NotifyUpdateApplied(static_cast<uint32_t>(arg)); }, version);
     return CHIP_NO_ERROR;
 }
@msandstedt
Copy link
Contributor Author

CC @carol-apple

msandstedt added a commit to msandstedt/connectedhomeip that referenced this issue Jan 21, 2022
This commit failed to update Ota.cpp, resulting in a breakage for
builds that include the OTA shell:

commit d0d6dda
Date:   Thu Jan 20 05:37:01 2022 -0800

    [OTA] Implement event support for OTA Requestor cluster (project-chip#13727)

This commit fixes the issue by adding the now necessary version argument
to the NotifyImageHandler shell command.

Fixes project-chip#13803
msandstedt added a commit to msandstedt/connectedhomeip that referenced this issue Jan 21, 2022
This commit failed to update Ota.cpp, resulting in a breakage for
builds that include the OTA shell:

commit d0d6dda
Date:   Thu Jan 20 05:37:01 2022 -0800

    [OTA] Implement event support for OTA Requestor cluster (project-chip#13727)

This commit fixes the issue by adding the now necessary version argument
to the NotifyImageHandler shell command.

Fixes project-chip#13803
bzbarsky-apple pushed a commit that referenced this issue Jan 21, 2022
This commit failed to update Ota.cpp, resulting in a breakage for
builds that include the OTA shell:

commit d0d6dda
Date:   Thu Jan 20 05:37:01 2022 -0800

    [OTA] Implement event support for OTA Requestor cluster (#13727)

This commit fixes the issue by adding the now necessary version argument
to the NotifyImageHandler shell command.

Fixes #13803
selissia pushed a commit to selissia/connectedhomeip that referenced this issue Jan 28, 2022
This commit failed to update Ota.cpp, resulting in a breakage for
builds that include the OTA shell:

commit d0d6dda
Date:   Thu Jan 20 05:37:01 2022 -0800

    [OTA] Implement event support for OTA Requestor cluster (project-chip#13727)

This commit fixes the issue by adding the now necessary version argument
to the NotifyImageHandler shell command.

Fixes project-chip#13803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant