summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h
diff options
context:
space:
mode:
authorhc <haocheng.xie@respiree.com>2026-04-13 15:17:52 +0800
committerhc <haocheng.xie@respiree.com>2026-04-13 15:17:52 +0800
commitd6d9a09d505d11148599a95a5be3e1351edbe0ac (patch)
treea5f5891983d1ff207e99f683a5e151519cef4980 /libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h
parente4fb9966e762852bf17f21c8406501d42fae0b61 (diff)
Local iHealth SDK, device detail screen, iOS event fixes
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h')
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h235
1 files changed, 235 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h
new file mode 100644
index 0000000..be07c02
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h
@@ -0,0 +1,235 @@
1//
2// SDKUpdateDevice.h
3// iHealthDemoCode
4//
5// Created by daiqingquan on 16/7/27.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 UpdateDeviceError
13 */
14typedef NS_ENUM(NSUInteger, UpdateDeviceError) {
15 /// UpdateNetworkError
16 UpdateNetworkError=200,
17 /// Before starting the upgrade must go to query version first
18 UpdateOrderError=201,
19 /// UpdateDeviceDisconnect
20 UpdateDeviceDisconnect = 300,
21 /// UpdateDeviceEnd
22 UpdateDeviceEnd = 301,
23 /// UpdateInputError
24 UpdateInputError=302,
25 /// cannot update
26 NOUpdateUpgrade=400,
27};
28
29/**
30 UpdateModelStatus
31 */
32typedef NS_ENUM(NSUInteger, UpdateModelStatus) {
33 /// not busy
34 UpdateModelStatusFree = 1,
35 /// busy
36 UpdateModelStatusBusy
37};
38
39/**
40 UpdateDeviceType
41 */
42typedef NS_ENUM(NSUInteger, UpdateDeviceType) {
43 /// AM3
44 UpdateDeviceType_AM3 = 1,
45 /// AM3S
46 UpdateDeviceType_AM3S,
47 /// AM4
48 UpdateDeviceType_AM4,
49 /// PO3
50 UpdateDeviceType_PO3,
51 /// HS4
52 UpdateDeviceType_HS4,
53 /// BP5S
54 UpdateDeviceType_BP5S,
55 /// ECG
56 UpdateDeviceType_ECG,
57 /// ABPM
58 UpdateDeviceType_ABPM,
59 /// HS2
60 UpdateDeviceType_HS2,
61};
62
63
64/**
65 DisposeUpdateVersionResult
66
67 @param updateVersionDic information dictionary
68 */
69typedef void (^DisposeUpdateVersionResult)(NSDictionary * updateVersionDic);
70
71/**
72 DisposeUpdateErrorBlock
73
74 @param errorID UpdateDeviceError enum
75 */
76typedef void (^DisposeUpdateErrorBlock)(UpdateDeviceError errorID);
77
78/**
79 UpdateModuleState
80
81 @param updateModuleState UpdateModelStatus enum
82 */
83typedef void (^UpdateModuleState)(NSNumber*updateModuleState);
84
85/**
86 DisposeEndUpdateResult
87
88 @param endUpdate <#endUpdate description#>
89 */
90typedef void (^DisposeEndUpdateResult)(NSNumber* endUpdate);
91
92/**
93 DisposeDownloadFirmwareStart
94 */
95typedef void (^DisposeDownloadFirmwareStart)(void);
96
97/**
98 DisposeDownloadFirmwareFinish
99 */
100typedef void (^DisposeDownloadFirmwareFinish)(void);
101
102/**
103 DisposeUpdateProgress
104
105 @param progress 0-100
106 */
107typedef void (^DisposeUpdateProgress)(NSNumber *progress);
108
109/**
110 DisposeUpdateResult
111
112 @param updateResult <#updateResult description#>
113 */
114typedef void (^DisposeUpdateResult)(NSNumber*updateResult);
115
116/**
117 TransferSuccess
118
119 @param transferSuccess <#transferSuccess description#>
120 */
121typedef void (^TransferSuccess)(NSNumber*transferSuccess);
122
123/**
124 DisposeDownloadProgress
125
126 @param progress 0-100
127 */
128typedef void (^DisposeDownloadProgress)(NSNumber *progress);
129
130
131/**
132 SDKUpdateDevice
133 */
134@interface SDKUpdateDevice : NSObject
135
136@property(nonatomic,strong)NSString *currentDeviceUUID;
137
138/**
139 * Initialize SDKUpdateDevice controller class
140 */
141+(SDKUpdateDevice*)shareSDKUpdateDeviceInstance;
142
143/**
144 Get device Version and cloudDeviceVersion.
145
146 @param uuidString device UUID
147 @param updateVersionDic include:DeviceType、DeviceVersion、DeviceStatus(1:YES,0:NO)、CloudDeviceVersion、KeepUpdateFlag(flag,0:firstUpdate,1:go on update)、CloudUpdateServer(1:enforce update 0: optional update)、UpdateProtocolVersion(100:Equipment upgrades returned directly after the success or failure 101:Upgrade is complete only on behalf of the firmware successfully transferred, reconnect the device after the upgrade success or failure).
148 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
149 @note DeviceVerion means firmware version in Flash, may not match with the current running firmware version.
150 */
151-(void)commandGetUpdateVersionWithDeviceUUID:(NSString*)uuidString DisposeUpdateVersionResult:(DisposeUpdateVersionResult)updateVersionDic DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
152/**
153 * Get Update Module State.
154 * @param updateModuleState (0:free,1:uploading)
155 */
156-(void)commandGetUpdateModuleState:(UpdateModuleState)updateModuleState;
157/**
158 Stop Update.
159 @param uuidString device UUID
160 @param endUpdateResult (bool 1:sucess,0:fail)
161 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
162 */
163-(void)commandEndUpdateWithDeviceUUID:(NSString*)uuidString DisposeEndUpdateResult:(DisposeEndUpdateResult)endUpdateResult DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
164
165/**
166 Update Device.
167 @param uuidString device UUID
168 @param disposeDownloadFirmwareStart start update firmware from cloud.
169 @param disposeDownloadFirmwareFinish finish update firmware from cloud.
170 @param disposeUpdateProgress Update Device progress(0-100).
171 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
172 @param transferSuccess TransferSuccess Applicable to the protocol of 101.
173 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
174 */
175
176-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DownloadFirmwareStart:(DisposeDownloadFirmwareStart)disposeDownloadFirmwareStart DisposeDownloadFirmwareFinish:(DisposeDownloadFirmwareFinish)disposeDownloadFirmwareFinish DisposeUpdateProgress:(DisposeUpdateProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateResult)disposeUpdateResult TransferSuccess:(TransferSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
177
178/**
179 Update Device with local file
180
181 @param uuidString device UUID
182 @param deviceType UpdateDeviceType enum
183 @param infoFilePath path of info file
184 @param upadteFilePath path of update file
185 @param fileCRC info file CRC
186 @param disposeUpdateProgress Update Device progress(0-100)
187 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
188 @param transferSuccess TransferSuccess Applicable to the protocol of 101.
189 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
190 */
191-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateDeviceType)deviceType InfoFilePath:(NSString*)infoFilePath UpadteFilePath:(NSString*)upadteFilePath FileCRC:(NSNumber*)fileCRC DisposeUpdateProgress:(DisposeUpdateProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateResult)disposeUpdateResult TransferSuccess:(TransferSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
192
193/**
194 Update Device showing download progress
195
196 @param uuidString device UUID
197 @param disposeDownloadFirmwareStart start update firmware from cloud
198 @param disposeDownloadFirmwareFinish finish update firmware from cloud
199 @param disposeDownloadProgress Update Device progress(0-100)
200 @param disposeUpdateProgress Download file progress(0-100)
201 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
202 @param transferSuccess TransferSuccess Applicable to the protocol of 101.
203 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
204 */
205-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DownloadFirmwareStart:(DisposeDownloadFirmwareStart)disposeDownloadFirmwareStart DisposeDownloadFirmwareFinish:(DisposeDownloadFirmwareFinish)disposeDownloadFirmwareFinish DisposeDownloadProgress:(DisposeDownloadProgress)disposeDownloadProgress DisposeUpdateProgress:(DisposeUpdateProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateResult)disposeUpdateResult TransferSuccess:(TransferSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
206
207
208/**
209 Update Device showing download progress
210
211 @param uuidString device UUID
212 @param disposeDownloadFirmwareStart start update firmware from cloud
213 @param disposeDownloadFirmwareFinish finish update firmware from cloud
214 @param disposeDownloadProgress Update Device progress(0-100)
215 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
216 */
217-(void)commandStartDownloadWithDeviceUUID:(NSString*)uuidString DownloadFirmwareStart:(DisposeDownloadFirmwareStart)disposeDownloadFirmwareStart DisposeDownloadFirmwareFinish:(DisposeDownloadFirmwareFinish)disposeDownloadFirmwareFinish DisposeDownloadProgress:(DisposeDownloadProgress)disposeDownloadProgress DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
218
219
220/**
221 Update Device (You must download the firmware before calling this interface)
222
223 @param uuidString device UUID
224
225 @param disposeUpdateProgress Download file progress(0-100)
226 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
227 @param transferSuccess TransferSuccess Applicable to the protocol of 101.
228 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
229 */
230-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DisposeUpdateProgress:(DisposeUpdateProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateResult)disposeUpdateResult TransferSuccess:(TransferSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
231
232
233-(void)commandsetCloudModel:(NSNumber*)cloudModel;
234
235@end