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
//
// TuyaSmartSingleTransfer.h
// TuyaSmartDeviceCoreKit
//
// Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <Foundation/Foundation.h>
 
typedef NS_ENUM(NSUInteger, TuyaSmartTransferState) {
    TuyaSmartTransferConnected = 1, // Connected
    TuyaSmartTransferDisconnected, // Disconnected
};
 
@class TuyaSmartSingleTransfer;
@protocol TuyaSmartTransferDelegate<NSObject>
 
/// When the connection state changes, the delegate will execute.
/// @param transfer transfer.
/// @param state TuyaSmartTransferState.
- (void)transfer:(TuyaSmartSingleTransfer *)transfer didUpdateConnectState:(TuyaSmartTransferState)state;
 
/// When received device data, the delegate will execute.
/// @param transfer transfer.
/// @param devId Device Id.
/// @param data Received Data.
- (void)transfer:(TuyaSmartSingleTransfer *)transfer didReciveDataWithDevId:(NSString *)devId data:(NSData *)data;
 
@end
 
__deprecated_msg("The channel already merged. We will provide new way to support it.") @interface TuyaSmartSingleTransfer : NSObject
 
@property (nonatomic, weak) id<TuyaSmartTransferDelegate> delegate;
 
#if TARGET_OS_IOS
 
/// Start Connect.
- (void)startConnect;
 
/// The connection state.
/// @return Connection Result.
- (BOOL)isConnected;
 
/// Close the channel; Because of channel merging, it will not be closed because it will affect the normal device subscription process.
- (void)close __deprecated_msg("will remove it");;
 
/// Subscribe device.
/// @param devId The device ID.
- (void)subscribeDeviceWithDevId:(NSString *)devId;
 
/// Unsubscribe device.
/// @param devId The device ID.
- (void)unsubscribeDeviceWithDevId:(NSString *)devId;
 
#endif
 
@end