-
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
Fix StatusCode Handling for command data with only path in invoke request[TE3] #7009
Fix StatusCode Handling for command data with only path in invoke request[TE3] #7009
Conversation
3ac7181
to
76a9f18
Compare
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.
I tried applying just the test change, not the CommandHandler.cpp change, and the test still seems to pass (or at least ./gn_build.sh
does not fail). That seems a little odd.
Also, I tried testing a command with no data (the toggle
command for the on/off cluster) and it seems to work without this change. Why is that? Based on the code I would have expected it to not work due to not calling DispatchSingleClusterCommand
.
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.
Summarizing my question from Slack:
- If I apply just the test change, not the code change, I would expect tests to fail, but they pass. This suggests the test is not usefully testing the code change.
- What situations result in
CHIP_END_OF_TLV
on the code side? I tried the toggle command (On/Off cluster) and it's taking the CHIP_NO_ERROR codepath, reaching DispatchSingleClusterCommand, and toggling the light. - Should toggle end up with
CHIP_END_OF_TLV
?
3993ae2
to
380149f
Compare
thanks for checking, I just add the additional check in test to check if DispatchSingleClusterCommand would be called when the command data has only path in invoke request. Without the CommandHandler's change, the new test would fail, with the commandHandler's change, the new test would pass. Per chat with @erjiaqing, there is bug in OnOffCluster, where it is having CommandData container inside, The below is current problematic InvokeCommandRequest for InvokeCommand for on/off cluster, we should not keep CommandData. |
Yep, just reply the question above.
|
Problems: When receiving empty invoke reques(it has path, no data inside), Status Code needs to be handled by SDK Consumer, instead of setting success status code. Summary of Change: -- If this is empty command data element in invoke request, skip the CHIP_END_OF_TLV error, the sdk consumer would handle this status code further. -- Add new unit test. Test: -- Add new unit test to handle empty command data in invoke request message.
380149f
to
4c50d4a
Compare
Size increase report for "gn_qpg6100-example-build" from 82a8544
Full report output
|
Size increase report for "nrfconnect-example-build" from 82a8544
Full report output
|
Size increase report for "esp32-example-build" from 82a8544
Full report output
|
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.
In the commit message, "reques(it" should be "request (it" (i.e. add missing 't' and space).
Problems: When receiving empty invoke request (it has path, no data inside), Status Code needs to be handled by SDK Consumer, instead of setting success status code. Summary of Change: -- If this is empty command data element in invoke request, skip the CHIP_END_OF_TLV error, the sdk consumer would handle this status code further. -- Add new unit test. Test: -- Add new unit test to handle empty command data in invoke request message.
Problem
When receiving empty data element in invoke request(it has path, no data inside), Status Code needs to be handled by
SDK Consumer, instead of setting success status code.
Change overview
-- If this is empty command data element in invoke request, skip the CHIP_END_OF_TLV error, the
sdk consumer would handle this status code further.
-- Add new unit test
Testing
-- Add new unit test to check if DispatchSingleClusterCommand would be trigged when empty command data in invoke request is processed in handler, without this change, this new test will fail.