@@ -991,6 +991,8 @@ - (void)readAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullable)attri
991
991
queue : (dispatch_queue_t )queue
992
992
completion : (MTRDeviceResponseHandler)completion
993
993
{
994
+ MTR_LOG (" %@ readAttributePaths: %@, eventPaths: %@" , self, attributePaths, eventPaths);
995
+
994
996
[self readAttributePaths: attributePaths eventPaths: eventPaths params: params includeDataVersion: NO queue: queue completion: completion];
995
997
}
996
998
@@ -1001,6 +1003,9 @@ - (void)readAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullable)attri
1001
1003
queue : (dispatch_queue_t )queue
1002
1004
completion : (MTRDeviceResponseHandler)completion
1003
1005
{
1006
+ // NOTE: Do not log the read here. This is called ether from
1007
+ // readAttributePaths:eventPaths:params:queue:completion: or MTRDevice, both
1008
+ // of which already log, and we want to be able to tell the two codepaths apart.
1004
1009
if ((attributePaths == nil || [attributePaths count ] == 0 ) && (eventPaths == nil || [eventPaths count ] == 0 )) {
1005
1010
// No paths, just return an empty array.
1006
1011
dispatch_async (queue, ^{
@@ -1157,6 +1162,19 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID
1157
1162
timedWriteTimeout : (NSNumber * _Nullable)timeoutMs
1158
1163
queue : (dispatch_queue_t )queue
1159
1164
completion : (MTRDeviceResponseHandler)completion
1165
+ {
1166
+ MTR_LOG (" %@ write %@ 0x%llx 0x%llx: %@" , self, endpointID, clusterID.unsignedLongLongValue , attributeID.unsignedLongLongValue , value);
1167
+
1168
+ [self _writeAttributeWithEndpointID: endpointID clusterID: clusterID attributeID: attributeID value: value timedWriteTimeout: timeoutMs queue: queue completion: completion];
1169
+ }
1170
+
1171
+ - (void )_writeAttributeWithEndpointID : (NSNumber *)endpointID
1172
+ clusterID : (NSNumber *)clusterID
1173
+ attributeID : (NSNumber *)attributeID
1174
+ value : (id )value
1175
+ timedWriteTimeout : (NSNumber * _Nullable)timeoutMs
1176
+ queue : (dispatch_queue_t )queue
1177
+ completion : (MTRDeviceResponseHandler)completion
1160
1178
{
1161
1179
auto * bridge = new MTRDataValueDictionaryCallbackBridge (queue, completion,
1162
1180
^(ExchangeManager & exchangeManager, const SessionHandle & session, MTRDataValueDictionaryCallback successCb,
@@ -1337,6 +1355,7 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID
1337
1355
commandFields: commandFields
1338
1356
timedInvokeTimeout: timeoutMs
1339
1357
serverSideProcessingTimeout: nil
1358
+ logCall: YES
1340
1359
queue: queue
1341
1360
completion: completion];
1342
1361
}
@@ -1347,6 +1366,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID
1347
1366
commandFields : (id )commandFields
1348
1367
timedInvokeTimeout : (NSNumber * _Nullable)timeoutMs
1349
1368
serverSideProcessingTimeout : (NSNumber * _Nullable)serverSideProcessingTimeout
1369
+ logCall : (BOOL )logCall
1350
1370
queue : (dispatch_queue_t )queue
1351
1371
completion : (MTRDeviceResponseHandler)completion
1352
1372
{
@@ -1367,6 +1387,10 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID
1367
1387
timeoutMs = MTRClampedNumber (timeoutMs, @(1 ), @(UINT16_MAX));
1368
1388
}
1369
1389
1390
+ if (logCall) {
1391
+ MTR_LOG (" %@ invoke %@ 0x%llx 0x%llx: %@" , self, endpointID, clusterID.unsignedLongLongValue , commandID.unsignedLongLongValue , commandFields);
1392
+ }
1393
+
1370
1394
auto * bridge = new MTRDataValueDictionaryCallbackBridge (queue, completion,
1371
1395
^(ExchangeManager & exchangeManager, const SessionHandle & session, MTRDataValueDictionaryCallback successCb,
1372
1396
MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) {
@@ -1490,6 +1514,7 @@ - (void)_invokeKnownCommandWithEndpointID:(NSNumber *)endpointID
1490
1514
commandFields: commandFields
1491
1515
timedInvokeTimeout: timeout
1492
1516
serverSideProcessingTimeout: serverSideProcessingTimeout
1517
+ logCall: YES
1493
1518
queue: queue
1494
1519
completion: responseHandler];
1495
1520
}
@@ -2148,6 +2173,12 @@ - (void)downloadLogOfType:(MTRDiagnosticLogType)type
2148
2173
completion: completion];
2149
2174
}
2150
2175
2176
+ - (NSString *)description
2177
+ {
2178
+ return [NSString
2179
+ stringWithFormat: @" <%@ : %p , node: %016llX -%016llX (%llu )>" , NSStringFromClass (self .class ), self , _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID, _nodeID];
2180
+ }
2181
+
2151
2182
@end
2152
2183
2153
2184
@implementation MTRBaseDevice (Deprecated)
0 commit comments