-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Fixed] OTAServerDelegate class for vendor logic #7537
[Fixed] OTAServerDelegate class for vendor logic #7537
Conversation
* OTAServerDelegate class for vendor logic - define OTAServerDelegate class for implementing vendor OTA Server logic - add some common logic for OTA Server Cluster commands - use OTA_SERVER_CLUSTER_EXAMPLE_IMPL to conditionally build example logic - add OTA Server Cluster to all-clusters-app and chip-tool - fix AnnounceOTAServer command direction * add build macros to all-clusters-app esp32 build files * use virtual delegate methods instead of static singleton * fix whitespace * add OTA Server to all-clusters-app, remove ota-client callbacks ota-client response callbacks are automatically generated now * generated files * remove src/darwin edits * edit zap files to include just ota clusters * regenerate gen files after zap fix * add multiple endpoint support and EMBER_ZCL_STATUS_INVALID_ARGUMENT * remove OTA Server Cluster from all-clusters-app Endpoint 1 - There should only be one OTA Server Cluster, in endpoint 0 * fix darwin tests - enable Cluster Revision attribute reporting for OTA Server Cluster in all-clusters-app - change darwin test to use endpoint 0 instead of endpoint 1 * edit helper.js in darwin to fix OTA Server test - note: tv-app files were also modified and tv-app build is failing * generated files after merge conflict * resolve merge conflicts + regen * default destructor for OTAServerDelegate Co-authored-by: Tennessee Carmel-Veilleux <[email protected]> * error logging and value change for EMBER_ZCL_STATUS_INVALID_ARGUMENT * regenerate * regenerated files after merge conflict fix * add generated tv-app files * Revert "add generated tv-app files" This reverts commit 48acb90. Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>
@holbrookt - needs merge due to generated code |
return true; | ||
} | ||
|
||
void chip::app::clusters::OTAServer::SetDelegate(chip::EndpointId endpointId, OTAServerDelegate * delegate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are doing "using namespace chip::app::clusters" only to have to spell out the entire thing here?
Can't we put the entire file content within that namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire file should not be in that namespace because the emberAf...
functions are defined in the global namespace.
But I did remove the unnecessary scopes here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the namespacing.
Size increase report for "esp32-example-build" from 26e00e1
Full report output
|
fixed in latest commits. |
* OTAServerDelegate class for vendor logic (project-chip#6476) * OTAServerDelegate class for vendor logic - define OTAServerDelegate class for implementing vendor OTA Server logic - add some common logic for OTA Server Cluster commands - use OTA_SERVER_CLUSTER_EXAMPLE_IMPL to conditionally build example logic - add OTA Server Cluster to all-clusters-app and chip-tool - fix AnnounceOTAServer command direction * add build macros to all-clusters-app esp32 build files * use virtual delegate methods instead of static singleton * fix whitespace * add OTA Server to all-clusters-app, remove ota-client callbacks ota-client response callbacks are automatically generated now * generated files * remove src/darwin edits * edit zap files to include just ota clusters * regenerate gen files after zap fix * add multiple endpoint support and EMBER_ZCL_STATUS_INVALID_ARGUMENT * remove OTA Server Cluster from all-clusters-app Endpoint 1 - There should only be one OTA Server Cluster, in endpoint 0 * fix darwin tests - enable Cluster Revision attribute reporting for OTA Server Cluster in all-clusters-app - change darwin test to use endpoint 0 instead of endpoint 1 * edit helper.js in darwin to fix OTA Server test - note: tv-app files were also modified and tv-app build is failing * generated files after merge conflict * resolve merge conflicts + regen * default destructor for OTAServerDelegate Co-authored-by: Tennessee Carmel-Veilleux <[email protected]> * error logging and value change for EMBER_ZCL_STATUS_INVALID_ARGUMENT * regenerate * regenerated files after merge conflict fix * add generated tv-app files * Revert "add generated tv-app files" This reverts commit 48acb90. Co-authored-by: Tennessee Carmel-Veilleux <[email protected]> * change logging types and regenerate files * regenerate after merge conflict * fix namespacing * regenerate files * wrap SetDelegate() in namespace scope Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>
This is a resubmit of #6476 with fixes for the breakages that lead to #7534
Problem
Need a way to separate common code from application/vendor specific code for OTA Server Cluster, which doesn't require the developer to fork the repo.
Change overview
Testing
Ran
chip-tool
andall-clusters-app
on Linux machine, confirmed that I can sendquery-image
apply-update-request
andnotify-update-applied
. The response toapply-update-request
andnotify-update-applied
isEMBER_ZCL_STATUS_UNSUP_COMMAND
as expected, because there is no OTAServerDelegate implemented yet. The response toquery-image
is a TLV parse failure becauseCHAR_STRING
is not supported yet