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