Skip to content

Commit

Permalink
Regenerating ZAP
Browse files Browse the repository at this point in the history
  • Loading branch information
woody-apple committed Jul 1, 2022
1 parent ee0d1b6 commit caba50b
Show file tree
Hide file tree
Showing 38 changed files with 121 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

MTRDeviceController * commissioner = CurrentCommissioner();
ChipLogProgress(chipTool, "Sending command to node 0x" ChipLogFormatX64, ChipLogValueX64(mNodeId));
[commissioner getConnectedDevice:mNodeId
queue:callbackQueue
completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) {
[commissioner getDevice:mNodeId
queue:callbackQueue
completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) {
if (error != nil) {
SetCommandExitStatus(error, "Error getting connected device");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip-tool.command", DISPATCH_QUEUE_SERIAL);
MTRDeviceController * commissioner = CurrentCommissioner();
[commissioner
getConnectedDevice:mNodeId
queue:callbackQueue
completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) {
getDevice:mNodeId
queue:callbackQueue
completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) {
CHIP_ERROR err = CHIP_NO_ERROR;
if (error) {
err = MTRErrorToCHIPErrorCode(error);
Expand Down
22 changes: 11 additions & 11 deletions examples/darwin-framework-tool/commands/tests/TestCommandBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ class TestCommandBridge : public CHIPCommandBridge,
mConnectedDevices[identity] = nil;
}

[controller getConnectedDevice:value.nodeId
queue:mCallbackQueue
completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) {
if (error != nil) {
SetCommandExitStatus(error);
return;
}

mConnectedDevices[identity] = device;
NextTest();
}];
[controller getDevice:value.nodeId
queue:mCallbackQueue
completionHandler:^(MTRDevice * _Nullable device, NSError * _Nullable error) {
if (error != nil) {
SetCommandExitStatus(error);
return;
}

mConnectedDevices[identity] = device;
NextTest();
}];
return CHIP_NO_ERROR;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ BOOL CHIPGetConnectedDevice(MTRDeviceConnectionCallback completionHandler)

// Let's use the last device that was paired
uint64_t deviceId = CHIPGetLastPairedDeviceId();
return [controller getConnectedDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler];
return [controller getDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler];
}

MTRDevice * CHIPGetDeviceBeingCommissioned(void)
Expand All @@ -154,7 +154,7 @@ BOOL CHIPGetConnectedDeviceWithID(uint64_t deviceId, MTRDeviceConnectionCallback
{
MTRDeviceController * controller = InitializeCHIP();

return [controller getConnectedDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler];
return [controller getDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler];
}

BOOL CHIPIsDevicePaired(uint64_t deviceId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@

#define NOT_APPLICABLE_STRING @"N/A"

@interface MTRDeviceController (ToDoRemove)

/**
* TODO: Temporary until PairingDelegate is fixed to clearly communicate this
* information to consumers.
* This should be migrated over to the proper pairing delegate path
*/
- (BOOL)deviceBeingCommissionedOverBLE:(uint64_t)deviceId;

@end

@interface QRCodeViewController ()

@property (nonatomic, strong) AVCaptureSession * captureSession;
Expand Down Expand Up @@ -486,7 +497,8 @@ - (void)onPairingComplete:(NSError * _Nullable)error
} else {
MTRDeviceController * controller = InitializeCHIP();
uint64_t deviceId = CHIPGetLastPairedDeviceId();
if ([controller deviceBeingCommissionedOverBLE:deviceId]) {
if ([controller respondsToSelector:@selector(deviceBeingCommissionedOverBLE:)
&& [controller deviceBeingCommissionedOverBLE:deviceId]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self->_deviceList refreshDeviceList];
[self retrieveAndSendWiFiCredentials];
Expand Down
4 changes: 1 addition & 3 deletions src/darwin/Framework/CHIP/MTRAttributeCacheContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@

#import <Foundation/Foundation.h>

#import <Matter/MTRDeviceController.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

@class MTRSubscribeParams;

@interface MTRAttributeCacheContainer : NSObject

/**
Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTRCertificates.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

@protocol MTRKeypair;

@interface MTRCertificates : NSObject

/**
Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTRCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/

#import <Foundation/Foundation.h>

@class MTRDevice;
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTRCommissioningParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

@protocol MTRDeviceAttestationDelegate;

/**
* The class definition for the CHIPCommissioningParameters
*
Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRControllerAccessControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#pragma once

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
7 changes: 1 addition & 6 deletions src/darwin/Framework/CHIP/MTRControllerFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

@protocol MTRPersistentStorageDelegate;
@protocol MTRKeypair;

@class MTRDeviceController;
@class MTRDeviceControllerStartupParams;

@interface MTRControllerFactoryParams : NSObject
/*
* Storage delegate must be provided for correct functioning of Matter
Expand Down
5 changes: 1 addition & 4 deletions src/darwin/Framework/CHIP/MTRDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define MTR_DEVICE_H

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -89,10 +90,6 @@ extern NSString * const MTRNullValueType;
extern NSString * const MTRStructureValueType;
extern NSString * const MTRArrayValueType;

@class MTRAttributeCacheContainer;
@class MTRReadParams;
@class MTRSubscribeParams;

@interface MTRDevice : NSObject

- (instancetype)init NS_UNAVAILABLE;
Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
4 changes: 1 addition & 3 deletions src/darwin/Framework/CHIP/MTRDeviceController+XPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
*/

#import <Foundation/Foundation.h>

#import <Matter/MTRCluster.h>
#import <Matter/MTRDeviceController.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
16 changes: 2 additions & 14 deletions src/darwin/Framework/CHIP/MTRDeviceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
#define MTR_DEVICE_CONTROLLER_H

#import <Foundation/Foundation.h>

#import <Matter/MTROnboardingPayloadParser.h>

@class MTRDevice;
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -96,23 +93,14 @@ typedef void (^MTRDeviceConnectionCallback)(MTRDevice * _Nullable device, NSErro
- (BOOL)stopDevicePairing:(uint64_t)deviceID error:(NSError * __autoreleasing *)error;

- (nullable MTRDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __autoreleasing *)error;
- (BOOL)getConnectedDevice:(uint64_t)deviceID
queue:(dispatch_queue_t)queue
completionHandler:(MTRDeviceConnectionCallback)completionHandler;
- (BOOL)getDevice:(uint64_t)deviceID queue:(dispatch_queue_t)queue completionHandler:(MTRDeviceConnectionCallback)completionHandler;

- (BOOL)openPairingWindow:(uint64_t)deviceID duration:(NSUInteger)duration error:(NSError * __autoreleasing *)error;
- (nullable NSString *)openPairingWindowWithPIN:(uint64_t)deviceID
duration:(NSUInteger)duration
discriminator:(NSUInteger)discriminator
setupPIN:(NSUInteger)setupPIN
error:(NSError * __autoreleasing *)error;

/**
* Temporary until PairingDelegate is fixed to clearly communicate this
* information to consumers.
*/
- (BOOL)deviceBeingCommissionedOverBLE:(uint64_t)deviceId;

/**
* Controllers are created via the MTRControllerFactory object.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ - (MTRDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:(NSError * __
return [[MTRDevice alloc] initWithDevice:deviceProxy];
}

- (BOOL)getConnectedDevice:(uint64_t)deviceID
queue:(dispatch_queue_t)queue
completionHandler:(MTRDeviceConnectionCallback)completionHandler
- (BOOL)getDevice:(uint64_t)deviceID
queue:(dispatch_queue_t)queue
completionHandler:(MTRDeviceConnectionCallback)completionHandler
{
__block CHIP_ERROR errorCode = CHIP_ERROR_INCORRECT_STATE;
if (![self isRunning]) {
Expand Down
4 changes: 1 addition & 3 deletions src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
* limitations under the License.
*/

#import <Matter/MTRDeviceController.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

@class MTRDeviceControllerXPCConnection;

@interface MTRDeviceControllerOverXPC : MTRDeviceController

- (instancetype)init NS_UNAVAILABLE;
Expand Down
6 changes: 3 additions & 3 deletions src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ - (BOOL)deviceBeingCommissionedOverBLE:(uint64_t)deviceId
return NO;
}

- (BOOL)getConnectedDevice:(uint64_t)deviceID
queue:(dispatch_queue_t)queue
completionHandler:(MTRDeviceConnectionCallback)completionHandler
- (BOOL)getDevice:(uint64_t)deviceID
queue:(dispatch_queue_t)queue
completionHandler:(MTRDeviceConnectionCallback)completionHandler
{
dispatch_async(_workQueue, ^{
dispatch_group_t group = dispatch_group_create();
Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
#define MTR_DEVICE_CONTROLLER_STARTUP_PARAMS_H

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

@protocol MTRKeypair;

@interface MTRDeviceControllerStartupParams : NSObject
/**
* Keypair used to sign operational certificates. This is the root CA keypair
Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRDevicePairingDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRError.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN
FOUNDATION_EXPORT NSErrorDomain const MTRErrorDomain;
Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRKeypair.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>
#import <Security/Security.h>

NS_ASSUME_NONNULL_BEGIN
Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTRManualSetupPayloadParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/

#import <Foundation/Foundation.h>

@class MTRSetupPayload;
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTROnboardingPayloadParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

@class MTRSetupPayload;

typedef NS_ENUM(NSUInteger, MTROnboardingPayloadType) {
MTROnboardingPayloadTypeQRCode = 0,
MTROnboardingPayloadTypeManualCode,
Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRPersistentStorageDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTRQRCodeSetupPayloadParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/

#import <Foundation/Foundation.h>

@class MTRSetupPayload;
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRSetupPayload.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
1 change: 1 addition & 0 deletions src/darwin/Framework/CHIP/MTRThreadOperationalDataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/Matter.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
Loading

0 comments on commit caba50b

Please sign in to comment.