Skip to content
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

[Darwin] API to list all network commissioning features supported by an MTRDevice #36479

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/darwin/Framework/CHIP/MTRDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
*/
@property (nonatomic, readonly, nullable, copy) NSNumber * productID MTR_NEWLY_AVAILABLE;

/**
* Network commissioning features supported by the device.
*
* The value if not nil, represents the options available in MTRNetworkCommissioningFeature type.
*
*/
@property (nonatomic, readonly, nullable, copy) NSNumber * networkCommissioningFeature MTR_NEWLY_AVAILABLE;
anush-apple marked this conversation as resolved.
Show resolved Hide resolved

/**
* Set the delegate to receive asynchronous callbacks about the device.
*
Expand Down
6 changes: 6 additions & 0 deletions src/darwin/Framework/CHIP/MTRDevice_Concrete.mm
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ - (nullable NSNumber *)productID
return [_pid copy];
}

- (nullable NSNumber *)networkCommissioningFeature
{
std::lock_guard lock(_descriptionLock);
return [_allNetworkFeatures copy];
}

- (void)_notifyDelegateOfPrivateInternalPropertiesChanges
{
os_unfair_lock_assert_owner(&self->_lock);
Expand Down
5 changes: 5 additions & 0 deletions src/darwin/Framework/CHIP/MTRDevice_XPC.mm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ - (nullable NSNumber *)productID
return [[self._internalState objectForKey:kMTRDeviceInternalPropertyKeyProductID] copy];
}

- (nullable NSNumber *)networkCommissioningFeature
{
return [[self._internalState objectForKey:kMTRDeviceInternalPropertyNetworkFeatures] copy];
}

#pragma mark - Client Callbacks (MTRDeviceDelegate)

// required methods for MTRDeviceDelegates
Expand Down
Loading