Blame view

HDFwear/3rd/RTKOTASDK/RTKOTASDK.framework/Headers/RTKOTAPeripheral.h 3.57 KB
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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  //
  //  RTKOTAPeripheral.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 "RTKOTAFormat.h"
  #import "RTKOTAInstalledBin.h"
  #else
  #import <RTKLEFoundation/RTKLEFoundation.h>
  #import <RTKOTASDK/RTKOTAFormat.h>
  #import <RTKOTASDK/RTKOTAInstalledBin.h>
  #endif
  
  
  NS_ASSUME_NONNULL_BEGIN
  
  
  typedef enum : NSUInteger {
      RTKOTAProtocolTypeGATTSPP  =  0x0000,
      RTKOTAProtocolTypeGATT  =   0x0010,
      RTKOTAProtocolTypeSPP =   0x0011,
  } RTKOTAProtocolType;
  
  
  typedef enum : NSUInteger {
      RTKOTAEarbudUnkown,
      RTKOTAEarbudPrimary,
      RTKOTAEarbudSecondary,
      RTKOTAEarbudSingle,
  } RTKOTAEarbud;
  
  
  typedef enum : NSInteger {
      RTKOTABankTypeInvalid   =   -1,
      RTKOTABankTypeSingle    = 0x00,
      RTKOTABankTypeBank0,
      RTKOTABankTypeBank1,
  } RTKOTABankType;
  
  
  @class RTKOTAPeripheral;
  
  @protocol RTKOTAPeripheralDelegate <RTKLEPeripheralDelegate>
  
  /**
   * Invoked when RTKOTAClient has determined information about OTA.
   */
  - (void)OTAPeripheral:(RTKOTAPeripheral *)peripheral didDetermineInfoWithError:(nullable NSError*)error;
  
  @end
  
  
  
  @interface RTKOTAPeripheral : RTKLEPeripheral
  
  @property (readonly) BOOL infoSettled;
  @property (readonly) BOOL isBBpro;
  
  @property (nonatomic, weak) id <RTKOTAPeripheralDelegate> delegate;
  
  /**
   * OTA process version
   */
  @property (readonly) NSUInteger OTAVersion;
  
  @property (readonly) NSUInteger securityVersion;
  
  @property (readonly) BDAddressType bdAddress;
  @property (readonly) BDAddressType pairedBDAddress;
  
  @property (readonly) uint16_t appVersion;
  @property (readonly) uint16_t patchVersion;
  
  @property (readonly) NSString *linkKey;
  @property (readonly) NSUInteger tempBufferSize;
  
  @property (readonly) RTKOTABankType activeBank;
  @property (readonly) NSUInteger appFreeBank;
  @property (readonly) NSUInteger patchFreeBank;
  
  @property (readonly) BOOL bufferCheckEnable;
  @property (readonly) BOOL AESEnable;
  @property (readonly) NSUInteger encryptionMode;
  @property (readonly) BOOL copyImage;
  @property (readonly) BOOL updateMultiImages;
  
  /* RWS Upgrade related properties */
  /**
   Whether this peripheral is a one of the RWS pair.
   */
  @property (readonly) BOOL isRWS;
  
  /**
   Indicate what bud is this perpheral.
   */
  @property (readonly) RTKOTAEarbud budType;
  
  /**
  Indicate whether RWS bud is in engaged.d
  */
  @property (readonly) BOOL notEngaged;
  
  
  /**
   Indicate whether this peripheral have received images right now, but not active.
   */
  @property (readonly) BOOL upgradedCurrently;
  
  @property (readonly) uint32_t imageIndicator;
  
  @property (readonly) RTKOTAProtocolType protocolType;
  
  /**
   * The executable bins installed in Realtek peripheral.
   */
  @property (readonly) NSArray <RTKOTAInstalledBin*> *bins;
  
  
  
  
  /**
   * Indicate whether related peripheral can translate to OTA mode, and wether -enterOTAMode method can be invoked.
   */
  @property (readonly) BOOL canEnterOTAMode;
  
  /**
   * Indicate whether related peripheral can DFU upgrade immediately.
   */
  @property (readonly) BOOL canUpgradeSliently;
  
  
  /**
   * Request peripheral translate to OTA mode.
   * @discussion In translating to OTA mode, the Peripheral first get disconnected, and reboot as a different peripheral (while advertising same address). When the OTA mode peripheral be scanned, RTKOTAClientDelegate -OTAClient:didEnterOTAModeWithPeripheral: get invoked with the peripheral.
   */
  - (void)enterOTAMode;
  
  @end
  
  
  // only used for BBpro 2 dual bank situation.
  @interface RTKOTAPeripheral (DualBank)
  
  @property (readonly, nullable) NSArray <RTKOTAInstalledBin*> *inactiveBins;
  
  
  @end
  
  
  NS_ASSUME_NONNULL_END