Skip to content

Commit

Permalink
Add a description to MTRCommandPath. (project-chip#31169)
Browse files Browse the repository at this point in the history
* Add a description to MTRCommandPath.

Fixes project-chip#30858.

* Address review comment.
  • Loading branch information
bzbarsky-apple authored Jan 4, 2024
1 parent 371756b commit 82d105e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2227,7 +2227,7 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID

- (NSString *)description
{
return [NSString stringWithFormat:@"<MTRAttributeRequestPath> endpoint %u cluster %u attribute %u",
return [NSString stringWithFormat:@"<MTRAttributeRequestPath endpoint %u cluster %u attribute %u>",
(uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue,
(uint32_t) _attribute.unsignedLongValue];
}
Expand Down Expand Up @@ -2299,7 +2299,7 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID

- (NSString *)description
{
return [NSString stringWithFormat:@"<MTREventRequestPath> endpoint %u cluster %u event %u",
return [NSString stringWithFormat:@"<MTREventRequestPath endpoint %u cluster %u event %u>",
(uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue,
(uint32_t) _event.unsignedLongValue];
}
Expand Down Expand Up @@ -2370,7 +2370,7 @@ - (instancetype)initWithPath:(const ConcreteClusterPath &)path

- (NSString *)description
{
return [NSString stringWithFormat:@"<MTRClusterPath> endpoint %u cluster %u", (uint16_t) _endpoint.unsignedShortValue,
return [NSString stringWithFormat:@"<MTRClusterPath endpoint %u cluster %u>", (uint16_t) _endpoint.unsignedShortValue,
(uint32_t) _cluster.unsignedLongValue];
}

Expand Down Expand Up @@ -2418,7 +2418,7 @@ - (instancetype)initWithPath:(const ConcreteDataAttributePath &)path

- (NSString *)description
{
return [NSString stringWithFormat:@"<MTRAttributePath> endpoint %u cluster %u attribute %u",
return [NSString stringWithFormat:@"<MTRAttributePath endpoint %u cluster %u attribute %u>",
(uint16_t) self.endpoint.unsignedShortValue, (uint32_t) self.cluster.unsignedLongValue,
(uint32_t) _attribute.unsignedLongValue];
}
Expand Down Expand Up @@ -2485,7 +2485,7 @@ - (instancetype)initWithPath:(const ConcreteEventPath &)path
- (NSString *)description
{
return
[NSString stringWithFormat:@"<MTREventPath> endpoint %u cluster %u event %u", (uint16_t) self.endpoint.unsignedShortValue,
[NSString stringWithFormat:@"<MTREventPath endpoint %u cluster %u event %u>", (uint16_t) self.endpoint.unsignedShortValue,
(uint32_t) self.cluster.unsignedLongValue, (uint32_t) _event.unsignedLongValue];
}

Expand Down Expand Up @@ -2525,6 +2525,13 @@ - (instancetype)initWithPath:(const ConcreteCommandPath &)path
return self;
}

- (NSString *)description
{
return
[NSString stringWithFormat:@"<MTRCommandPath endpoint %u cluster %lu command %lu>", self.endpoint.unsignedShortValue,
self.cluster.unsignedLongValue, _command.unsignedLongValue];
}

+ (MTRCommandPath *)commandPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID
{
ConcreteCommandPath path(static_cast<chip::EndpointId>([endpointID unsignedShortValue]),
Expand Down

0 comments on commit 82d105e

Please sign in to comment.