From 1485290e03d2bfa6059cafa6c137702943336646 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 4 Jan 2024 17:55:00 -0500 Subject: [PATCH] Add a description to MTRCommandPath. (#31169) * Add a description to MTRCommandPath. Fixes https://github.com/project-chip/connectedhomeip/issues/30858. * Address review comment. --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 09a8e07b0e34da..2d5c6a91e4a955 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -2227,7 +2227,7 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID - (NSString *)description { - return [NSString stringWithFormat:@" endpoint %u cluster %u attribute %u", + return [NSString stringWithFormat:@"", (uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue, (uint32_t) _attribute.unsignedLongValue]; } @@ -2299,7 +2299,7 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID - (NSString *)description { - return [NSString stringWithFormat:@" endpoint %u cluster %u event %u", + return [NSString stringWithFormat:@"", (uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue, (uint32_t) _event.unsignedLongValue]; } @@ -2370,7 +2370,7 @@ - (instancetype)initWithPath:(const ConcreteClusterPath &)path - (NSString *)description { - return [NSString stringWithFormat:@" endpoint %u cluster %u", (uint16_t) _endpoint.unsignedShortValue, + return [NSString stringWithFormat:@"", (uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue]; } @@ -2418,7 +2418,7 @@ - (instancetype)initWithPath:(const ConcreteDataAttributePath &)path - (NSString *)description { - return [NSString stringWithFormat:@" endpoint %u cluster %u attribute %u", + return [NSString stringWithFormat:@"", (uint16_t) self.endpoint.unsignedShortValue, (uint32_t) self.cluster.unsignedLongValue, (uint32_t) _attribute.unsignedLongValue]; } @@ -2485,7 +2485,7 @@ - (instancetype)initWithPath:(const ConcreteEventPath &)path - (NSString *)description { return - [NSString stringWithFormat:@" endpoint %u cluster %u event %u", (uint16_t) self.endpoint.unsignedShortValue, + [NSString stringWithFormat:@"", (uint16_t) self.endpoint.unsignedShortValue, (uint32_t) self.cluster.unsignedLongValue, (uint32_t) _event.unsignedLongValue]; } @@ -2525,6 +2525,13 @@ - (instancetype)initWithPath:(const ConcreteCommandPath &)path return self; } +- (NSString *)description +{ + return + [NSString stringWithFormat:@"", self.endpoint.unsignedShortValue, + self.cluster.unsignedLongValue, _command.unsignedLongValue]; +} + + (MTRCommandPath *)commandPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID { ConcreteCommandPath path(static_cast([endpointID unsignedShortValue]),