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

Add a wildcard attribute read API on MTRDevice. #35562

Merged
merged 6 commits into from
Sep 13, 2024
Merged
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
Prev Previous commit
Next Next commit
Restyled by clang-format
  • Loading branch information
restyled-commits authored and woody-apple committed Sep 13, 2024
commit 0417aa7ed2c7af299f9a3e8d00bb67448c165dcb
29 changes: 14 additions & 15 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2276,8 +2276,8 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID
- (NSString *)description
{
return [NSString stringWithFormat:@"<MTRAttributeRequestPath endpoint %u cluster %u attribute %u>",
(uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue,
(uint32_t) _attribute.unsignedLongValue];
(uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue,
(uint32_t) _attribute.unsignedLongValue];
}

+ (MTRAttributeRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpointID
Expand All @@ -2291,8 +2291,8 @@ + (MTRAttributeRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)end
- (BOOL)isEqualToAttributeRequestPath:(MTRAttributeRequestPath *)path
{
return MTREqualObjects(_endpoint, path.endpoint)
&& MTREqualObjects(_cluster, path.cluster)
&& MTREqualObjects(_attribute, path.attribute);
&& MTREqualObjects(_cluster, path.cluster)
&& MTREqualObjects(_attribute, path.attribute);
}

- (BOOL)isEqual:(id)object
Expand Down Expand Up @@ -2373,13 +2373,13 @@ - (nullable instancetype)initWithCoder:(NSCoder *)decoder

- (void)encodeWithCoder:(NSCoder *)coder
{
if ( _endpoint ) {
if (_endpoint) {
[coder encodeObject:_endpoint forKey:sEndpointIDKey];
}
if ( _cluster ) {
if (_cluster) {
[coder encodeObject:_cluster forKey:sClusterIDKey];
}
if ( _attribute ) {
if (_attribute) {
[coder encodeObject:_attribute forKey:sAttributeIDKey];
}
}
Expand All @@ -2400,8 +2400,8 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID
- (NSString *)description
{
return [NSString stringWithFormat:@"<MTREventRequestPath endpoint %u cluster %u event %u>",
(uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue,
(uint32_t) _event.unsignedLongValue];
(uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue,
(uint32_t) _event.unsignedLongValue];
}

+ (MTREventRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpointID
Expand All @@ -2415,8 +2415,8 @@ + (MTREventRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpoin
- (BOOL)isEqualToEventRequestPath:(MTREventRequestPath *)path
{
return MTREqualObjects(_endpoint, path.endpoint)
&& MTREqualObjects(_cluster, path.cluster)
&& MTREqualObjects(_event, path.event);
&& MTREqualObjects(_cluster, path.cluster)
&& MTREqualObjects(_event, path.event);
}

- (BOOL)isEqual:(id)object
Expand Down Expand Up @@ -2496,18 +2496,17 @@ - (nullable instancetype)initWithCoder:(NSCoder *)decoder

- (void)encodeWithCoder:(NSCoder *)coder
{
if ( _endpoint ) {
if (_endpoint) {
[coder encodeObject:_endpoint forKey:sEventEndpointIDKey];
}
if ( _cluster ) {
if (_cluster) {
[coder encodeObject:_cluster forKey:sEventClusterIDKey];
}
if ( _event ) {
if (_event) {
[coder encodeObject:_event forKey:sEventAttributeIDKey];
}
}


@end

@implementation MTRClusterPath
Expand Down
Loading