@@ -101,6 +101,14 @@ - (id)strongObject
101
101
return aNumber;
102
102
}
103
103
104
+ /* BEGIN DRAGONS: Note methods here cannot be renamed, and are used by private callers, do not rename, remove or modify behavior here */
105
+
106
+ @interface NSObject (MatterPrivateForInternalDragonsDoNotFeed)
107
+ - (void )_deviceInternalStateChanged : (MTRDevice *)device ;
108
+ @end
109
+
110
+ /* END DRAGONS */
111
+
104
112
#pragma mark - SubscriptionCallback class declaration
105
113
using namespace chip ;
106
114
using namespace chip ::app;
@@ -949,6 +957,15 @@ - (void)_changeInternalState:(MTRInternalDeviceState)state
949
957
_internalDeviceState = state;
950
958
if (lastState != state) {
951
959
MTR_LOG (" %@ internal state change %lu => %lu" , self, static_cast <unsigned long >(lastState), static_cast <unsigned long >(state));
960
+
961
+ /* BEGIN DRAGONS: This is a huge hack for a specific use case, do not rename, remove or modify behavior here */
962
+ id <MTRDeviceDelegate> delegate = _weakDelegate.strongObject ;
963
+ if ([delegate respondsToSelector: @selector (_deviceInternalStateChanged: )]) {
964
+ dispatch_async (_delegateQueue, ^{
965
+ [(id ) delegate _deviceInternalStateChanged: self ];
966
+ });
967
+ }
968
+ /* END DRAGONS */
952
969
}
953
970
}
954
971
@@ -3506,6 +3523,31 @@ - (void)removeClientDataForKey:(NSString *)key endpointID:(NSNumber *)endpointID
3506
3523
3507
3524
@end
3508
3525
3526
+ /* BEGIN DRAGONS: Note methods here cannot be renamed, and are used by private callers, do not rename, remove or modify behavior here */
3527
+
3528
+ @implementation MTRDevice (MatterPrivateForInternalDragonsDoNotFeed)
3529
+
3530
+ - (BOOL )_deviceHasActiveSubscription
3531
+ {
3532
+ std::lock_guard lock (_lock);
3533
+
3534
+ return HaveSubscriptionEstablishedRightNow (_internalDeviceState);
3535
+ }
3536
+
3537
+ - (void )_deviceMayBeReachable
3538
+ {
3539
+ assertChipStackLockedByCurrentThread ();
3540
+
3541
+ MTR_LOG (" %@ _deviceMayBeReachable called" , self);
3542
+
3543
+ [self _triggerResubscribeWithReason: " SPI client indicated the device may now be reachable"
3544
+ nodeLikelyReachable: YES ];
3545
+ }
3546
+
3547
+ /* END DRAGONS */
3548
+
3549
+ @end
3550
+
3509
3551
@implementation MTRDevice (Deprecated)
3510
3552
3511
3553
+ (MTRDevice *)deviceWithNodeID : (uint64_t )nodeID deviceController : (MTRDeviceController *)deviceController
0 commit comments