75d24c15
yangbin
123
|
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
|
//
// RTKOTAProfile.h
// RTKOTASDK
//
// Created by jerome_gu on 2019/4/16.
// Copyright © 2019 Realtek. All rights reserved.
//
#ifdef RTK_SDK_IS_STATIC_LIBRARY
#import "libRTKLEFoundation.h"
#import "RTKOTAPeripheral.h"
#import "RTKMultiDFUPeripheral.h"
#else
#import <RTKLEFoundation/RTKLEFoundation.h>
#import <RTKOTASDK/RTKOTAPeripheral.h>
#import <RTKOTASDK/RTKMultiDFUPeripheral.h>
#endif
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(uint8_t, RTKOTAAdvbud) {
RTKOTAAdvbudSingle,
RTKOTAAdvbudPrimary,
RTKOTAAdvbudSecondary,
};
@interface RTKOTAProfile : RTKLEProfile
// Instantiate OTAPeripheral from a known CBPeripheral object.
// You typically already have a CBPeripheral to upgrade within your CBCentralManager.
// deprecated. use -instantiatePeripheralWithCBPeripheral: instead.
- (nullable RTKOTAPeripheral*)OTAPeripheralFromCBPeripheral:(CBPeripheral *)peripheral;
// Silent upgrade
- (nullable RTKDFUPeripheral*)DFUPeripheralOfOTAPeripheral:(RTKOTAPeripheral *)peripheral;
- (void)connectToDFUPeripheral:(RTKDFUPeripheral *)peripheral;
// Normal upgrade
- (void)translatePeripheral:(RTKOTAPeripheral*)peripheral toDFUPeripheralWithCompletion:(void(^)(BOOL success, NSError *_Nullable err, RTKDFUPeripheral *_Nullable peripheral))handler;
/** Discover for companion peripheral. Used for RWS upgrade. **/
- (void)scanCompanionPeripheralOf:(RTKOTAPeripheral *)peripheral withCompletionHandler:(void(^)(BOOL success, NSError*_Nullable err, RTKOTAPeripheral *_Nullable targetPeripheral))handler;
@end
@interface RTKOTAProfile (Protect)
/* Protected */
- (void)_scanDFUPerpheralOf:(RTKOTAPeripheral*)peripheral withCompletion:(void(^)(BOOL success, NSError *_Nullable err, RTKDFUPeripheral *_Nullable peripheral))handler;
@end
NS_ASSUME_NONNULL_END
|