-
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.
Create
ember-compatibility-functions.h
to represent what `ember-com…
…patibility-functions.cpp` contains (#32623) * Create a ember-compatibility-functions header to define what the cpp contains * Fix includes of ember compatibility functions * Fix lint * Restyle * Remove reporting.h since that actually declares what ember-compatibility-functions.cpp implements * Revert "Remove reporting.h since that actually declares what ember-compatibility-functions.cpp implements" This reverts commit 297f526. * Move the reporting bits into reporting.cpp * Restyle * Remove some unused includes * Add reporting.cpp to cmake builds * Fix rpc builds with new includes * Fix oven and java matter controller compilation * Some additional minor comments for the dynamic dispatcher ... unfortunately deps seem a bit strict * Restyle * Add reporting.cpp to the list of know issues (it is the same as ember-compatibility-functions) * Add reporting.cpp to xcode * Fix darwin compile * Remove extra comment based on code review * Comment rephrase --------- Co-authored-by: Andrei Litvin <andreilitvin@google.com>
- Loading branch information
1 parent
907883f
commit d338455
Showing
19 changed files
with
215 additions
and
121 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
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
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
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
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
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
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,79 @@ | ||
/* | ||
* | ||
* Copyright (c) 2024 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. | ||
*/ | ||
#include "reporting.h" | ||
|
||
#include <app/AttributePathParams.h> | ||
#include <app/InteractionModelEngine.h> | ||
#include <app/util/af.h> | ||
#include <platform/LockTracker.h> | ||
|
||
using namespace chip; | ||
using namespace chip::app; | ||
|
||
namespace { | ||
|
||
void IncreaseClusterDataVersion(const ConcreteClusterPath & aConcreteClusterPath) | ||
{ | ||
DataVersion * version = emberAfDataVersionStorage(aConcreteClusterPath); | ||
if (version == nullptr) | ||
{ | ||
ChipLogError(DataManagement, "Endpoint %x, Cluster " ChipLogFormatMEI " not found in IncreaseClusterDataVersion!", | ||
aConcreteClusterPath.mEndpointId, ChipLogValueMEI(aConcreteClusterPath.mClusterId)); | ||
} | ||
else | ||
{ | ||
(*(version))++; | ||
ChipLogDetail(DataManagement, "Endpoint %x, Cluster " ChipLogFormatMEI " update version to %" PRIx32, | ||
aConcreteClusterPath.mEndpointId, ChipLogValueMEI(aConcreteClusterPath.mClusterId), *(version)); | ||
} | ||
} | ||
|
||
} // namespace | ||
|
||
void MatterReportingAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId) | ||
{ | ||
// Attribute writes have asserted this already, but this assert should catch | ||
// applications notifying about changes from their end. | ||
assertChipStackLockedByCurrentThread(); | ||
|
||
AttributePathParams info; | ||
info.mClusterId = clusterId; | ||
info.mAttributeId = attributeId; | ||
info.mEndpointId = endpoint; | ||
|
||
IncreaseClusterDataVersion(ConcreteClusterPath(endpoint, clusterId)); | ||
InteractionModelEngine::GetInstance()->GetReportingEngine().SetDirty(info); | ||
} | ||
|
||
void MatterReportingAttributeChangeCallback(const ConcreteAttributePath & aPath) | ||
{ | ||
return MatterReportingAttributeChangeCallback(aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId); | ||
} | ||
|
||
void MatterReportingAttributeChangeCallback(EndpointId endpoint) | ||
{ | ||
// Attribute writes have asserted this already, but this assert should catch | ||
// applications notifying about changes from their end. | ||
assertChipStackLockedByCurrentThread(); | ||
|
||
AttributePathParams info; | ||
info.mEndpointId = endpoint; | ||
|
||
// We are adding or enabling a whole endpoint, in this case, we do not touch the cluster data version. | ||
|
||
InteractionModelEngine::GetInstance()->GetReportingEngine().SetDirty(info); | ||
} |
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
Oops, something went wrong.