diff options
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h')
| -rw-r--r-- | libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h | 174 |
1 files changed, 174 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h new file mode 100644 index 0000000..8e137d5 --- /dev/null +++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h | |||
| @@ -0,0 +1,174 @@ | |||
| 1 | // | ||
| 2 | // iHealthHS6.h | ||
| 3 | // iHealthHS6 | ||
| 4 | // | ||
| 5 | // Created by daiqingquan on 15/11/25. | ||
| 6 | // Copyright © 2015年 daiqingquan. All rights reserved. | ||
| 7 | // | ||
| 8 | |||
| 9 | #import <Foundation/Foundation.h> | ||
| 10 | #import "HealthUser.h" | ||
| 11 | #import "HSMacroFile.h" | ||
| 12 | |||
| 13 | /*HS6 error instruction*/ | ||
| 14 | /* | ||
| 15 | error code: | ||
| 16 | |||
| 17 | 7:User verify error; | ||
| 18 | |||
| 19 | 101,102,103,104:networkerror | ||
| 20 | |||
| 21 | */ | ||
| 22 | |||
| 23 | |||
| 24 | |||
| 25 | /** | ||
| 26 | HS6 | ||
| 27 | */ | ||
| 28 | @interface iHealthHS6 : NSObject | ||
| 29 | |||
| 30 | +(iHealthHS6 *)shareIHHS6Controller; | ||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | /** | ||
| 35 | Binding QR Device | ||
| 36 | When using the SDK for the first time, measuring method needs to be called to finish user verification. | ||
| 37 | Import parameter: | ||
| 38 | @param tempUser Properties included: clientID,clientSecret,userAccount,height,weight,isAthlete,birthday,sex. | ||
| 39 | clientID & clientSecret: the only identification for users of the SDK, requires registration from iHealth administrator, please email: daiqingquan@ihealthlabs.com.cn for more information. | ||
| 40 | @param tempDeviceID device Mac | ||
| 41 | Return parameters: | ||
| 42 | The measurement via SDK will be operated in the case of 1-4, and will be terminated if any of 5-8 occurs. The interface needs to be re-called after analyzing the return parameters. | ||
| 43 | Notice: when a new user registers via SDK, an ‘iHealth disclaimer’ will pop up automatically, and will require the user to agree in order to continue. SDK applications require an Internet connection; there is 10-day trial period if the SDK cannot connect to the internet, the SDK is fully functional during tryout period, but will be terminated without a working internet connection after 10 days. | ||
| 44 | @param result Action = 1;(1:bind sucess 2:full user bind faild 3,:ts error bind faild 4 other), | ||
| 45 | BineNum=10 | ||
| 46 | MAC | ||
| 47 | Position = 1;(user in weight number) | ||
| 48 | SetWifi=0 | ||
| 49 | Status = 1;(1:binding 2:unbind) | ||
| 50 | TS (time); | ||
| 51 | @param error error code | ||
| 52 | */ | ||
| 53 | -(void)cloudCommandUserBinedQRDeviceWithUser:(HealthUser *)tempUser deviceID:(NSString *)tempDeviceID binedResult:(BinedQRDeviceBlock)result binedError:(BinedQRDeviceErrorBlock)error; | ||
| 54 | |||
| 55 | |||
| 56 | |||
| 57 | /** | ||
| 58 | unBind QR Device | ||
| 59 | |||
| 60 | Import parameter: | ||
| 61 | @param tempUser Properties included:clientID,clientSecret,userAccount. | ||
| 62 | |||
| 63 | @param tempDeviceID device Mac | ||
| 64 | Return parameters: | ||
| 65 | @param result Action = 1;(1:bind sucess 2:full user bind faild 3,:ts error bind faild 4 other), | ||
| 66 | MAC | ||
| 67 | Status = 2;(1:binding 2:unbind) | ||
| 68 | TS | ||
| 69 | @param error error code | ||
| 70 | */ | ||
| 71 | -(void)cloudCommandUserDisBinedQRDeviceForUser:(HealthUser *)tempUser withDeviceID:(NSString *)tempDeviceID disBinedResult:(DisBinedQRDeviceBlock)result disBinedError:(DisBinedQRDeviceErrorBlock)error; | ||
| 72 | |||
| 73 | /** | ||
| 74 | * set HS6 wifi | ||
| 75 | * Import parameter: | ||
| 76 | * @param password - wifi password. | ||
| 77 | * Return parameters: | ||
| 78 | |||
| 79 | * @param disposeHS6SuccessBlock - set sucess | ||
| 80 | |||
| 81 | * @param disposeHS6FailBlock - set faild | ||
| 82 | |||
| 83 | * @param disposeHS6EndBlock - end set | ||
| 84 | |||
| 85 | * @param disposeHS6ErrorBlock - error code | ||
| 86 | * Error code definition: | ||
| 87 | * refer to “error” : HS6 error instruction. | ||
| 88 | */ | ||
| 89 | |||
| 90 | /** | ||
| 91 | Set HS6 wifi | ||
| 92 | Import parameter: | ||
| 93 | @param password wifi password. | ||
| 94 | |||
| 95 | Return parameters: | ||
| 96 | @param disposeHS6SuccessBlock set sucess | ||
| 97 | @param disposeHS6FailBlock set faild | ||
| 98 | @param disposeHS6EndBlock end set | ||
| 99 | @param disposeHS6ErrorBlock error code | ||
| 100 | */ | ||
| 101 | -(void)commandSetHS6WithPassWord:(NSString*)password disposeHS6SuccessBlock:(DisposeHS6SuccessBlock)disposeHS6SuccessBlock disposeHS6FailBlock:(DisposeHS6FailBlock)disposeHS6FailBlock disposeHS6EndBlock:(DisposeHS6EndBlock)disposeHS6EndBlock disposeHS6ErrorBlock:(DisposeHS6ErrorBlock)disposeHS6ErrorBlock; | ||
| 102 | |||
| 103 | |||
| 104 | |||
| 105 | /** | ||
| 106 | Get open APItoken | ||
| 107 | Get AccessToken of HS6 user,and this method is a time consuming operation that cannot be calledin the main thread. | ||
| 108 | After get AccessToken, you can call openApi(http://developer.ihealthlabs.com) to pull data form iHealth cloud. | ||
| 109 | Import parameter: | ||
| 110 | @param tempUser Properties included: clientID,clientSecret,userAccount. | ||
| 111 | Return parameters: | ||
| 112 | @param getOpenAPIBlock (NSDictionary){@link iHealthDeviceHs6Callback#onNotify(String, String, String, String)} and its' | ||
| 113 | action is {@link #ACTION_HS6_GET_TOKEN}. | ||
| 114 | |||
| 115 | eg. {APIName="OpenApiActivity OpenApiBG OpenApiBP OpenApiFood OpenApiSleep OpenApiSpO2 OpenApiSport | ||
| 116 | OpenApiUserInfo OpenApiWeight", | ||
| 117 | AccessToken="9fuIPl3Bo6lqJfbYjXFjuPnNwNqVfxjiUE7cMCZSjrX22RJSoKf28jtIhI0v86wjV5GJ21bc6LvMNbfYG0QsZ7cYuUSO0EkaiFTST*GcjZvvTKxfEOmhQTfLXTXYAOA | ||
| 118 | wCoXlEs0DRqJaHZU5JS30ssyLNlqADPV9dlvWZitQmIfXjF6CSZM2SuRCD*bbbrqtwBsn*sC24OEoQCRpDau6wQ", | ||
| 119 | ClassParamentKey = { | ||
| 120 | "client_id" = 2a8387e3f4e94407a3a767a72dfd52ea; | ||
| 121 | "client_para" = 99; | ||
| 122 | "client_secret" = fd5e845c47944a818bc511fb7edb0a77; | ||
| 123 | hash = d86bf92a851bf9211851d8e6827eea55; | ||
| 124 | username = "he@12.com"; | ||
| 125 | }; | ||
| 126 | "Expires":3672000, | ||
| 127 | *"RefreshToken":"9fuIPl3Bo6lqJfbYjXFjuPnNwNqVfxjiUE7cMCZSjrX22RJSoKf28jtIhI0v86wjV5GJ21bc6LvMNbfYG0QsZ2TcvTQNInn85XdPIJRIe-9zB-eaY5utBVKmtLjJdEEmBlx5le5mT6oF7WBwVkwx*CUpSsdgUcyE3mG3FJnSHlajogaUSUgvMgmgUaVEMYzv4pcbCUltGNAMqJt5wwvBZA", | ||
| 128 | * "RefreshTokenExpires":31536000, | ||
| 129 | * "UUID":"", | ||
| 130 | * "UserID":"51027f3e09a14a55917e687c628a0f13", | ||
| 131 | * "UserNameKey" | ||
| 132 | * "UserOpenID" | ||
| 133 | * "UserRegion":"https:\/\/api.ihealthlabs.com.cn:8443", | ||
| 134 | * "client_para":"random_str"} | ||
| 135 | @param errorBlock HS6 error instruction. | ||
| 136 | */ | ||
| 137 | -(void)commandHS6GetOpenAPITokenWithUser:(HealthUser *)tempUser withSuccessBlock:(DisposeHS6GetOpenAPISuccessBlock)getOpenAPIBlock withErrorBlock:(DisposeHS6GetOpenAPIErrorBlock)errorBlock; | ||
| 138 | |||
| 139 | |||
| 140 | |||
| 141 | |||
| 142 | |||
| 143 | |||
| 144 | |||
| 145 | /** | ||
| 146 | sync Weight Unit | ||
| 147 | Import parameter: | ||
| 148 | @param tempUser Properties included:clientID,clientSecret,userAccount. | ||
| 149 | @param unit IHHS6SDKUnitWeight_kg,IHHS6SDKUnitWeight_lb,IHHS6SDKUnitWeight_oz | ||
| 150 | Return parameters: | ||
| 151 | @param unitBlock YES or NO | ||
| 152 | @param errorBlock error code | ||
| 153 | */ | ||
| 154 | -(void)commandHS6WithUser:(HealthUser *)tempUser withSyncWeightUnit:(IHHS6SDKUnitWeight)unit withSuccessBlock:(DisposeHS6SyncWeightUnitSuccessBlock)unitBlock withErrorBlock:(DisposeHS6SyncWeightUnitErrorBlock)errorBlock; | ||
| 155 | |||
| 156 | |||
| 157 | /** | ||
| 158 | DownloadHS6Data | ||
| 159 | |||
| 160 | Import parameter: | ||
| 161 | @param tempUser Properties included: clientID,clientSecret,userAccount | ||
| 162 | clientID & clientSecret: the only identification for users of the SDK, requires registration from iHealth administrator, please email: sdk@ihealthlabs.com.cn for more information. | ||
| 163 | @param downloadTS :From 1970, the number of ms, download data download all data after this point in time. | ||
| 164 | @param PageSize :Number of downloads per data. | ||
| 165 | Return parameters: | ||
| 166 | @param getHS6Data AllHS6Data | ||
| 167 | |||
| 168 | @param blockHS6LastTSFromCloud The last timestamp of the data download can be passed in at the next download, and all the data after the timestamp is downloaded. | ||
| 169 | |||
| 170 | @param errorBlock error code 101,102,103,104:networkerror 400:input error 209/225:The user doesn't exist | ||
| 171 | */ | ||
| 172 | -(void)commandDownloadHS6Data:(HealthUser *)tempUser withDownloadTS:(long)downloadTS withPageSize:(long)PageSize withSuccessBlock:(BlockHS6DataFromCloud)getHS6Data blockHS6LastTSFromCloud:(BlockHS6LastTSFromCloud)blockHS6LastTSFromCloud withErrorBlock:(DisposeHS6ErrorBlock)errorBlock; | ||
| 173 | |||
| 174 | @end | ||
