summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h')
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h399
1 files changed, 399 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h
new file mode 100644
index 0000000..96b4829
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h
@@ -0,0 +1,399 @@
1//
2// HS2S.h
3// iHealthSDKStatic
4//
5// Created by jing on 2019/5/8.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HSMacroFile.h"
11NS_ASSUME_NONNULL_BEGIN
12
13@interface HS2S : NSObject
14
15@property (strong, nonatomic) NSString *serialNumber;
16@property (strong, nonatomic) NSString *currentUUID;
17@property (nonatomic,strong) NSNumber *hs2sDeviceFlag;
18/**
19 *Get HS2S DeviceInfo (After the HS2S device is successfully connected, the interface must be called to synchronize the device time. Otherwise, the offline data measurement time error will be caused)
20
21 * @param deviceInfo Contains device IDPS info(FirmwareVersion,HardwareVersion,Manufacture,ModelNumber,ProtocolString,SerialNumber),user count ,HS2S current unit(1:Kg,2:LB,3:ST),battery
22 * Example:
23 * {
24 Battary = 70;
25 DeviceName = HS2S;
26 FirmwareVersion = "0.5.4";
27 HardwareVersion = "1.0.0";
28 Manufacture = iHealth;
29 ModelNumber = "HS2S 11070";
30 ProtocolString = "com.jiuan.BFSV22";
31 SerialNumber = 004D320CA04D;
32 Unit = 1;
33 UserCount = 1;
34 * }
35 * @param disposeErrorBlock - error code
36 * Error code definition:
37 * refer to “error” : HS2S error instruction.
38 */
39-(void)commandGetHS2SDeviceInfo:(DisposeHS2SDeviceInfo)deviceInfo DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
40
41
42/**
43 *Get HS2S battery
44
45 * @param battary HS2Sbattery [Range:0~100]%
46 * @param disposeErrorBlock - error code
47 * Error code definition:
48 * refer to “error” : HS2S error instruction.
49 */
50-(void)commandGetHS2SBattery:(DisposeHS2SBatteryBlock)battary DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
51
52
53/**
54
55 * SetUnit
56
57 * Import parameter:
58 * @param tempUnit -Unit displayed on HS2S: HSUnit_Kg、HSUnit_LB、HSUnit_ST。
59 * Return parameters:
60 * @param result YES:Success NO:Failed
61 * @param disposeErrorBlock - error code
62 * Error code definition:
63 * refer to “error” : HS2S error instruction.
64 */
65
66-(void)commandSetHS2SUnit:(HSUnit)tempUnit result:(DisposeHS2SResult)result DisposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
67
68/**
69 * Get HS2S UserInfo
70 * Return parameters:
71 * @param userInfo NSDictionary type,contains: UserCount and UserInfo
72 * Example:
73 * {
74 UserCount = 1;
75 UserInfo =(
76 {
77 "UserInfo_Age" = 20;
78 "UserInfo_Height" = 100;
79 "UserInfo_CreatTS" = 1558406503; //User creat time
80 "UserInfo_ID" = <69486561 6c746831 32333435 36373839>;
81 "UserInfo_ImpedanceMark" = 1; //0 Don't measure 1 Measure
82 "UserInfo_SEX" = 1; //0 female 1 male,
83 "UserInfo_Weight" = "79.5";
84 "UserInfo_Fitness" = 1; //0:Don't fitness 1:fitness
85 }
86 );
87 * }
88 * @param disposeErrorBlock - error code
89 * Error code definition:
90 * refer to “error” : HS2S error instruction.
91 */
92-(void)commandGetHS2SUserInfo:(DisposeHS2SUserInfo)userInfo DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
93
94/**
95 * Create or Update HS2S UserInfo (The HS2S device only supports the creation of a maximum of 8 users)
96 * Import parameter:
97 * @param user (user information must be entered in accordance with the reference range, otherwise it may be impossible to measure the accurate body fat information)
98
99 * contains:
100 * hs2SUserID:NSData type,The user ID must be 16 bytes or the user creation fails,
101 * createTS:NSInteger type,The unit of time is seconds ,
102 * weight:NSNumber type,range:20-150kg,
103 * age:NSNumber type,range:18-99 years,
104 * height:NSNumber type,range:90-220cm
105 * sex:0 female 1 male,
106 * impedanceMark: 0 Don't measure 1 Measure
107 * fitnessMark:0 Don't fitness 1:fitness
108 * Return parameters:
109 * @param result YES:Success NO:Failed
110 * @param disposeErrorBlock - error code
111 * Error code definition:
112 * refer to “error” : HS2S error instruction.
113 */
114-(void)commandUpdateHS2SUserInfoWithUser:(HealthUser*)user result:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
115
116/**
117 * Delete HS2S User
118 * Import parameter:
119 * @param userID :NSData type,The user ID must be 16 bytes or the user creation fails,
120 * Return parameters:
121 * @param result YES:Success NO:Failed
122 * @param disposeErrorBlock - error code
123 * Error code definition:
124 * refer to “error” : HS2S error instruction.
125 */
126-(void)commandDeleteHS2SUserWithUserID:(NSData*)userID result:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
127
128/**
129 * Get HS2S Memory data count
130 * Import parameter:
131 * @param userID :NSData type,The user ID must be 16 bytes or the user creation fails,
132 * Return parameters:
133 * @param count NSNumber Type,memory count
134 * @param disposeErrorBlock - error code
135 * Error code definition:
136 * refer to “error” : HS2S error instruction.
137 */
138-(void)commandGetHS2SMemoryDataCountWithUserID:(NSData*)userID memoryCount:(DisposeHS2SMemoryCountBlock)count DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
139
140/**
141 * Get HS2S Memory data
142
143 Lean mass calculation formula: result = weight * (1 - body fat percentage)
144 BMI calculation formula: result = weight / (height * height)
145 BMR calculation formula:
146 If no fat is measured
147 {
148 For men:
149 P = 13.397* weight + 4.799* height – 5.677* age + 88.362
150 For women:
151 P = 9.247* weight + 3.098* height – 4.330* age + 447.593
152 If the user enters the sport level in the app, correct the P:
153 Sport level=1, P = P*1.0
154 Sport level = 2, P = P*1.05
155 Sport level = 3, P = P*1.10
156 }
157 When fat is measured:
158 {
159 P=370 + 21.6*Lean mass(kg )
160 }
161 * Import parameter:
162 * @param userID :NSData type,The user ID must be 16 bytes or the user creation fails,
163 * Return parameters:
164 * @param memoryData NSArray Type,memory data
165 * Example:
166 * (
167
168 {
169 DeviceMac = 004D320CA04D; //device mac
170 HS2SBodyAge = 10; //body age
171 HS2SBodyWaterPercentAge = "39.3"; //body moisture rate
172 HS2SBoneMineral = "1.9"; //Bone salt
173 HS2SFatControl = 0; //Fat Control
174 HS2SFatWeight = 0; //Fat weight
175 HS2SFitness = 1; //0:Don't fitness 1:fitness
176 HS2SImpedance = (); //NSArray type ,Impedance
177 HS2SIsRightTS = 1; //0:Incorrect, unsynchronized time on measured data 1:Correct, synchronize the measured data after the time
178 HS2SMeasureTS = "2019-05-18 08:56:38 +0000";
179 HS2SMuscle = "13.1"; //Muscle mass
180 HS2SMuscleControl = 0; //Muscle Control
181 HS2SProteinPercentAge = "9.8"; //Protein rate
182 HS2SResultBodyFatPercentAge = "44.2"; //Body fat rate
183 HS2SBodyWeightFlag = 0; //0:Body fat was not measured 1:Measure body fat
184 HS2SSkeletalMuscle = 0; //Skeletal Muscle
185 HS2SStandardWeight = 0; //Standard Weight
186 HS2SVFR = 29; //Visceral fat grade
187 HS2SWeightControl = 0; //Weight Control
188 HS2SWeigthResult = "79.5";
189 "UserInfo_Age" = 18;
190 "UserInfo_Height" = 100;
191 "UserInfo_SEX" = 1;
192 }
193 * )
194 * @param disposeErrorBlock - error code
195 * Error code definition:
196 * refer to “error” : HS2S error instruction.
197 */
198-(void)commandGetHS2SMemoryDataWithUserID:(NSData*)userID memoryData:(DisposeHS2SMemoryDataBlock)memoryData DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
199
200/**
201 * Delete HS2S Memory data
202 * Import parameter:
203 * @param userID :NSData type,The user ID must be 16 bytes or the user creation fails,
204 * Return parameters:
205 * @param result YES:Success NO:Failed
206 * @param disposeErrorBlock - error code
207 * Error code definition:
208 * refer to “error” : HS2S error instruction.
209 */
210-(void)commandDeleteHS2SMemoryDataWithUserID:(NSData*)userID result:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
211
212/**
213 * Get HS2S Anonymous Memory data count
214 * Return parameters:
215 * @param count memory count
216 * @param disposeErrorBlock - error code
217 * Error code definition:
218 * refer to “error” : HS2S error instruction.
219 */
220-(void)commandGetHS2SAnonymousMemoryDataCount:(DisposeHS2SAnonymousMemoryCountBlock)count DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
221
222/**
223 * Get HS2S Anonymous Memory data
224 * Return parameters:
225 * @param memoryData NSArray type,Each result dictionary contains: HS2SIsRightTS(Time correctness identification,0:Incorrect, unsynchronized time on measured data 1:Correct, synchronize the measured data after the time),HS2SMeasureTS(Measure Time,NSdate type),HS2SWeigthResult(Weigth Result)
226 * Example:
227 * (
228 {
229 HS2SIsRightTS = 0; //Time correctness identification
230 HS2SMeasureTS = "2019-05-18 07:18:36 +0000";
231 HS2SWeigthResult = "43.7";
232 }
233 * )
234 * @param disposeErrorBlock - error code
235 * Error code definition:
236 * refer to “error” : HS2S error instruction.
237 */
238-(void)commandGetHS2SAnonymousMemoryData:(DisposeHS2SAnonymousMemoryDataBlock)memoryData DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
239
240/**
241 * Delete HS2S Anonymous Memory data
242 * Return parameters:
243 * @param result YES:Success NO:Failed
244 * @param disposeErrorBlock - error code
245 * Error code definition:
246 * refer to “error” : HS2S error instruction.
247 */
248-(void)commandDeleteHS2SAnonymousMemoryData:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
249
250
251/**
252 * Measure HS2S Data
253 * Import parameter:
254 * @param user (user information must be entered in accordance with the reference range, otherwise it may be impossible to measure the accurate body fat information)
255
256 Lean mass calculation formula: result = weight * (1 - body fat percentage)
257 BMI calculation formula: result = weight / (height * height)
258 BMR calculation formula:
259 If no fat is measured
260 {
261 For men:
262 P = 13.397* weight + 4.799* height – 5.677* age + 88.362
263 For women:
264 P = 9.247* weight + 3.098* height – 4.330* age + 447.593
265 If the user enters the sport level in the app, correct the P:
266 Sport level=1, P = P*1.0
267 Sport level = 2, P = P*1.05
268 Sport level = 3, P = P*1.10
269 }
270 When fat is measured:
271 {
272 P=370 + 21.6*Lean mass(kg )
273 }
274 * contains:
275 * userType : 0 guest 1 normal
276 * hs2SUserID:NSData type,The user ID must be 16 bytes or the user creation fails,
277 * createTS:NSInteger type,The unit of time is seconds ,
278 * weight:NSNumber type,range:20-150kg,
279 * age:NSNumber type,range:18-99 years,
280 * height:NSNumber type,range:90-220cm
281 * sex:0 female 1 male,
282 * impedanceMark: 0 Don't measure 1 Measure
283 * fitnessMark:0 Don't fitness 1:fitness
284 * Return parameters:
285 * @param unStableWeight - Current weight, (Kg) [Value Range:0~180]
286 * @param stableWeight - Stable weight, (Kg) [Value Range:0~180]
287 * @param weightAndBodyInfo Weight and body fat information guest user not return weightAndBodyInfo
288 * Example:
289 * {
290 DeviceMac = 004D320CA04D; //device mac
291 HS2SBodyAge = 10; //body age
292 HS2SBodyWaterPercentAge = "39.3"; //body moisture rate
293 HS2SBoneMineral = "1.9"; //Bone salt
294 HS2SFatControl = 0; //Fat Control
295 HS2SFatWeight = 0; //Fat weight
296 HS2SFitness = 1; //0:Don't fitness 1:fitness
297 HS2SImpedance = (); //NSArray type ,Impedance
298 HS2SMeasureTS = "2019-05-18 08:56:38 +0000";
299 HS2SMuscle = "13.1"; //Muscle mass
300 HS2SMuscleControl = 0; //Muscle Control
301 HS2SProteinPercentAge = "9.8"; //Protein rate
302 HS2SResultBodyFatPercentAge = "44.2"; //Body fat rate
303 HS2SBodyWeightFlag = 0; //0:Body fat was not measured 1:Measure body fat
304 HS2SSkeletalMuscle = 0; //Skeletal Muscle
305 HS2SStandardWeight = 0; //Standard Weight
306 HS2SVFR = 29; //Visceral fat grade
307 HS2SWeightControl = 0; //Weight Control
308 HS2SWeigthResult = "79.5";
309 "UserInfo_Age" = 18;
310 "UserInfo_Height" = 100;
311 "UserInfo_SEX" = 1;
312 * }
313 * @param measureFinish If HS2S is measuring weight, the call to the online measurement interface will fail at the beginning, and the call to the interface will succeed when the return measurement is completed.
314 * @param disposeErrorBlock - error code
315 * Error code definition:
316 * refer to “error” : HS2S error instruction.
317 */
318-(void)commandStartHS2SMeasureWithUser:(HealthUser*)user weight:(DisposeHS2SUnStableWeight)unStableWeight stableWeight:(DisposeHS2SStableWeight)stableWeight weightAndBodyInfo:(DisposeHS2SWeightAndBodyInfo)weightAndBodyInfo disposeHS2SMeasureFinish:(DisposeHS2SMeasureFinish)measureFinish DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
319
320
321/**
322 * Reset HS2S device
323 * Return parameters:
324 * @param result YES:Success NO:Failed
325 * @param disposeErrorBlock - error code
326 * Error code definition:
327 * refer to “error” : HS2S error instruction.
328 */
329-(void)commandResetHS2SDevice:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
330
331/**
332 * HS2S BroadCastType device
333 * Return parameters:
334 * @param result YES:Success NO:Failed
335 * @param disposeErrorBlock - error code
336 * Error code definition:
337 * refer to “error” : HS2S error instruction.
338 */
339-(void)commandBroadCastTypeHS2SDevice:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
340
341
342/**
343 Disconnect current device
344 */
345
346-(void)commandDisconnectDevice;
347
348/**
349 * HS2S Light up bluetooth
350 * Return parameters:
351 * @param result YES:Success NO:Failed
352 * @param disposeErrorBlock - error code
353 * Error code definition:
354 * refer to “error” : HS2S error instruction.
355 */
356-(void)commandSetHS2SDeviceLightUp:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
357
358
359
360
361/**
362 * HS2S Enter heart rate measurement mode
363 * Return parameters:
364 * @param result
365 * heartResultDic:{
366 HeartValue = 0;
367 ResultStatus = 1;(0: success,
368 1: failed 1, no real-time data received in 6s
369 2: Failure 2, the algorithm judges that the user is weighing down
370 3: Failure 3, calculation failed
371 4: Failure 4: 30s timeout)
372 }
373
374 * @param status ( 1: User on the scale
375 2: User referred below
376 3: The user's heartbeat signal is detected)
377 * @param disposeErrorBlock - error code
378 * Error code definition:
379 * refer to “error” : HS2S error instruction.
380 */
381-(void)commandEnterHS2SHeartRateMeasurementMode:(DisposeHS2SHeartResult)result measurementStatus:(DisposeHS2SMeasurementStatus)status DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
382
383/**
384 * HS2S Exit heart rate measurement mode
385 * Return parameters:
386 * @param result YES:Success NO:Failed
387 * @param disposeErrorBlock - error code
388 * Error code definition:
389 * refer to “error” : HS2S error instruction.
390 */
391-(void)commandExitHS2SHeartRateMeasurementMode:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
392
393
394@end
395
396
397
398
399NS_ASSUME_NONNULL_END