-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add attribute change callback hook for speaker endpoint (#16944)
* add attribute change callback hook for speaker endpoint * Update examples/tv-app/linux/ZclCallbacks.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Update examples/tv-app/linux/ZclCallbacks.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Delete af-gen-event.h Revert change pending feedback on level control cluster on endpoint 1 * add back af-gen-events * Restyle add attribute change callback hook for speaker endpoint (#16945) * Restyled by whitespace * Restyled by gn Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Justin Wood <woody@apple.com> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <commits@restyled.io>
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* This file implements the handler for data model messages. | ||
*/ | ||
|
||
#include <app-common/zap-generated/ids/Attributes.h> | ||
#include <app-common/zap-generated/ids/Clusters.h> | ||
#include <app/ConcreteAttributePath.h> | ||
#include <lib/support/logging/CHIPLogging.h> | ||
|
||
using namespace ::chip; | ||
using namespace ::chip::app::Clusters; | ||
|
||
void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, uint8_t type, | ||
uint16_t size, uint8_t * value) | ||
{ | ||
ClusterId clusterId = attributePath.mClusterId; | ||
AttributeId attributeId = attributePath.mAttributeId; | ||
ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); | ||
|
||
if (clusterId == OnOff::Id && attributeId == OnOff::Attributes::OnOff::Id) | ||
{ | ||
ChipLogProgress(Zcl, "OnOff attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %" PRIu16, | ||
ChipLogValueMEI(attributeId), type, *value, size); | ||
} | ||
else if (clusterId == LevelControl::Id) | ||
{ | ||
ChipLogProgress(Zcl, "Level Control attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %" PRIu16, | ||
ChipLogValueMEI(attributeId), type, *value, size); | ||
|
||
// WIP Apply attribute change to Light | ||
} | ||
} | ||
|
||
/** @brief OnOff Cluster Init | ||
* | ||
* This function is called when a specific cluster is initialized. It gives the | ||
* application an opportunity to take care of cluster initialization procedures. | ||
* It is called exactly once for each endpoint where cluster is present. | ||
* | ||
* @param endpoint Ver.: always | ||
* | ||
* TODO Issue #3841 | ||
* emberAfOnOffClusterInitCallback happens before the stack initialize the cluster | ||
* attributes to the default value. | ||
* The logic here expects something similar to the deprecated Plugins callback | ||
* emberAfPluginOnOffClusterServerPostInitCallback. | ||
* | ||
*/ | ||
void emberAfOnOffClusterInitCallback(EndpointId endpoint) | ||
{ | ||
// TODO: implement any additional Cluster Server init actions | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.