diff --git a/src/darwin/Framework/CHIP/CHIPDevice.h b/src/darwin/Framework/CHIP/CHIPDevice.h index e90c3af2fa398e..6731593db70f4e 100644 --- a/src/darwin/Framework/CHIP/CHIPDevice.h +++ b/src/darwin/Framework/CHIP/CHIPDevice.h @@ -22,8 +22,6 @@ NS_ASSUME_NONNULL_BEGIN -typedef void (^SubscriptionEstablishedHandler)(void); - @interface CHIPDevice : NSObject - (instancetype)init NS_UNAVAILABLE; @@ -40,7 +38,7 @@ typedef void (^SubscriptionEstablishedHandler)(void); * * The array passed to reportHandler will contain CHIPAttributeReport instances. * - * subscriptionEstablishedHandler, if not nil, will be called once the + * subscriptionEstablished block, if not nil, will be called once the * subscription is established. This will be _after_ the first (priming) call * to reportHandler. * @@ -50,7 +48,7 @@ typedef void (^SubscriptionEstablishedHandler)(void); minInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler; + subscriptionEstablished:(nullable void (^)(void))subscriptionEstablishedHandler; @end @interface CHIPAttributePath : NSObject diff --git a/src/darwin/Framework/CHIP/CHIPDevice.mm b/src/darwin/Framework/CHIP/CHIPDevice.mm index a79c645202ecc1..f9ae4bbaa549a3 100644 --- a/src/darwin/Framework/CHIP/CHIPDevice.mm +++ b/src/darwin/Framework/CHIP/CHIPDevice.mm @@ -27,6 +27,8 @@ #include #include +typedef void (^SubscriptionEstablishedHandler)(void); + using namespace chip; using namespace chip::app; using namespace chip::Protocols::InteractionModel; @@ -138,7 +140,7 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue minInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + subscriptionEstablished:(nullable void (^)(void))subscriptionEstablishedHandler { DeviceProxy * device = [self internalDevice]; if (!device) {