1
wei
2021-01-21 62d098cb78296feaa6f786a20748921338db838c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//
// TuyaSmartSIGMeshManager+Config.h
// TuyaSmartBLEMeshKit
//
// Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <TuyaSmartBLEMeshKit/TuyaSmartBLEMeshKit.h>
NS_ASSUME_NONNULL_BEGIN
 
@class TuyaSmartDeviceModel;
 
@interface TuyaSmartSIGMeshManager (Config)
 
/// Reset node.
/// @param deviceModel TuyaSmartDeviceModel.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)sendNodeResetWithDeviceModel:(TuyaSmartDeviceModel *)deviceModel
                             success:(nullable TYSuccessHandler)success
                             failure:(nullable TYFailureError)failure;
 
/// Switch command.
/// @param nodeId The node ID.
/// @param state Switch status.
/// @param useUnacknowledged Whether a reply is needed, it is suggested that the group should use no and single device control yes.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)sendOnoffWithNodeId:(NSString *)nodeId
                      state:(BOOL)state
          useUnacknowledged:(BOOL)useUnacknowledged
                    success:(nullable TYSuccessHandler)success
                    failure:(nullable TYFailureError)failure;
 
/// Brightness command.
/// @param nodeId The node ID.
/// @param brightValue Brightness value : 0 -- 65535.
/// @param useUnacknowledged Whether a reply is needed, it is suggested that the group should use no and single device control yes.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)sendLightBrightWithNodeId:(NSString *)nodeId
                      brightValue:(int)brightValue
                useUnacknowledged:(BOOL)useUnacknowledged
                          success:(nullable TYSuccessHandler)success
                          failure:(nullable TYFailureError)failure;
 
/// Heating and cooling control.
/// @param nodeId The node ID.
/// @param tempValue Warm and cold value : 300 - 20000.
/// @param useUnacknowledged Whether a reply is needed, it is suggested that the group should use no and single device control yes.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)sendLightCTLTempeValueWithNodeId:(NSString *)nodeId
                               tempValue:(int)tempValue
                       useUnacknowledged:(BOOL)useUnacknowledged
                                 success:(nullable TYSuccessHandler)success
                                 failure:(nullable TYFailureError)failure;
 
/// HLS color control.
/// @param nodeId The node ID.
/// @param aHue Hue value : 0 - 65535.
/// @param aSaturation Saturation : 0 - 65535.
/// @param aLightness brightness :  l or v,0 - 65535.
/// @param useUnacknowledged Whether a reply is needed, it is suggested that the group should use no and single device control yes.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)sendLightHSLWithNodeId:(NSString *)nodeId
                           hue:(int)aHue
                 andSaturation:(int)aSaturation
                     lightness:(int)aLightness
             useUnacknowledged:(BOOL)useUnacknowledged
                       success:(nullable TYSuccessHandler)success
                       failure:(nullable TYFailureError)failure;
 
/// Setup mode.
/// @param nodeId The node ID.
/// @param alightModel 0: white light mode. 1: Color light mode.
/// @param useUnacknowledged Whether a reply is needed, it is suggested that the group should use no and single device control yes.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)sendLightModelWithNodeId:(NSString *)nodeId
                      lightModel:(int)alightModel
               useUnacknowledged:(BOOL)useUnacknowledged
                         success:(nullable TYSuccessHandler)success
                         failure:(nullable TYFailureError)failure;
 
/// General vendor protocol.
/// @param nodeId The node ID.
/// @param vendorData Data content.
/// @param isisQuery Is it a query instruction.
/// @param useUnacknowledged Whether a reply is needed, it is suggested that the group should use no and single device control yes.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)sendVendorDataWithNodeId:(NSString *)nodeId
                      vendorData:(NSData *)vendorData
                         isQuery:(BOOL)isisQuery
               useUnacknowledged:(BOOL)useUnacknowledged
                         success:(TYSuccessHandler)success
                         failure:(TYFailureError)failure;
 
/// Single device sends messages.
/// @param nodeId The node ID.
/// @param schemaArray Dps information.
/// @param dps Dps.
/// @param pcc Product size class identification.
/// @param useUnacknowledged Do you need a message reply?
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)publishDpsWithNodeId:(NSString *)nodeId
                 schemaArray:(NSArray<TuyaSmartSchemaModel *> *)schemaArray
                         dps:(NSDictionary *)dps
                         pcc:(NSString *)pcc
           useUnacknowledged:(BOOL)useUnacknowledged
                     success:(nullable TYSuccessHandler)success
                     failure:(nullable TYFailureError)failure;
 
/// Gets the status of a device.
/// @param deviceModel The device model.
- (void)getDeviceStatusWithDeviceModel:(TuyaSmartDeviceModel *)deviceModel;
 
/// Query device DPS.
/// @param deviceModel The device model.
/// @param dpIds DP ID group to query.
- (void)queryDpsWithDeviceModel:(TuyaSmartDeviceModel *)deviceModel dpIds:(NSArray<NSString *> *)dpIds;
 
@end
 
NS_ASSUME_NONNULL_END