-
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
[FanControl
] Adding Delegate to allow application to handle Step
command
#28000
Merged
jmartinez-silabs
merged 10 commits into
project-chip:master
from
dysonltd:fan-control-delegate-for-step
Jul 19, 2023
Merged
[FanControl
] Adding Delegate to allow application to handle Step
command
#28000
jmartinez-silabs
merged 10 commits into
project-chip:master
from
dysonltd:fan-control-delegate-for-step
Jul 19, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tion can implement to handle the Step Command. Added Set and Get functions and a class definition with a virtual function that can be implemented.
… example handler for the Step function
pullapprove
bot
requested review from
amitnj,
andy31415,
anush-apple,
arkq,
carol-apple,
cecille,
chrisdecenzo,
chshu,
chulspro,
cliffamzn,
CodeChronos928,
Damian-Nordic,
dhrishi,
electrocucaracha,
emargolis,
gjc13,
harimau-qirex,
harsha-rajendran,
hawk248,
hicklin and
jelderton
July 17, 2023 16:47
pullapprove
bot
requested review from
tecimovic,
tehampson,
tima-q,
tobiasgraf,
turon,
vijs,
vivien-apple,
woody-apple,
xylophone21,
younghak-hwang and
yufengwangca
July 17, 2023 16:47
woody-apple
approved these changes
Jul 18, 2023
@jmartinez-silabs To review, and maybe @bzbarsky-apple . |
jmartinez-silabs
approved these changes
Jul 19, 2023
EndpointId endpoint = commandPath.mEndpointId; | ||
StepDirectionEnum direction = commandData.direction; | ||
|
||
bool wrapValue = commandData.wrap.HasValue() ? commandData.wrap.Value() : false; |
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.
@mhazley For future reference:
bool wrapValue = commandData.wrap.ValueOr(false);
} | ||
else | ||
{ | ||
ChipLogProgress(Zcl, "FanControl has no delegate set for endpoint:%u", endpoint); |
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.
Should lack of delegate really respond with success?
erwinpan1
pushed a commit
to erwinpan1/connectedhomeip
that referenced
this pull request
Jul 21, 2023
…command (project-chip#28000) * Added support for a basic FanControl::Delegate class that the application can implement to handle the Step Command. Added Set and Get functions and a class definition with a virtual function that can be implemented. * Extended the fan-stub class to also inherit the Delegate and wrote an example handler for the Step function * Turned on the available features for the ci tests * Restyled by whitespace * Included optional header so can use std::optional * Removing use of optional as it is not building on certain platforms in CI * Simplified the HandleStep callback and also added support for when Speed is Null * Initialising uninitialised value in HandleStep --------- Co-authored-by: Restyled.io <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a basic
Delegate
class to theFanControl
cluster that allows the application to handle theStep
command how it sees fit.I have added a
Delegate
table as perwindow-covering-server
,media-playback-server
etc and then aSet..
andGet...
.I've then also extended the class in
fan-stub.cpp
inall-clusters-app
to implement an example of the Delegate function.Links
Fixes #27328