Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / darwin / Framework / CHIP / CHIPDeviceController.h
1 /**
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *    Unless required by applicable law or agreed to in writing, software
12  *    distributed under the License is distributed on an "AS IS" BASIS,
13  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *    See the License for the specific language governing permissions and
15  *    limitations under the License.
16  */
17
18 #ifndef CHIP_DEVICE_CONTROLLER_H
19 #define CHIP_DEVICE_CONTROLLER_H
20
21 #import <Foundation/Foundation.h>
22
23 @class CHIPDevice;
24
25 NS_ASSUME_NONNULL_BEGIN
26
27 @protocol CHIPDevicePairingDelegate;
28 @protocol CHIPPersistentStorageDelegate;
29
30 @interface CHIPDeviceController : NSObject
31
32 @property (readonly, nonatomic) BOOL isRunning;
33
34 - (BOOL)pairDevice:(uint64_t)deviceID
35      discriminator:(uint16_t)discriminator
36       setupPINCode:(uint32_t)setupPINCode
37              error:(NSError * __autoreleasing *)error;
38 - (BOOL)unpairDevice:(uint64_t)deviceID error:(NSError * __autoreleasing *)error;
39 - (BOOL)stopDevicePairing:(uint64_t)deviceID error:(NSError * __autoreleasing *)error;
40 - (void)sendWiFiCredentials:(NSString *)ssid password:(NSString *)password;
41 - (void)sendThreadCredentials:(NSData *)threadDataSet;
42
43 - (CHIPDevice *)getPairedDevice:(uint64_t)deviceID error:(NSError * __autoreleasing *)error;
44
45 - (instancetype)init NS_UNAVAILABLE;
46 + (instancetype)new NS_UNAVAILABLE;
47
48 /**
49  * Return the single CHIPDeviceController we support existing.
50  */
51 + (CHIPDeviceController *)sharedController;
52
53 /**
54  * Return the Node Id assigned to the controller.
55  */
56 - (NSNumber *)getControllerNodeId;
57
58 /**
59  * Set the Delegate for the Device Pairing  as well as the Queue on which the Delegate callbacks will be triggered
60  *
61  * @param[in] delegate The delegate the pairing process should use
62  *
63  * @param[in] queue The queue on which the callbacks will be delivered
64  */
65 - (void)setPairingDelegate:(id<CHIPDevicePairingDelegate>)delegate queue:(dispatch_queue_t)queue;
66
67 /**
68  * Start the CHIP Stack. Repeated calls to startup without calls to shutdown in between are NO-OPs. Use the isRunning property to
69  * check if the stack needs to be started up.
70  *
71  * @param[in] storageDelegate The delegate for persistent storage
72  *
73  * @param[in] queue The queue on which the storage callbacks will be delivered
74  */
75 - (BOOL)startup:(id<CHIPPersistentStorageDelegate>)storageDelegate queue:(dispatch_queue_t)queue;
76
77 /**
78  * Shutdown the CHIP Stack. Repeated calls to shutdown without calls to startup in between are NO-OPs.
79  */
80 - (BOOL)shutdown;
81
82 @end
83
84 NS_ASSUME_NONNULL_END
85
86 #endif /* CHIP_DEVICE_CONTROLLER_H */