-
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.
[Darwin] MTRDevice should not always send reads to device directly (#…
…26776) * [Darwin] MTRDevice should not always send reads to device directly * Update src/darwin/Framework/CHIP/MTRDevice.mm Co-authored-by: Boris Zbarsky <[email protected]> * Update src/darwin/Framework/CHIP/MTRDevice.mm Co-authored-by: Boris Zbarsky <[email protected]> * Update src/darwin/Framework/CHIP/MTRDevice.mm Co-authored-by: Boris Zbarsky <[email protected]> * Update src/darwin/Framework/CHIP/templates/MTRAttributeUtils-src.zapt Co-authored-by: Boris Zbarsky <[email protected]> * Address PR review comments --------- Co-authored-by: Boris Zbarsky <[email protected]>
- Loading branch information
Showing
6 changed files
with
5,236 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* 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. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#include <lib/core/DataModelTypes.h> | ||
|
||
BOOL MTRAttributeIsSpecified(chip::ClusterId aClusterId, chip::AttributeId aAttributeId); |
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
47 changes: 47 additions & 0 deletions
47
src/darwin/Framework/CHIP/templates/MTRAttributeSpecifiedCheck-src.zapt
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,47 @@ | ||
{{> header excludeZapComment=true}} | ||
|
||
#import "MTRAttributeSpecifiedCheck.h" | ||
|
||
#include <app-common/zap-generated/ids/Attributes.h> | ||
#include <app-common/zap-generated/ids/Clusters.h> | ||
|
||
using namespace chip; | ||
using namespace chip::app; | ||
|
||
{{#zcl_clusters}} | ||
{{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} | ||
static BOOL AttributeIsSpecifiedIn{{asUpperCamelCase name preserveAcronyms=true}}Cluster(AttributeId aAttributeId) | ||
{ | ||
using namespace Clusters::{{asUpperCamelCase name}}; | ||
switch (aAttributeId) { | ||
{{#zcl_attributes_server}} | ||
{{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} | ||
case Attributes::{{asUpperCamelCase name}}::Id: { | ||
return YES; | ||
} | ||
{{/if}} | ||
{{/zcl_attributes_server}} | ||
default: { | ||
return NO; | ||
} | ||
} | ||
} | ||
{{/if}} | ||
{{/zcl_clusters}} | ||
|
||
BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) | ||
{ | ||
switch (aClusterId) | ||
{ | ||
{{#zcl_clusters}} | ||
{{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} | ||
case Clusters::{{asUpperCamelCase name}}::Id: { | ||
return AttributeIsSpecifiedIn{{asUpperCamelCase name preserveAcronyms=true}}Cluster(aAttributeId); | ||
} | ||
{{/if}} | ||
{{/zcl_clusters}} | ||
default: { | ||
return NO; | ||
} | ||
} | ||
} |
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.