Skip to content

Commit 919f690

Browse files
Improve id logging in MTR*Path descriptions.
Cluster/attribute/command/event ids are defined as hex, so we should log them as hex.
1 parent 92cac02 commit 919f690

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/darwin/Framework/CHIP/MTRBaseDevice.mm

+16-15
Original file line numberDiff line numberDiff line change
@@ -2315,9 +2315,9 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID
23152315

23162316
- (NSString *)description
23172317
{
2318-
return [NSString stringWithFormat:@"<MTRAttributeRequestPath endpoint %u cluster %u attribute %u>",
2319-
(uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue,
2320-
(uint32_t) _attribute.unsignedLongValue];
2318+
return [NSString stringWithFormat:@"<MTRAttributeRequestPath endpoint %u cluster 0x%llx (%llu) attribute 0x%llx (%llu)>",
2319+
_endpoint.unsignedShortValue, _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue,
2320+
_attribute.unsignedLongLongValue, _attribute.unsignedLongLongValue];
23212321
}
23222322

23232323
+ (MTRAttributeRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpointID
@@ -2439,9 +2439,9 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID
24392439

24402440
- (NSString *)description
24412441
{
2442-
return [NSString stringWithFormat:@"<MTREventRequestPath endpoint %u cluster %u event %u>",
2443-
(uint16_t) _endpoint.unsignedShortValue, (uint32_t) _cluster.unsignedLongValue,
2444-
(uint32_t) _event.unsignedLongValue];
2442+
return [NSString stringWithFormat:@"<MTREventRequestPath endpoint %u cluster 0x%llx (%llu) event 0x%llx (%llu)>",
2443+
_endpoint.unsignedShortValue, _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue,
2444+
_event.unsignedLongLongValue, _event.unsignedLongLongValue];
24452445
}
24462446

24472447
+ (MTREventRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpointID
@@ -2561,8 +2561,8 @@ - (instancetype)initWithPath:(const ConcreteClusterPath &)path
25612561

25622562
- (NSString *)description
25632563
{
2564-
return [NSString stringWithFormat:@"<MTRClusterPath endpoint %u cluster %u>", (uint16_t) _endpoint.unsignedShortValue,
2565-
(uint32_t) _cluster.unsignedLongValue];
2564+
return [NSString stringWithFormat:@"<MTRClusterPath endpoint %u cluster 0x%llx (%llu)>", _endpoint.unsignedShortValue,
2565+
_cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue];
25662566
}
25672567

25682568
+ (MTRClusterPath *)clusterPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID
@@ -2646,9 +2646,9 @@ - (instancetype)initWithPath:(const ConcreteDataAttributePath &)path
26462646

26472647
- (NSString *)description
26482648
{
2649-
return [NSString stringWithFormat:@"<MTRAttributePath endpoint %u cluster %u attribute %u>",
2650-
(uint16_t) self.endpoint.unsignedShortValue, (uint32_t) self.cluster.unsignedLongValue,
2651-
(uint32_t) _attribute.unsignedLongValue];
2649+
return [NSString stringWithFormat:@"<MTRAttributePath endpoint %u cluster 0x%llx (%llu) attribute 0x%llx (%llu)>",
2650+
self.endpoint.unsignedShortValue, self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue,
2651+
_attribute.unsignedLongLongValue, _attribute.unsignedLongLongValue];
26522652
}
26532653

26542654
+ (MTRAttributePath *)attributePathWithEndpointID:(NSNumber *)endpointID
@@ -2743,8 +2743,8 @@ - (instancetype)initWithPath:(const ConcreteEventPath &)path
27432743
- (NSString *)description
27442744
{
27452745
return
2746-
[NSString stringWithFormat:@"<MTREventPath endpoint %u cluster %u event %u>", (uint16_t) self.endpoint.unsignedShortValue,
2747-
(uint32_t) self.cluster.unsignedLongValue, (uint32_t) _event.unsignedLongValue];
2746+
[NSString stringWithFormat:@"<MTREventPath endpoint %u cluster 0x%llx (%llu) event 0x%llx (%llu)>", self.endpoint.unsignedShortValue,
2747+
self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, _event.unsignedLongLongValue, _event.unsignedLongLongValue];
27482748
}
27492749

27502750
+ (MTREventPath *)eventPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID eventID:(NSNumber *)eventID
@@ -2833,8 +2833,9 @@ - (instancetype)initWithPath:(const ConcreteCommandPath &)path
28332833
- (NSString *)description
28342834
{
28352835
return
2836-
[NSString stringWithFormat:@"<MTRCommandPath endpoint %u cluster %lu command %lu>", self.endpoint.unsignedShortValue,
2837-
self.cluster.unsignedLongValue, _command.unsignedLongValue];
2836+
[NSString stringWithFormat:@"<MTRCommandPath endpoint %u cluster 0x%llx (%llu) command 0x%llx (%llu)>", self.endpoint.unsignedShortValue,
2837+
self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, _command.unsignedLongLongValue,
2838+
_command.unsignedLongLongValue];
28382839
}
28392840

28402841
+ (MTRCommandPath *)commandPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID commandID:(NSNumber *)commandID

0 commit comments

Comments
 (0)