Skip to content

Commit

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

Fixes #30858.

* Address review comment.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 11, 2024
1 parent edd54bb commit 1485290
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 1485290

Please sign in to comment.