summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h')
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h294
1 files changed, 294 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h
new file mode 100644
index 0000000..08cca13
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h
@@ -0,0 +1,294 @@
1//
2// BG5S.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/6/30.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BGMacroFile.h"
11
12// --------------- DELEGATE ---------------
13@class BG5S;
14
15/**
16 BG5SDelegate
17 */
18@protocol BG5SDelegate <NSObject>
19@required
20
21/**
22 Device sends an error
23
24 @param device active device
25 @param error error number
26 @param errorDescription error message
27 */
28- (void)device:(BG5S *)device occurError:(BG5SError)error errorDescription:(NSString *)errorDescription;
29
30/**
31 Device sends strip state message
32 @note Only after startMeasure: method is called, does the device send strip state message.
33 If you insert strip before calling startMeasure: method, the device doesn't send strip state(Insert or Pull off) until startMeasure: method is called.
34 @param device active device
35 @param state BG5SStripState enum
36 */
37- (void)device:(BG5S *)device stripStateDidUpdate:(BG5SStripState)state;
38
39/**
40 Device sends drop blood or ctl message
41 @note After reciving this message, you should not call any method until you recive result. If called, the method may be timeout.
42 @param device active device
43 */
44- (void)deviceDropBlood:(BG5S *)device;
45
46/**
47 Device sends result
48
49 @param device active device
50 @param dataID data identifier (Only for SDK users)
51 @param result blood glucose value with mg/dL unit
52 */
53- (void)device:(BG5S *)device dataID:(NSString *)dataID measureReult:(NSInteger)result;
54
55/**
56 Device sends charging state
57 @note Only state changes, is the message sent.
58 @param device active device
59 @param state BG5SChargeState object
60 */
61- (void)device:(BG5S *)device chargeStateDidUpdate:(BG5SChargeState)state;
62@end
63
64/**
65 state information of BG5S when call "queryStateInfoWithSuccess:"
66 */
67@interface BG5SStateInfo : NSObject
68
69/**
70 0-100 means battery percent, 255 means charging
71 */
72@property (assign, nonatomic, readonly) NSInteger batteryValue;
73
74/**
75 device date (UTC)
76 */
77@property (copy, nonatomic, readonly) NSDate *deviceDate;
78
79/**
80 device timezon -12.00 to 14.00. Without setting, default timezone is 0.00
81 */
82@property (assign, nonatomic, readonly) float deviceTimeZone;
83
84/**
85 quantity of strip used in measurement.range:[0,65535]. If value is 65535, there may be something wrong with BG5S. Because 65535 is very large number for true user.
86 */
87@property (assign, nonatomic, readonly) NSInteger stripUsedValue;
88
89/**
90 quantity of record measuring without connecting to APP.range:[0,500]. If value is 65535, there may be something wrong with BG5S.
91 */
92@property (assign, nonatomic, readonly) NSInteger offlineDataQuantity;
93
94/**
95 blood code version (0-255)
96 */
97@property (assign, nonatomic, readonly) NSInteger bloodCodeVersion;
98
99/**
100 ctl code version (0-255)
101 */
102@property (assign, nonatomic, readonly) NSInteger ctlCodeVersion;
103
104/**
105 measure unit (BGUnit_Unknown means that BG5S has never been set unit from App,BGUnit_mmolPL stands for mmol/L,BGUnit_mgPmL stands for mg/dL)
106 */
107@property (assign, nonatomic, readonly) BGUnit unit;
108
109@end
110
111/**
112 Offline data model of BG5S
113 */
114@interface BG5SRecordModel : NSObject
115
116/**
117 Data ID (Only for SDK users)
118 */
119@property (copy, nonatomic, readonly) NSString *dataID;
120
121/**
122 Measure Date (UTC)
123 */
124@property (copy, nonatomic, readonly) NSDate *measureDate;
125
126/**
127 Time zone
128 */
129@property (assign, nonatomic, readonly) float timeZone;
130
131/**
132 BG Value with mg/dL unit
133 */
134@property (assign, nonatomic, readonly) NSInteger value;
135
136/**
137 Correct Flag, YES:can be corrected, NO:cannot be corrected
138 */
139@property (assign, nonatomic, readonly) BOOL canCorrect;
140
141@end
142
143/**
144 Modified offline data model of BG5S
145 */
146@interface BG5SRecordModifiedModel : NSObject
147
148/**
149 Data ID (Only for SDK users)
150 */
151@property (copy, nonatomic) NSString *dataID;
152
153/**
154 Measure Date (UTC)
155 */
156@property (copy, nonatomic) NSDate *measureDate;
157
158/**
159 Time zone
160 */
161@property (assign, nonatomic,) float timeZone;
162
163/**
164 BG Value with mg/dL unit
165 */
166@property (assign, nonatomic) NSInteger value;
167
168@end
169
170/**
171 BG5S
172 */
173@interface BG5S : BGDevice
174
175@property (weak, nonatomic) id<BG5SDelegate> delegate;
176
177/**
178 Query BG5S state information including battery value,device date, device timezone, strip used, quantity of offline data, blood code version, CTL code version, unit.
179
180 @param stateInfoBlock BG5SStateInfo object
181 @param errorBlock the block means fail. You can get error from this block
182 @note If analysis occurs error, BG5SStateInfo object maybe nil or some of its property are nil.
183 */
184- (void)queryStateInfoWithSuccess:(BG5SStateInfoBlock)stateInfoBlock
185 errorBlock:(BG5SSDKErrorBlock)errorBlock;
186
187/**
188 Set time
189
190 @param date the date you want to set should be an UTC time. valid range:Jan. 1,2000 - Dec. 31,2099. If date is nil, use [NSdate date] and system time zone
191 @param timezone the timezone you want to set should be from -12.00 to 14.00; step length = 0.25
192 @param successBlock the block means success
193 @param errorBlock the block means fail. You can get error from this block
194 @note If date is out of reange, BG5SError_InputParametersError will be returned by block.
195 If date and timezone are invalid , use input parameters; otherwise use [NSdate date] and system time zone;
196 */
197- (void)setTimeWithDate:(NSDate *)date
198 timezone:(float)timezone
199 successBlock:(BG5SSuccessBlock)successBlock
200 errorBlock:(BG5SSDKErrorBlock)errorBlock;
201
202/**
203 Set unit
204
205 @param unit the unit you want to set (BGUnit_mmolPL stands for mmol/L,BGUnit_mgPmL stands for mg/dL)
206 @param successBlock the block means success
207 @param errorBlock the block means fail. You can get error from this block
208 */
209- (void)setUnit:(BGUnit)unit
210 successBlock:(BG5SSuccessBlock)successBlock
211 errorBlock:(BG5SSDKErrorBlock)errorBlock;
212
213/**
214 Delete strip used info (the quantity of strip used is set to 0)
215
216 @param successBlock the block means success
217 @param errorBlock the block means fail. You can get error from this block
218 */
219- (void)deleteStripUsedInfoWithSuccessBlock:(BG5SSuccessBlock)successBlock
220 errorBlock:(BG5SSDKErrorBlock)errorBlock;
221
222/**
223 Query record data stored in BG5S
224
225 @param successBlock the block means success; if has record, return non-empty array (BG5SRecordModel object); if no record, return empty array
226 @param errorBlock the block means fail. You can get error from this block
227 */
228- (void)queryRecordWithSuccessBlock:(BG5SRecordBlock)successBlock
229 errorBlock:(BG5SSDKErrorBlock)errorBlock;
230
231
232/**
233 Delete record data stored in BG5S
234
235 @param successBlock the block means success
236 @param errorBlock the block means fail. You can get error from this block
237 */
238- (void)deleteRecordWithSuccessBlock:(BG5SSuccessBlock)successBlock
239 errorBlock:(BG5SSDKErrorBlock)errorBlock;
240
241/**
242 Start online measurement with specific measure mode.
243
244 @note If you don't call this method, BG5S use blood mode by default.
245
246 If CTL mode is sent, BG5S use CTL mode and BG5S can't be set to use blood mode until next connection.
247 @param measureMode Blood or CTL
248 @param successBlock the block means success
249 @param errorBlock the block means fail. You can get error from this block
250 */
251- (void)startMeasure:(BGMeasureMode)measureMode
252 withSuccessBlock:(BG5SSuccessBlock)successBlock
253 errorBlock:(BG5SSDKErrorBlock)errorBlock;
254
255/**
256 Disconnect device
257 */
258- (void)disconnectDevice;
259
260/**
261 Correct Measure Date if canCorrect is YES in BG5SRecordModel
262
263 @param array BG5SRecordModel objects
264 @param deviceDate This date should be read before set time method called.
265 @return BG5SRecordModifiedModel objects; return empty array means input parameters is wrong.
266 */
267- (NSArray *)processData:(NSArray<BG5SRecordModel*> *)array deviceDate:(NSDate *)deviceDate;
268
269
270/**
271
272 Is offline measurement allowed
273
274 @param isOffline Is offline measurement allowed 0:allowed 1:Offline measurement is not allowed
275 @param successBlock the block means success
276 @param errorBlock the block means fail. You can get error from this block
277 */
278- (void)setIsOfflineMeasurementAllowed:(BOOL)isOffline
279successBlock:(BG5SSuccessBlock)successBlock
280 errorBlock:(BG5SSDKErrorBlock)errorBlock;
281
282
283- (void)setCodeWithMeasureMode:(BGMeasureMode)mode
284 resultBlock:(BG5SSetCodeResultBlock)resultBlock
285 errorBlock:(BG5SSDKErrorBlock)errorBlock;
286
287- (void)readDeviceInfoWithSuccessBlock:(BG5SDeviceInfoBlock)deviceInfoBlock
288 errorBlock:(BG5SSDKErrorBlock)errorBlock;
289
290- (void)commandCloseDeviceBLEWithSuccessBlock:(BG5SSuccessBlock)successBlock errorBlock:(BG5SSDKErrorBlock)errorBlock;
291
292- (void)commandSetDeviceDisplay:(BOOL)isDisplay successBlock:(BG5SSuccessBlock)successBlock errorBlock:(BG5SSDKErrorBlock)errorBlock;
293
294@end