summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/module/BG5SProfileModule.js
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/module/BG5SProfileModule.js')
-rw-r--r--libs/ihealth-sdk/module/BG5SProfileModule.js401
1 files changed, 401 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/module/BG5SProfileModule.js b/libs/ihealth-sdk/module/BG5SProfileModule.js
new file mode 100644
index 0000000..9e09542
--- /dev/null
+++ b/libs/ihealth-sdk/module/BG5SProfileModule.js
@@ -0,0 +1,401 @@
1/**
2 * Created by gaoyuanlong on 16/11/16.
3 */
4'use strict';
5
6
7var { NativeModules } = require('react-native');
8
9var RCTModule = NativeModules.BG5SProfileModule
10
11/**
12 * @module BG5SProfileModule
13 */
14module.exports = {
15
16 /**
17 * The action value of event indicating the error of BG device.<br/>
18 */
19 ACTION_ERROR_BG: RCTModule.ACTION_ERROR_BG,
20
21 /**
22 * The action value of event indicating keep link success.<br/>
23 * The key and value will be as below:
24 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
25 * <tbody>
26 * <tr><td>Key</td><td>Value</td></tr>
27 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_KEEP_LINK BGProfileModule.ACTION_KEEP_LINK("action_keep_link")}</td></tr>
28 * </tbody>
29 * </table>
30 * <b>Example:</b><br/>
31 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_keep_link"}<br/>
32 */
33 ACTION_GET_STATUS_INFO: RCTModule.ACTION_GET_STATUS_INFO,
34
35 /**
36 * The action value of event indicating set time success.<br/>
37 * The key and value will be as below:
38 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
39 * <tbody>
40 * <tr><td>Key</td><td>Value</td></tr>
41 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_SET_TIME BGProfileModule.ACTION_SET_TIME("action_set_time")}</td></tr>
42 * </tbody>
43 * </table>
44 * <b>Example:</b><br/>
45 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_time"}<br/>
46 */
47 ACTION_SET_TIME: RCTModule.ACTION_SET_TIME,
48
49 /**
50 * The action value of event indicating set unit success.<br/>
51 * The key and value will be as below:
52 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
53 * <tbody>
54 * <tr><td>Key</td><td>Value</td></tr>
55 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_SET_UNIT BGProfileModule.ACTION_SET_UNIT("action_set_unit")}</td></tr>
56 * </tbody>
57 * </table>
58 * <b>Example:</b><br/>
59 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_unit"}<br/>
60 */
61 ACTION_SET_UNIT: RCTModule.ACTION_SET_UNIT,
62
63 /**
64 * The action value of event indicating the result of get battery command.<br/>
65 * The key and value will be as below:
66 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
67 * <tbody>
68 * <tr><td>Key</td><td>Value</td></tr>
69 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_BATTERY BGProfileModule.ACTION_GET_BATTERY("action_battery_bg")}</td></tr>
70 * <tr><td>{@link module:BGProfileModule.GET_BATTERY BGProfileModule.GET_BATTERY("battery")}</td><td>The battery value.</td></tr>
71 * </tbody>
72 * </table>
73 * <b>Example:</b><br/>
74 * {"mac":"8CDE52B5FAC2","battery":32,"type":"BG5","action":"action_battery_bg"}<br/>
75 */
76 ACTION_GET_BATTERY: RCTModule.ACTION_GET_BATTERY,
77
78 /**
79 * The action value of event indicating start measure success.<br/>
80 * The key and value will be as below:
81 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
82 * <tbody>
83 * <tr><td>Key</td><td>Value</td></tr>
84 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_START_MEASURE BGProfileModule.ACTION_START_MEASURE("action_start_measure")}</td></tr>
85 * </tbody>
86 * </table>
87 * <b>Example:</b><br/>
88 * {mac":"8CDE52B5FAC2","type":"BG5","action":"action_start_measure"}<br/>
89 */
90 ACTION_START_MEASURE: RCTModule.ACTION_START_MEASURE,
91
92 /**
93 * The action value of event indicating the offline data count.<br/>
94 * The key and value will be as below:
95 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
96 * <tbody>
97 * <tr><td>Key</td><td>Value</td></tr>
98 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_OFFLINEDATA_COUNT BGProfileModule.ACTION_GET_OFFLINEDATA_COUNT("action_historicalnum_bg")}</td></tr>
99 * <tr><td>{@link module:BGProfileModule.GET_OFFLINEDATA_COUNT BGProfileModule.GET_OFFLINEDATA_COUNT("count")}</td><td>The offline data count value.</td></tr>
100 * </tbody>
101 * </table>
102 * <b>Example:</b><br/>
103 * {"count":2,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_historicalnum_bg"}
104 * <br/>
105 */
106 ACTION_GET_OFFLINEDATA_COUNT: RCTModule.ACTION_GET_OFFLINEDATA_COUNT,
107
108 /**
109 * The action value of event indicating the result of offline data.<br/>
110 * The key and value will be as below:
111 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
112 * <tbody>
113 * <tr><td>Key</td><td>Value</td></tr>
114 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_OFFLINEDATA BGProfileModule.ACTION_GET_OFFLINEDATA("action_historicaldata_bg")}</td></tr>
115 * <tr><td>{@link module:BGProfileModule.GET_OFFLINEDATA BGProfileModule.GET_OFFLINEDATA("his_data_bg")}</td><td>Get offline data command result</td></tr>
116 * </tbody>
117 * </table>
118 * <b>Example:</b><br/>
119 * {<br/>
120 * {"his_data_bg":{"history":[{"dataID":"1B92511DE36F54508415257160F9D0EA","value":39,"date":"2017-06-08 15:08:00"},
121 * {"dataID":"862D10B79A8560505720B983D658E095","timeProofing":0,"value":38,"date":"2017-06-08 15:09:01"}]},
122 * "mac":"8CDE52B5FAC2","type":"BG5","action":"action_historicaldata_bg"}
123 * <br/>
124 */
125 ACTION_GET_OFFLINEDATA: RCTModule.ACTION_GET_OFFLINEDATA,
126
127 /**
128 * The action value of event indicating delete offline data success.<br/>
129 * The key and value will be as below:
130 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
131 * <tbody>
132 * <tr><td>Key</td><td>Value</td></tr>
133 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_DELETE_OFFLINEDATA BGProfileModule.ACTION_DELETE_OFFLINEDATA("action_delete_historical_data")}</td></tr>
134 * </tbody>
135 * </table>
136 * <b>Example:</b><br/>
137 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_delete_historical_data"}
138 * <br/>
139 */
140 ACTION_DELETE_OFFLINEDATA: RCTModule.ACTION_DELETE_OFFLINEDATA,
141
142 /**
143 * The action value of event indicating the result of set bottle message command.<br/>
144 * The key and value will be as below:
145 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
146 * <tbody>
147 * <tr><td>Key</td><td>Value</td></tr>
148 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_SET_BOTTLEMESSAGE BGProfileModule.ACTION_SET_BOTTLEMESSAGE("action_set_bottle_message_success")}</td></tr>
149 * <tr><td>{@link module:BGProfileModule.SET_BOTTLEMESSAGE BGProfileModule.SET_BOTTLEMESSAGE("set_bottle_message")}</td><td>Set bottle message command result</td></tr>
150 * <tr><td>{@link module:BGProfileModule.START_MODE BGProfileModule.START_MODE("start_mode")}</td><td>The start mode of Bg5 device.</td></tr>
151 * </tbody>
152 * </table>
153 * <b>Example:</b><br/>
154 * {"start_mode":2,"set_bottle_message":true,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_bottle_message_success"}
155 * <br/>
156 */
157 ACTION_SET_BOTTLEMESSAGE: RCTModule.ACTION_SET_BOTTLEMESSAGE,
158
159 /**
160 * The action value of event indicating the result of get bottle message command.<br/>
161 * The key and value will be as below:
162 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
163 * <tbody>
164 * <tr><td>Key</td><td>Value</td></tr>
165 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_BOTTLEMESSAGE BGProfileModule.ACTION_GET_BOTTLEMESSAGE("action_get_codeinfo")}</td></tr>
166 * <tr><td>{@link module:BGProfileModule.GET_EXPIRECTIME BGProfileModule.GET_EXPIRECTIME("expiretime")}</td><td>The strip expire time of Bg5 device.</td></tr>
167 * <tr><td>{@link module:BGProfileModule.GET_USENUM BGProfileModule.GET_USENUM("usenum")}</td><td>The strip used num, from offline data by Bg5 device.</td></tr>
168 * </tbody>
169 * </table>
170 * <b>Example:</b><br/>
171 * {"expiretime":"2099-12-16","usenum":0,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_get_codeinfo"}
172 * <br/>
173 */
174 ACTION_GET_BOTTLEMESSAGE: RCTModule.ACTION_GET_BOTTLEMESSAGE,
175
176 /**
177 * The action value of event indicating set bottleID success.<br/>
178 * The key and value will be as below:
179 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
180 * <tbody>
181 * <tr><td>Key</td><td>Value</td></tr>
182 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_SET_BOTTLEID BGProfileModule.ACTION_SET_BOTTLEID("action_setbottleid_success")}</td></tr>
183 * </tbody>
184 * </table>
185 * <b>Example:</b><br/>
186 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_setbottleid_success"}
187 * <br/>
188 */
189 ACTION_SET_BOTTLEID: RCTModule.ACTION_SET_BOTTLEID,
190
191 /**
192 * The action value of event indicating the result of get bottleID command.<br/>
193 * The key and value will be as below:
194 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
195 * <tbody>
196 * <tr><td>Key</td><td>Value</td></tr>
197 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_BOTTLEID BGProfileModule.ACTION_GET_BOTTLEID("action_get_bottleid")}</td></tr>
198 * <tr><td>{@link module:BGProfileModule.GET_BOTTLEID BGProfileModule.GET_BOTTLEID("bottleid")}</td><td>The bottleId of Bg5 device.</td></tr>
199 * </tbody>
200 * </table>
201 * <b>Example:</b><br/>
202 * {"bottleid":926305,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_get_bottleid"}
203 * <br/>
204 */
205 ACTION_GET_BOTTLEID: RCTModule.ACTION_GET_BOTTLEID,
206
207
208 /**
209 * The action value of event indicating the result of strip was put in the devices.<br/>
210 * The key and value will be as below:
211 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
212 * <tbody>
213 * <tr><td>Key</td><td>Value</td></tr>
214 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_STRIP_IN BGProfileModule.ACTION_STRIP_IN("action_measure_strip_in")}</td></tr>
215 * </tbody>
216 * </table>
217 * <b>Example:</b><br/>
218 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_strip_in"}<br/>
219 */
220 ACTION_STRIP_IN: RCTModule.ACTION_STRIP_IN,
221
222 /**
223 * The action value of event indicating the result of strip out of the devices.<br/>
224 * The key and value will be as below:
225 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
226 * <tbody>
227 * <tr><td>Key</td><td>Value</td></tr>
228 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_STRIP_OUT BGProfileModule.ACTION_STRIP_OUT("action_measure_strip_out")}</td></tr>
229 * </tbody>
230 * </table>
231 * <b>Example:</b><br/>
232 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_strip_out"}
233 * <br/>
234 */
235 ACTION_STRIP_OUT: RCTModule.ACTION_STRIP_OUT,
236
237 /**
238 * The action value of event indicating the result of get the blood.<br/>
239 * The key and value will be as below:
240 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
241 * <tbody>
242 * <tr><td>Key</td><td>Value</td></tr>
243 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_BLOOD BGProfileModule.ACTION_GET_BLOOD("action_measure_get_blood")}</td></tr>
244 * </tbody>
245 * </table>
246 * <b>Example:</b><br/>
247 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_get_blood"}
248 * <br/>
249 */
250 ACTION_GET_BLOOD: RCTModule.ACTION_GET_BLOOD,
251
252 /**
253 * The action value of event indicating the result of get measure value from devices.<br/>
254 * The key and value will be as below:
255 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
256 * <tbody>
257 * <tr><td>Key</td><td>Value</td></tr>
258 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_ONLINE_RESULT_BG BGProfileModule.ACTION_ONLINE_RESULT_BG("action_value_bg")}</td></tr>
259 * <tr><td>{@link module:BGProfileModule.ONLINE_RESULT_BG BGProfileModule.ONLINE_RESULT_BG("result")}</td><td>The bg value measured by device</td></tr>
260 * <tr><td>{@link module:BGProfileModule.DATA_ID BGProfileModule.DATA_ID("dataID")}</td><td>The dataID measured by device</td></tr>
261 * </tbody>
262 * </table>
263 * <b>Example:</b><br/>
264 * {"dataID":"E0A831AE7D2220A6417D4E050EA3FCA1","result":141,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_value_bg"}
265 * <br/>
266 */
267 ACTION_ONLINE_RESULT_BG: RCTModule.ACTION_ONLINE_RESULT_BG,
268
269 /**
270 * The error num means different error.
271 * <p>0:Battery is low.</p>
272 * <p>1:Glucose test result is out of the measurement range.</p>
273 * <p>2:Unknown interference detected, please repeat the test.</p>
274 * <p>3:Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip..</p>
275 * <p>4:Reading transmission error. Repeat the test with a new test strip. If the problem persists, contact iHealth customer service for assistance.</p>
276 * <p>5:The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.</p>
277 * <p>6:The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.</p>
278 * <p>7:Test strip coding error.</p>
279 * <p>8:Communication error, press"START" or rescan the code to repeat the test.</p>
280 * <p>9:Strip removed in the middle of reading, repeat the test with a new strip.</p>
281 * <p>10:Insert a new test strip and repeat the test.</p>
282 * <p>11:Cannot write to SN or KEY.</p>
283 * <p>12:Please set time.</p>
284 * <p>13:0 test strips remaining.</p>
285 * <p>14:Test strip expired.</p>
286 * <p>15:Unplug the charging cable before testing.</p>
287 * <p>18:Unplug the charging cable before read the history data</>
288 * <p>19:Charging line is inserted</>
289 * <p>20:Charging line pull out</>
290 * <p>21:The bluetooth module failure</>
291 * <p>100:The device is disconnected (Android doesn't support this code)</>
292 * <p>112:Device don't support to query energy.</p>
293 * <p>400:Parameters out of range.</p>
294 * <p>402:The order of call is wrong.</p>
295 * <p>403:Parameter type is not matched in function call.</p>
296 * <p>404:Function(disConnect) is not supported in iOS platform.(Only available in iOS platform)</p>
297 * <p>405:QRCode format error</p>
298 */
299 ERROR_NUM_BG: RCTModule.ERROR_NUM_BG,
300
301 /**
302 * The error discription.
303 */
304 ERROR_DESCRIPTION_BG: RCTModule.ERROR_DESCRIPTION_BG,
305
306 /**
307 * The battery value.
308 */
309 GET_BATTERY: RCTModule.GET_BATTERY,
310
311 /**
312 * The offline data count value.
313 */
314 GET_OFFLINEDATA_COUNT: RCTModule.GET_OFFLINEDATA_COUNT,
315
316 /**
317 * Get offline data value.
318 */
319 GET_OFFLINEDATA: RCTModule.GET_OFFLINEDATA,
320
321 /**
322 * Set bottle message result value.
323 */
324 SET_BOTTLEMESSAGE: RCTModule.SET_BOTTLEMESSAGE,
325
326 /**
327 * the start mode of Bg5 device.
328 * <li>
329 * value=1, start by insert strip, no need to call <BG5Module.startMeasure>
330 * </li>
331 * <li>
332 * value=2, start by tap the button, need to call <BG5Module.startMeasure>
333 * </li>
334 * </ul>
335 */
336 START_MODE: RCTModule.START_MODE,
337
338 /**
339 * The strip expire time of Bg5 device.
340 */
341 GET_EXPIRECTIME: RCTModule.GET_EXPIRECTIME,
342
343 /**
344 * The strip used num, from offline data by Bg5 device.
345 */
346 GET_USENUM: RCTModule.GET_USENUM,
347
348
349 /**
350 * The bottleId of Bg5 device.
351 */
352 GET_BOTTLEID: RCTModule.GET_BOTTLEID,
353
354 /**
355 * The bg value measured by device
356 */
357 ONLINE_RESULT_BG: RCTModule.ONLINE_RESULT_BG,
358
359 /**
360 * The dataID measured by device
361 */
362 DATA_ID: RCTModule.DATA_ID,
363
364 /**
365 * Callback indicating the code analysis result.
366 * The key and value will be as below:
367 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
368 * <tbody>
369 * <tr><td>Key</td><td>Value</td></tr>
370 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_CODE_ANALYSIS BGProfileModule.ACTION_CODE_ANALYSIS("action_code_analysis")}</td></tr>
371 * <tr><td>{@link module:BGProfileModule.STRIP_NUM_BG BGProfileModule.STRIP_NUM_BG("strip_num")}</td><td>The strip number of the QRCode</td></tr>
372 * <tr><td>{@link module:BGProfileModule.STRIP_EXPIRETIME_BG BGProfileModule.STRIP_EXPIRETIME_BG("expire_time")}</td><td>The expire time of the QRCode</td></tr>
373 * <tr><td>{@link module:BGProfileModule.BOTTLEID_BG BGProfileModule.BOTTLEID_BG("bottle_id")}</td><td>The bottle id of the QRCode</td></tr>
374 * </tbody>
375 * </table>
376 * <b>Example:</b><br/>
377 * {"bottle_id":"926305","expire_time":"2017-03-01","strip_num":"25","action":"action_code_analysis"}
378 * <br/>
379 */
380 ACTION_CODE_ANALYSIS:RCTModule.ACTION_CODE_ANALYSIS,
381
382 /**
383 * the strip number
384 */
385 STRIP_NUM_BG:RCTModule.STRIP_NUM_BG,
386
387 /**
388 * the expire time
389 */
390 STRIP_EXPIRETIME_BG:RCTModule.STRIP_EXPIRETIME_BG,
391
392 /**
393 * the bottle id
394 */
395 BOTTLEID_BG:RCTModule.BOTTLEID_BG,
396
397 /**
398 * Indicates get all connected devices.
399 */
400 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
401}