Skip to content

Commit

Permalink
Avoid duplicate block typedef (#13481)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-apple authored and pull[bot] committed Jun 3, 2022
1 parent d2e1761 commit 3819164
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/darwin/Framework/CHIP/CHIPDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

NS_ASSUME_NONNULL_BEGIN

typedef void (^SubscriptionEstablishedHandler)(void);

@interface CHIPDevice : NSObject

- (instancetype)init NS_UNAVAILABLE;
Expand All @@ -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.
*
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/darwin/Framework/CHIP/CHIPDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <app/ReadClient.h>
#include <app/util/error-mapping.h>

typedef void (^SubscriptionEstablishedHandler)(void);

using namespace chip;
using namespace chip::app;
using namespace chip::Protocols::InteractionModel;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3819164

Please sign in to comment.