Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Darwin] Avoid duplicate block typedef #13481

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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