-
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
Add the ability to read extra attributes during commissioning #36867
Open
ksperling-apple
wants to merge
8
commits into
project-chip:master
Choose a base branch
from
ksperling-apple:read-custom-commissioning-info
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f57a10c
Add support for ExtraReadPaths to CommissioningParameters
ksperling-apple 2c94613
Darwin: Tidy up some device type meta-data classes
ksperling-apple a71b56b
Darwin: Add MTRCommissioningParameters.readEndpointInformation
ksperling-apple f11f465
CHIP_CONFIG_ENABLE_READ_CLIENT strikes again
ksperling-apple a355e9f
Apply suggestions from code review
ksperling-apple 5d02faf
Check for alloc failure
ksperling-apple c0cce65
Use NSString literal for MTRDeviceTypeData
ksperling-apple b78a442
Process endpoints in best-effort fashion even with invalid / missing …
ksperling-apple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
34 changes: 34 additions & 0 deletions
34
src/darwin/Framework/CHIP/MTRAttributeTLVValueDecoder_Internal.mm
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,34 @@ | ||
/** | ||
* Copyright (c) 2024 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. | ||
*/ | ||
|
||
#import "MTRAttributeTLVValueDecoder_Internal.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
using namespace chip; | ||
|
||
id _Nullable MTRDecodeAttributeValue(const chip::app::ConcreteAttributePath & aPath, | ||
const chip::app::ClusterStateCache & aCache, | ||
CHIP_ERROR * aError) | ||
{ | ||
TLV::TLVReader reader; | ||
*aError = aCache.Get(aPath, reader); | ||
VerifyOrReturnValue(*aError == CHIP_NO_ERROR, nil); | ||
return MTRDecodeAttributeValue(aPath, reader, aError); | ||
} | ||
|
||
NS_ASSUME_NONNULL_END |
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
Oops, something went wrong.
Oops, something went wrong.
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.
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 the dependency on CHIP_CONFIG_ENABLE_READ_CLIENT be documented? Or maybe these APIs should just be conditioned on that?
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.
It’s that dependency mess again… all of commissioning actually depends on ReadClient but the header is parsed even when it’s disabled.
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.
Fair, but feels like we should just make sure if the logic backing the API is not present, then the API should not be present.
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.
None of CommissioningParameters is meaningfully usable without CHIP_CONFIG_ENABLE_READ_CLIENT... I don't really want go further down that path of pretending that CHIP_CONFIG_ENABLE_READ_CLIENT disables a select few methods within these classes... All of DeviceCommissioner and all of CommissioningDelegate.h should be behind the ifdef (or really in a separate header.) I can have a look at making the ifdef more coarse-grained like that as a separate PR. Maybe when folks are back after the break we can look into splitting CHIPDeviceController.{cpp, h} into two files in a git-history-preserving way and tidy this up a bit better that way.