-
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
Return InvalidCommand instead of UnsupportedCluster if the command is not handled in CHI #37166
base: master
Are you sure you want to change the base?
Conversation
5701090
to
990f32f
Compare
else | ||
{ | ||
// If we reach here, it means this particular CommandHandlerInterface recognized the cluster but the command is invalid or cannot be processed. | ||
handler->AddStatus(request.path, Protocols::InteractionModel::Status::InvalidCommand); |
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.
We previously allowed fallback to ember functions ... so this is not 100% backwards compatible (then again I am unsure if we should be or not).
I would lean more towards passing in a what to return on no handler found
to the dispatch handler instead.
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.
But when it is fall-backed to the DispatchSingleClusterCommand, it just calls the following function to add status, what is the difference if we just add the status here?
if (errorStatus != Protocols::InteractionModel::Status::Success)
{
apCommandObj->AddStatus(aCommandPath, errorStatus);
}
990f32f
to
c7022c9
Compare
… not handled in CHI
c7022c9
to
5c36f8c
Compare
PR #37166: Size comparison from 47a95b9 to 5c36f8c Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #37166: Size comparison from 47a95b9 to ec0298a Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Currently, after switching to CHI, any unhandled command is returning Protocols::InteractionModel::Status::UnsupportedCluster. Previously, when Ember handled these commands, we would return Protocols::InteractionModel::Status::InvalidCommand. We should preserve that behavior and continue returning InvalidCommand for runhandled commands in CHI.
Testing
Verified by manually disable command Commands::ResetCounts in WiFiDiagnosticsServer