diff options
| author | hc <haocheng.xie@respiree.com> | 2026-04-13 15:17:52 +0800 |
|---|---|---|
| committer | hc <haocheng.xie@respiree.com> | 2026-04-13 15:17:52 +0800 |
| commit | d6d9a09d505d11148599a95a5be3e1351edbe0ac (patch) | |
| tree | a5f5891983d1ff207e99f683a5e151519cef4980 /libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h | |
| parent | e4fb9966e762852bf17f21c8406501d42fae0b61 (diff) | |
Local iHealth SDK, device detail screen, iOS event fixes
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h')
| -rw-r--r-- | libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h | 196 |
1 files changed, 196 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h new file mode 100644 index 0000000..7459bd9 --- /dev/null +++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h | |||
| @@ -0,0 +1,196 @@ | |||
| 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 | */ | ||
| 14 | typedef NS_ENUM(NSUInteger, UpdateFlowDeviceError) { | ||
| 15 | /// UpdateNetworkError | ||
| 16 | UpdateFlowNetworkError=200, | ||
| 17 | /// Before starting the upgrade must go to query version first | ||
| 18 | UpdateFlowOrderError=201, | ||
| 19 | /// UpdateDeviceDisconnect | ||
| 20 | UpdateFlowDeviceDisconnect = 300, | ||
| 21 | /// UpdateDeviceEnd | ||
| 22 | UpdateFlowDeviceEnd = 301, | ||
| 23 | /// UpdateInputError | ||
| 24 | UpdateFlowInputError=302, | ||
| 25 | /// UpdateErrorUnKnow | ||
| 26 | UpdateFlowErrorUnKnow=303, | ||
| 27 | /// UpdateErrorLowPower | ||
| 28 | UpdateFlowErrorLowPower=304, | ||
| 29 | /// UpdateErrorMeasuring | ||
| 30 | UpdateFlowErrorMeasuring=305, | ||
| 31 | /// cannot update | ||
| 32 | UpdateFlowNOUpdateUpgrade=400, | ||
| 33 | }; | ||
| 34 | |||
| 35 | /** | ||
| 36 | UpdateModelStatus | ||
| 37 | */ | ||
| 38 | typedef NS_ENUM(NSUInteger, UpdateFlowModelStatus) { | ||
| 39 | /// not busy | ||
| 40 | UpdateFlowModelStatusFree = 1, | ||
| 41 | /// busy | ||
| 42 | UpdateFlowModelStatusBusy | ||
| 43 | }; | ||
| 44 | |||
| 45 | /** | ||
| 46 | UpdateDeviceType | ||
| 47 | */ | ||
| 48 | typedef NS_ENUM(NSUInteger, UpdateFlowDeviceType) { | ||
| 49 | /// HS2S | ||
| 50 | UpdateFlowDeviceType_HS2S, | ||
| 51 | /// BG1S | ||
| 52 | UpdateFlowDeviceType_BG1S, | ||
| 53 | /// PT3SBT | ||
| 54 | UpdateFlowDeviceType_PT3SBT, | ||
| 55 | /// BG5S | ||
| 56 | UpdateFlowDeviceType_BG5S, | ||
| 57 | }; | ||
| 58 | |||
| 59 | |||
| 60 | /** | ||
| 61 | DisposeUpdateVersionResult | ||
| 62 | |||
| 63 | @param updateVersionDic information dictionary | ||
| 64 | */ | ||
| 65 | typedef void (^DisposeUpdateFlowVersionResult)(NSDictionary * updateVersionDic); | ||
| 66 | |||
| 67 | /** | ||
| 68 | DisposeUpdateErrorBlock | ||
| 69 | |||
| 70 | @param errorID UpdateDeviceError enum | ||
| 71 | */ | ||
| 72 | typedef void (^DisposeUpdateFlowErrorBlock)(UpdateFlowDeviceError errorID); | ||
| 73 | |||
| 74 | /** | ||
| 75 | UpdateModuleState | ||
| 76 | |||
| 77 | @param updateModuleState UpdateModelStatus enum | ||
| 78 | */ | ||
| 79 | typedef void (^UpdateFlowModuleState)(NSNumber*updateModuleState); | ||
| 80 | |||
| 81 | /** | ||
| 82 | DisposeEndUpdateResult | ||
| 83 | |||
| 84 | @param endUpdate <#endUpdate description#> | ||
| 85 | */ | ||
| 86 | typedef void (^DisposeEndUpdateFlowResult)(NSNumber* endUpdate); | ||
| 87 | |||
| 88 | /** | ||
| 89 | DisposeDownloadFirmwareStart | ||
| 90 | */ | ||
| 91 | typedef void (^DisposeFlowDownloadFirmwareStart)(void); | ||
| 92 | |||
| 93 | /** | ||
| 94 | DisposeDownloadFirmwareFinish | ||
| 95 | */ | ||
| 96 | typedef void (^DisposeFlowDownloadFirmwareFinish)(void); | ||
| 97 | |||
| 98 | /** | ||
| 99 | DisposeUpdateProgress | ||
| 100 | |||
| 101 | @param progress 0-100 | ||
| 102 | */ | ||
| 103 | typedef void (^DisposeUpdateFlowProgress)(NSNumber *progress); | ||
| 104 | |||
| 105 | /** | ||
| 106 | DisposeUpdateResult | ||
| 107 | |||
| 108 | @param updateResult <#updateResult description#> | ||
| 109 | */ | ||
| 110 | typedef void (^DisposeUpdateFlowResult)(NSNumber*updateResult); | ||
| 111 | |||
| 112 | /** | ||
| 113 | TransferSuccess | ||
| 114 | |||
| 115 | @param transferSuccess <#transferSuccess description#> | ||
| 116 | */ | ||
| 117 | typedef void (^TransferFlowSuccess)(NSNumber*transferSuccess); | ||
| 118 | |||
| 119 | /** | ||
| 120 | DisposeDownloadProgress | ||
| 121 | |||
| 122 | @param progress 0-100 | ||
| 123 | */ | ||
| 124 | typedef void (^DisposeFlowDownloadProgress)(NSNumber *progress); | ||
| 125 | |||
| 126 | |||
| 127 | /** | ||
| 128 | SDKUpdateDevice | ||
| 129 | */ | ||
| 130 | @interface SDKFlowUpdateDevice : NSObject | ||
| 131 | |||
| 132 | @property(nonatomic,strong)NSString *currentDeviceUUID; | ||
| 133 | |||
| 134 | /** | ||
| 135 | * Initialize SDKFlowUpdateDevice controller class | ||
| 136 | */ | ||
| 137 | +(SDKFlowUpdateDevice*)shareSDKUpdateDeviceInstance; | ||
| 138 | |||
| 139 | /** | ||
| 140 | Get device Version and cloudDeviceVersion. | ||
| 141 | |||
| 142 | @param uuidString device UUID | ||
| 143 | @param deviceType UpdateFlowDeviceType enum | ||
| 144 | @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). | ||
| 145 | @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions. | ||
| 146 | @note DeviceVerion means firmware version in Flash, may not match with the current running firmware version. | ||
| 147 | */ | ||
| 148 | -(void)commandGetUpdateVersionWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateFlowDeviceType)deviceType DisposeUpdateVersionResult:(DisposeUpdateFlowVersionResult)updateVersionDic DisposeErrorBlock:(DisposeUpdateFlowErrorBlock)disposeErrorBlock; | ||
| 149 | /** | ||
| 150 | * Get Update Module State. | ||
| 151 | * @param updateModuleState (0:free,1:uploading) | ||
| 152 | */ | ||
| 153 | -(void)commandGetUpdateModuleState:(UpdateFlowModuleState)updateModuleState; | ||
| 154 | /** | ||
| 155 | Stop Update. | ||
| 156 | @param uuidString device UUID | ||
| 157 | @param deviceType UpdateFlowDeviceType enum | ||
| 158 | @param endUpdateResult (bool 1:sucess,0:fail) | ||
| 159 | @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions. | ||
| 160 | */ | ||
| 161 | -(void)commandEndUpdateWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateFlowDeviceType)deviceType DisposeEndUpdateResult:(DisposeEndUpdateFlowResult)endUpdateResult DisposeErrorBlock:(DisposeUpdateFlowErrorBlock)disposeErrorBlock; | ||
| 162 | |||
| 163 | /** | ||
| 164 | Update Device with local file | ||
| 165 | |||
| 166 | @param uuidString device UUID | ||
| 167 | @param deviceType UpdateFlowDeviceType enum | ||
| 168 | @param infoFilePath path of info file | ||
| 169 | @param upadteFilePath path of update file | ||
| 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 | ||
| 173 | @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions. | ||
| 174 | */ | ||
| 175 | -(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateFlowDeviceType)deviceType InfoFilePath:(NSString*)infoFilePath UpadteFilePath:(NSString*)upadteFilePath DisposeUpdateProgress:(DisposeUpdateFlowProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateFlowResult)disposeUpdateResult TransferSuccess:(TransferFlowSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateFlowErrorBlock)disposeErrorBlock; | ||
| 176 | |||
| 177 | /** | ||
| 178 | Update Device showing download progress | ||
| 179 | |||
| 180 | @param uuidString device UUID | ||
| 181 | @param deviceType UpdateFlowDeviceType enum | ||
| 182 | @param disposeDownloadFirmwareStart start update firmware from cloud | ||
| 183 | @param disposeDownloadFirmwareFinish finish update firmware from cloud | ||
| 184 | @param disposeDownloadProgress Update Device progress(0-100) | ||
| 185 | @param disposeUpdateProgress Download file progress(0-100) | ||
| 186 | @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail). | ||
| 187 | @param transferSuccess TransferSuccess . | ||
| 188 | @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions. | ||
| 189 | */ | ||
| 190 | -(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateFlowDeviceType)deviceType DownloadFirmwareStart:(DisposeFlowDownloadFirmwareStart)disposeDownloadFirmwareStart DisposeDownloadFirmwareFinish:(DisposeFlowDownloadFirmwareFinish)disposeDownloadFirmwareFinish DisposeDownloadProgress:(DisposeFlowDownloadProgress)disposeDownloadProgress DisposeUpdateProgress:(DisposeUpdateFlowProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateFlowResult)disposeUpdateResult TransferSuccess:(TransferFlowSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateFlowErrorBlock)disposeErrorBlock; | ||
| 191 | |||
| 192 | |||
| 193 | |||
| 194 | -(void)commandsetCloudModel:(NSNumber*)cloudModel; | ||
| 195 | |||
| 196 | @end | ||
