|
62 | 62 |
|
63 | 63 | void MTRDeviceControllerDelegateBridge::OnStatusUpdate(chip::Controller::DevicePairingDelegate::Status status)
|
64 | 64 | {
|
65 |
| - MTR_LOG("DeviceControllerDelegate status updated: %d", status); |
| 65 | + MTRDeviceController * strongController = mController; |
| 66 | + |
| 67 | + MTR_LOG("%@ DeviceControllerDelegate status updated: %d", strongController, status); |
66 | 68 |
|
67 | 69 | // If pairing failed, PASE failed. However, since OnPairingComplete(failure_code) might not be invoked in all cases, mark
|
68 | 70 | // end of PASE with timeout as assumed failure. If OnPairingComplete is invoked, the right error code will be updated in
|
|
72 | 74 | }
|
73 | 75 |
|
74 | 76 | id<MTRDeviceControllerDelegate> strongDelegate = mDelegate;
|
75 |
| - MTRDeviceController * strongController = mController; |
76 | 77 | if (strongDelegate && mQueue && strongController) {
|
77 | 78 | if ([strongDelegate respondsToSelector:@selector(controller:statusUpdate:)]) {
|
78 | 79 | MTRCommissioningStatus commissioningStatus = MapStatus(status);
|
|
93 | 94 |
|
94 | 95 | void MTRDeviceControllerDelegateBridge::OnPairingComplete(CHIP_ERROR error)
|
95 | 96 | {
|
| 97 | + MTRDeviceController * strongController = mController; |
| 98 | + |
96 | 99 | if (error == CHIP_NO_ERROR) {
|
97 |
| - MTR_LOG("MTRDeviceControllerDelegate PASE session establishment succeeded."); |
| 100 | + MTR_LOG("%@ MTRDeviceControllerDelegate PASE session establishment succeeded.", strongController); |
98 | 101 | } else {
|
99 |
| - MTR_LOG_ERROR("MTRDeviceControllerDelegate PASE session establishment failed: %" CHIP_ERROR_FORMAT, error.Format()); |
| 102 | + MTR_LOG_ERROR("%@ MTRDeviceControllerDelegate PASE session establishment failed: %" CHIP_ERROR_FORMAT, strongController, error.Format()); |
100 | 103 | }
|
101 | 104 | MATTER_LOG_METRIC_END(kMetricSetupPASESession, error);
|
102 | 105 |
|
103 | 106 | id<MTRDeviceControllerDelegate> strongDelegate = mDelegate;
|
104 |
| - MTRDeviceController * strongController = mController; |
105 | 107 | if (strongDelegate && mQueue && strongController) {
|
106 | 108 | if ([strongDelegate respondsToSelector:@selector(controller:commissioningSessionEstablishmentDone:)]) {
|
107 | 109 | dispatch_async(mQueue, ^{
|
|
121 | 123 |
|
122 | 124 | void MTRDeviceControllerDelegateBridge::OnReadCommissioningInfo(const chip::Controller::ReadCommissioningInfo & info)
|
123 | 125 | {
|
| 126 | + MTRDeviceController * strongController = mController; |
| 127 | + |
124 | 128 | chip::VendorId vendorId = info.basic.vendorId;
|
125 | 129 | uint16_t productId = info.basic.productId;
|
126 | 130 |
|
127 |
| - MTR_LOG("DeviceControllerDelegate Read Commissioning Info. VendorId %u ProductId %u", vendorId, productId); |
| 131 | + MTR_LOG("%@ DeviceControllerDelegate Read Commissioning Info. VendorId %u ProductId %u", strongController, vendorId, productId); |
128 | 132 |
|
129 | 133 | id<MTRDeviceControllerDelegate> strongDelegate = mDelegate;
|
130 |
| - MTRDeviceController * strongController = mController; |
131 | 134 | if (strongDelegate && mQueue && strongController) {
|
132 | 135 | if ([strongDelegate respondsToSelector:@selector(controller:readCommissioningInfo:)]) {
|
133 | 136 | dispatch_async(mQueue, ^{
|
|
140 | 143 |
|
141 | 144 | void MTRDeviceControllerDelegateBridge::OnCommissioningComplete(chip::NodeId nodeId, CHIP_ERROR error)
|
142 | 145 | {
|
143 |
| - MTR_LOG("DeviceControllerDelegate Commissioning complete. NodeId %llu Status %s", nodeId, chip::ErrorStr(error)); |
| 146 | + MTRDeviceController * strongController = mController; |
| 147 | + |
| 148 | + MTR_LOG("%@ DeviceControllerDelegate Commissioning complete. NodeId 0x%016llx Status %s", strongController, nodeId, chip::ErrorStr(error)); |
144 | 149 | MATTER_LOG_METRIC_END(kMetricDeviceCommissioning, error);
|
145 | 150 |
|
146 | 151 | id<MTRDeviceControllerDelegate> strongDelegate = mDelegate;
|
147 |
| - MTRDeviceController * strongController = mController; |
148 | 152 | if (strongDelegate && mQueue && strongController) {
|
149 | 153 |
|
150 | 154 | // Always collect the metrics to avoid unbounded growth of the stats in the collector
|
151 | 155 | MTRMetrics * metrics = [[MTRMetricsCollector sharedInstance] metricSnapshot:TRUE];
|
152 |
| - MTR_LOG("Device commissioning complete with metrics %@", metrics); |
| 156 | + MTR_LOG("%@ Device commissioning complete with metrics %@", strongController, metrics); |
153 | 157 |
|
154 | 158 | if ([strongDelegate respondsToSelector:@selector(controller:commissioningComplete:nodeID:)] ||
|
155 | 159 | [strongDelegate respondsToSelector:@selector(controller:commissioningComplete:nodeID:metrics:)]) {
|
|
0 commit comments