-
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
Actions: Add generic implementation for the actions cluster. #35568
base: master
Are you sure you want to change the base?
Conversation
10cabe7
to
960c59c
Compare
PR #35568: Size comparison from 0ac52eb to 960c59c Increases above 0.2%:
Full report (64 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, linux, nxp, psoc6, qpg, stm32, telink, tizen)
|
960c59c
to
cf78047
Compare
PR #35568: Size comparison from 3314bc3 to cf78047 Increases above 0.2%:
Full report (19 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, qpg, stm32, tizen)
|
cf78047
to
0326445
Compare
PR #35568: Size comparison from 3314bc3 to 0326445 Increases above 0.2%:
Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #35568: Size comparison from 3314bc3 to bf77a1b Increases above 0.2%:
Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
Outdated
Show resolved
Hide resolved
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.
OK, so how does the ASR bridge-app implement actions cluster now?
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.
What handles this now for this example app?
@@ -128,6 +128,7 @@ | |||
'src/app/clusters/application-launcher-server/application-launcher-server.cpp': {'string'}, | |||
'src/app/clusters/application-launcher-server/application-launcher-delegate.h': {'list'}, | |||
'src/app/clusters/audio-output-server/audio-output-delegate.h': {'list'}, | |||
'src/app/clusters/actions-server/actions-server.h': {'vector'}, |
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 document why this is ok.
|
||
EndpointListStorage(const EndpointListStorage & epList) : mEpListName(mBuffer, sizeof(mBuffer)) { *this = epList; } | ||
|
||
EndpointListStorage & operator=(const EndpointListStorage & epList) |
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.
Again, please add test and make sure setting to a longer name is supported.
endpointListID = epListId; | ||
type = epListType; | ||
|
||
for (uint8_t index = 0; index < std::min(endpointList.size(), kEndpointListMaxSize); index++) |
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 add unit tests for assignment operator, because it looks to me like the mEpList handling is broken if you assign more than once.
mEpListSpan = Span(mEpList.data(), mEpList.size()); | ||
endpoints = DataModel::List<const EndpointId>(mEpListSpan); |
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 do you need mEpListSpan at all as a member?
private: | ||
char mBuffer[kEndpointListNameMaxSize]; | ||
MutableCharSpan mEpListName; | ||
std::vector<EndpointId> mEpList; |
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.
OK, so why are we ok with a max-sized static buffer for mBuffer (which should be mNameBuffer anyway), but not for the endpoint list? At the very least that needs to be documented.
|
||
for (uint8_t index = 0; index < std::min(endpointList.size(), kEndpointListMaxSize); index++) | ||
{ | ||
mEpList.push_back(endpointList[index]); |
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.
This has terrible realloc behavior. If we know the size, why are we not reserving it?
Also, this will crash on allocation failure the way this is written right now, as far as I can tell. Is that intended?
…ong with name buffer and added events
…of MatterActionsPluginServerInitCallback in example
e7ccfb0
to
a5ef39b
Compare
PR #35568: Size comparison from c1afc02 to a5ef39b Increases above 0.2%:
Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Problem:
Changes:
Testing: