summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/module
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/module')
-rwxr-xr-xlibs/ihealth-sdk/module/AM3SModule.js274
-rwxr-xr-xlibs/ihealth-sdk/module/AM4Module.js321
-rwxr-xr-xlibs/ihealth-sdk/module/AM5Module.js150
-rwxr-xr-xlibs/ihealth-sdk/module/AM5ProfileModule.js68
-rwxr-xr-xlibs/ihealth-sdk/module/AMProfileModule.js463
-rwxr-xr-xlibs/ihealth-sdk/module/BG1Module.js40
-rwxr-xr-xlibs/ihealth-sdk/module/BG1ProfileModule.js90
-rw-r--r--libs/ihealth-sdk/module/BG1SModule.js48
-rw-r--r--libs/ihealth-sdk/module/BG1SProfileModule.js30
-rwxr-xr-xlibs/ihealth-sdk/module/BG5Module.js184
-rw-r--r--libs/ihealth-sdk/module/BG5SModule.js145
-rw-r--r--libs/ihealth-sdk/module/BG5SProfileModule.js401
-rwxr-xr-xlibs/ihealth-sdk/module/BGProfileModule.js413
-rwxr-xr-xlibs/ihealth-sdk/module/BP3LModule.js75
-rwxr-xr-xlibs/ihealth-sdk/module/BP550BTModule.js90
-rwxr-xr-xlibs/ihealth-sdk/module/BP5Module.js125
-rwxr-xr-xlibs/ihealth-sdk/module/BP5SModule.js139
-rwxr-xr-xlibs/ihealth-sdk/module/BP7Module.js149
-rwxr-xr-xlibs/ihealth-sdk/module/BP7SModule.js121
-rwxr-xr-xlibs/ihealth-sdk/module/BPProfileModule.js69
-rwxr-xr-xlibs/ihealth-sdk/module/BTMModule.js88
-rwxr-xr-xlibs/ihealth-sdk/module/BTMProfileModule.js33
-rwxr-xr-xlibs/ihealth-sdk/module/ECGModule.js60
-rwxr-xr-xlibs/ihealth-sdk/module/ECGProfileModule.js208
-rwxr-xr-xlibs/ihealth-sdk/module/ECGUSBModule.js119
-rwxr-xr-xlibs/ihealth-sdk/module/HS2Module.js63
-rwxr-xr-xlibs/ihealth-sdk/module/HS2SModule.js110
-rw-r--r--libs/ihealth-sdk/module/HS2SProfileModule.js103
-rwxr-xr-xlibs/ihealth-sdk/module/HS4SModule.js53
-rwxr-xr-xlibs/ihealth-sdk/module/HS6Module.js94
-rwxr-xr-xlibs/ihealth-sdk/module/HS6ProfileModule.js50
-rwxr-xr-xlibs/ihealth-sdk/module/HSProfileModule.js42
-rw-r--r--libs/ihealth-sdk/module/NT13BModule.js39
-rw-r--r--libs/ihealth-sdk/module/NT13BProfileModule.js20
-rw-r--r--libs/ihealth-sdk/module/PO1Module.js38
-rw-r--r--libs/ihealth-sdk/module/PO1ProfileModule.js33
-rwxr-xr-xlibs/ihealth-sdk/module/PO3Module.js58
-rwxr-xr-xlibs/ihealth-sdk/module/POProfileModule.js34
-rw-r--r--libs/ihealth-sdk/module/PT3SBTModule.js87
-rw-r--r--libs/ihealth-sdk/module/PT3SBTProfileModule.js31
-rw-r--r--libs/ihealth-sdk/module/TS28BModule.js39
-rw-r--r--libs/ihealth-sdk/module/TS28BProfileModule.js20
-rw-r--r--libs/ihealth-sdk/module/iHealthDeviceManagerModule.js277
43 files changed, 5094 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/module/AM3SModule.js b/libs/ihealth-sdk/module/AM3SModule.js
new file mode 100755
index 0000000..47b37df
--- /dev/null
+++ b/libs/ihealth-sdk/module/AM3SModule.js
@@ -0,0 +1,274 @@
1/**
2 * Created by Jeepend on 22/11/2016.
3 */
4'use strict';
5
6
7var {
8 NativeModules,
9 DeviceEventEmitter
10} = require('react-native');
11
12var AMProfileModule = require('./AMProfileModule.js');
13
14var RCTModule = NativeModules.AM3SModule
15/**
16 * @module AM3SModule
17 */
18module.exports = {
19
20 Event_Notify: RCTModule.Event_Notify,
21
22 /**
23 * AM3S IDPS information
24 *
25 * @argument mac
26 */
27 getIdps: function (mac) {
28 RCTModule.getIdps(mac)
29 },
30
31 /**
32 * Reset AM3S device.
33 * @param {string} mac Device's mac address
34 */
35 reset: function (mac) {
36 RCTModule.reset(mac)
37 },
38
39 /**
40 * Get user's ID
41 * @param {string} mac Device's mac address
42 */
43 getUserId: function (mac) {
44 RCTModule.getUserId(mac)
45 },
46
47 /**
48 * Get alarms' count
49 * @param {string} mac Device's mac address
50 */
51 getAlarmClockNum: function (mac) {
52 RCTModule.getAlarmClockNum(mac)
53 },
54
55 /**
56 * Get alarm information by id
57 * @param {string} mac Device's mac address
58 * @param {array} alarmIDArray Alarm id array to be query.
59 */
60 getAlarmClockDetail: function (mac, alarmIDArray) {
61 RCTModule.getAlarmClockDetail(mac, alarmIDArray)
62 },
63
64 /**
65 * Set/Unset alarm
66 * @param {string} mac Device's mac address
67 * @param {number} id Alarm id
68 * @param {number} hour Alarm hour part [0, 23]
69 * @param {number} min Alarm minute part [0, 59]
70 * @param {boolean} isRepeat Indicates whether it will repeat:
71 * @param {array} weekArray The days in a week to repeat the alarm, week[0~6] indicates Sun~Sat.
72 * {0, 1, 1, 1, 1, 1, 0} means the alarm will repeat on Mon, Tue, Wed, Thu, Fri.
73 * @param {boolean} isOn true if want to set the alarm, false to unset it.
74 */
75 setAlarmClock: function (mac, id, hour, min, isRepeat, weekArray, isOn) {
76 RCTModule.setAlarmClock(mac, id, hour, min, isRepeat, weekArray, isOn)
77 },
78
79 /**
80 * Delete alarm by id
81 * @param {string} mac Device's mac address
82 * @param {number} id Alarm id(should be 1, 2 or 3)
83 */
84 deleteAlarmClock: function (mac, id) {
85 RCTModule.deleteAlarmClock(mac, id)
86 },
87
88 /**
89 * Get activity remind setting.
90 * @param {string} mac Device's mac address
91 */
92 getActivityRemind: function (mac) {
93 RCTModule.getActivityRemind(mac)
94 },
95
96 /**
97 * Set/Unset activity remind
98 * @param {string} mac Device's mac address
99 * @param {number} hour Activity remind hour part [0, 23]
100 * @param {number} min Activity remind minute part [0, 59]
101 * @param {boolean} isOn true if want to set activity remind, false to unset it.
102 */
103 setActivityRemind: function (mac, hour, min, isOn) {
104 RCTModule.setActivityRemind(mac, hour, min, isOn)
105 },
106
107 /**
108 * Get device state and battery information
109 * @param {string} mac Device's mac address
110 */
111 queryAMState: function (mac) {
112 RCTModule.queryAMState(mac)
113 },
114
115 /**
116 * Set user ID
117 * @param {string} mac Device's mac address
118 * @param {number} id new user id <br/>
119 * <b>Range:</b> [1, 2147483647(0x7FFFFFFF)]
120 */
121 setUserId: function (mac, id) {
122 if (id < 1 || id > 0x7FFFFFFF) {
123 let result = {
124 "mac": mac,
125 "type": "AM3S",
126 "action": AMProfileModule.ACTION_ERROR_AM,
127 }
128 result[AMProfileModule.ERROR_NUM_AM] = AMProfileModule.ERROR_ID_ILLEGAL_ARGUMENT
129 result[AMProfileModule.ERROR_DESCRIPTION_AM] = 'setUserId() parameter id should be in the range [1, 2147483647(0x7FFFFFFF)]'
130 DeviceEventEmitter.emit(RCTModule.Event_Notify, result)
131 return
132 }
133 RCTModule.setUserId(mac, id)
134 },
135
136 /**
137 * Get user information
138 * @param {string} mac Device's mac address
139 */
140 getUserInfo: function (mac) {
141 RCTModule.getUserInfo(mac)
142 },
143
144 /**
145 * Set user's BMR
146 * @param {string} mac Device's mac address
147 * @param {number} bmr User's BMR [1, 32767(0x7FFF)]
148 */
149 setUserBmr: function (mac, bmr) {
150 RCTModule.setUserBmr(mac, bmr)
151 },
152
153 /**
154 * Get the activity data.
155 * @param {string} mac Device's mac address
156 */
157 syncActivityData: function (mac) {
158 RCTModule.syncActivityData(mac)
159 },
160
161 /**
162 * Get the sleep data.
163 * @param {string} mac Device's mac address
164 */
165 syncSleepData: function (mac) {
166 RCTModule.syncSleepData(mac)
167 },
168
169 /**
170 * Get current time activity data
171 * @param {string} mac Device's mac address
172 */
173 syncRealData: function (mac) {
174 RCTModule.syncRealData(mac)
175 },
176
177 /**
178 * Set the system time to AM device.
179 * @param {string} mac Device's mac address
180 */
181 syncRealTime: function (mac) {
182 RCTModule.syncRealTime(mac)
183 },
184
185 /**
186 * Set hour mode
187 * @param {string} mac Device's mac address
188 * @param {number} hourMode The value should be one of following:
189 * <ul>
190 * <li>{@link module:AMProfileModule.AM_SET_12_HOUR_MODE AMProfileModule.AM_SET_12_HOUR_MODE(0)}</li>
191 * <li>{@link module:AMProfileModule.AM_SET_24_HOUR_MODE AMProfileModule.AM_SET_24_HOUR_MODE(1)}</li>
192 * <li>{@link module:AMProfileModule.AM_SET_EXCEPT_EUROPE_12_HOUR_MODE AMProfileModule.AM_SET_EXCEPT_EUROPE_12_HOUR_MODE(2)}</li>
193 * <li>{@link module:AMProfileModule.AM_SET_EUROPE_12_HOUR_MODE AMProfileModule.AM_SET_EUROPE_12_HOUR_MODE(3)}</li>
194 * <li>{@link module:AMProfileModule.AM_SET_EXCEPT_EUROPE_24_HOUR_MODE AMProfileModule.AM_SET_EXCEPT_EUROPE_24_HOUR_MODE(4)}</li>
195 * <li>{@link module:AMProfileModule.AM_SET_EUROPE_24_HOUR_MODE AMProfileModule.AM_SET_EUROPE_24_HOUR_MODE(5)}</li>
196 * </ul>
197 */
198 setHourMode: function (mac, hourMode) {
199 RCTModule.setHourMode(mac, hourMode)
200 },
201
202 /**
203 * Get hour mode
204 * @param {string} mac Device's mac address
205 */
206 getHourMode: function (mac) {
207 RCTModule.getHourMode(mac)
208 },
209
210 /**
211 * Disconnect device
212 * @param {string} mac Device's mac address
213 */
214 disconnect: function (mac) {
215 RCTModule.disconnect(mac)
216 },
217
218 /**
219 * Set user information
220 * @param {string} mac Device's mac address
221 * @param {number} age User's age [1, 255]
222 * @param {number} height User's height(int in cm) [1, 255]
223 * @param {number} weight User's weight(float) [1.0, 255.0]
224 * @param {number} gender User's gender
225 * @param {number} unit Distance's unit type(kilometre or miles)
226 * @param {number} target The goal of maximum steps [4, 65535(0xFFFF)]
227 * @param {number} activityLevel The level of activity strength
228 */
229 setUserInfo: function (mac, age, height, weight, gender, unit, target, activityLevel) {
230 RCTModule.setUserInfo(mac, age, height, weight, gender, unit, target, activityLevel)
231 },
232
233 /**
234 * Get stage report data
235 * @param {string} mac Device's mac address
236 */
237 syncStageReportData: function (mac) {
238 RCTModule.syncStageReportData(mac)
239 },
240
241 /**
242 * Send random number to device to prepare for binding, the number will be displayed on the device.
243 * @param {string} mac Device's mac address
244 */
245 sendRandom: function (mac) {
246 RCTModule.sendRandom(mac)
247 },
248
249 /**
250 * Get AM picture's index
251 * @param {string} mac Device's mac address
252 */
253 getPicture: function (mac) {
254 RCTModule.getPicture(mac)
255 },
256
257 /**
258 * Set picture for AM
259 * @param {string} mac Device's mac address
260 * @param {number} index The index of picture
261 */
262 setPicture: function (mac, index) {
263 RCTModule.setPicture(mac, index)
264 },
265
266 /**
267 * Get all connected AM3S device
268 *
269 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
270 */
271 getAllConnectedDevices: function () {
272 RCTModule.getAllConnectedDevices()
273 },
274}
diff --git a/libs/ihealth-sdk/module/AM4Module.js b/libs/ihealth-sdk/module/AM4Module.js
new file mode 100755
index 0000000..7cb44ff
--- /dev/null
+++ b/libs/ihealth-sdk/module/AM4Module.js
@@ -0,0 +1,321 @@
1'use strict';
2
3
4var {
5 NativeModules,
6 DeviceEventEmitter
7} = require('react-native');
8
9var AMProfileModule = require('./AMProfileModule.js');
10
11var RCTModule = NativeModules.AM4Module
12
13/**
14 * @module AM4Module
15 */
16module.exports = {
17
18 Event_Notify: RCTModule.Event_Notify,
19
20 /**
21 * Get AM4 device's IDPS information.
22 * @param {string} mac Device's mac address
23 */
24 getIdps: function (mac) {
25 RCTModule.getIdps(mac)
26 },
27
28 /**
29 * Reset AM4 device.
30 * @param {string} mac Device's mac address
31 */
32 reset: function (mac) {
33 RCTModule.reset(mac)
34 },
35
36 /**
37 * Get user's ID
38 * @param {string} mac Device's mac address
39 */
40 getUserId: function (mac) {
41 RCTModule.getUserId(mac)
42 },
43
44 /**
45 * Get alarms' count
46 * @param {string} mac Device's mac address
47 */
48 getAlarmClockNum: function (mac) {
49 RCTModule.getAlarmClockNum(mac)
50 },
51
52 /**
53 * Get alarm information by id
54 * @param {string} mac Device's mac address
55 * @param {array} alarmIDArray Alarm id array to be query.<br/>
56 * <ul>
57 * <li>The parameters should be 1, 2, or 3</li>
58 * <li>The duplicate parameters will be IGNORED</li>
59 * <li>The query result will be in ascending order of id.</li>
60 * <li>If specified alarm not set yet, the result will not include the id.</li>
61 * </ul>
62 */
63 getAlarmClockDetail: function (mac, alarmIDArray) {
64 RCTModule.getAlarmClockDetail(mac, alarmIDArray)
65 },
66
67 /**
68 * Set alarm
69 * @param {string} mac Device's mac address
70 * @param {number} id Alarm id<br/>
71 * <b>Range:</b> 1, 2 or 3
72 * @param {number} hour Alarm hour part<br/>
73 * <b>Range:</b> [0, 23]
74 * @param {number} min Alarm minute part<br/>
75 * <b>Range:</b> [0, 59]
76 * @param {boolean} isRepeat Indicates whether it will repeat:
77 * <ul>
78 * <li>true indicates that it will repeat as the <b>weeks</b> parameter</li>
79 * <li>false indicates that it will only play one time and <b>IGNORE</b> the <b>weeks</b> parameter</li>
80 * </ul>
81 * @param {array} weekArray The days in a week to repeat the alarm, week[0~6] indicates Sun~Sat.<br/>
82 * And 1 indicates open, 0 indicates close.<br/>
83 * <b>For example:</b><br/>
84 * {0, 1, 1, 1, 1, 1, 0} means the alarm will repeat on Mon, Tue, Wed, Thu, Fri.
85 * @param {boolean} isOn true if want to set the alarm, false to unset it.
86 */
87 setAlarmClock: function (mac, id, hour, min, isRepeat, weekArray, isOn) {
88 RCTModule.setAlarmClock(mac, id, hour, min, isRepeat, weekArray, isOn)
89 },
90
91 /**
92 * Delete alarm by id
93 * @param {string} mac Device's mac address
94 * @param {number} id Alarm id(should be 1, 2 or 3)
95 */
96 deleteAlarmClock: function (mac, id) {
97 RCTModule.deleteAlarmClock(mac, id)
98 },
99
100 /**
101 * Get activity remind setting.
102 * @param {string} mac Device's mac address
103 */
104 getActivityRemind: function (mac) {
105 RCTModule.getActivityRemind(mac)
106 },
107
108 /**
109 * Set/Unset activity remind
110 * @param {string} mac Device's mac address
111 * @param {number} hour Activity remind hour part<br/>
112 * <b>Range:</b> [0, 23]
113 * @param {number} min Activity remind minute part<br/>
114 * <b>Range:</b>[0, 59]
115 * @param {boolean} isOn true if want to set activity remind, false to unset it.
116 */
117 setActivityRemind: function (mac, hour, min, isOn) {
118 RCTModule.setActivityRemind(mac, hour, min, isOn)
119 },
120
121 /**
122 * Get device state and battery information
123 * @param {string} mac Device's mac address
124 */
125 queryAMState: function (mac) {
126 RCTModule.queryAMState(mac)
127 },
128
129 /**
130 * Set user ID
131 * @param {string} mac Device's mac address
132 * @param {number} id new user id <br/>
133 * <b>Range:</b> [1, 2147483647(0x7FFFFFFF)]
134 */
135 setUserId: function (mac, id) {
136 if (id < 1 || id > 0x7FFFFFFF) {
137 let result = {
138 "mac": mac,
139 "type": "AM4",
140 "action" : AMProfileModule.ACTION_ERROR_AM,
141 }
142 result[AMProfileModule.ERROR_NUM_AM] = AMProfileModule.ERROR_ID_ILLEGAL_ARGUMENT
143 result[AMProfileModule.ERROR_DESCRIPTION_AM] = 'setUserId() parameter id should be in the range [1, 2147483647(0x7FFFFFFF)]'
144 DeviceEventEmitter.emit(RCTModule.Event_Notify, result)
145 return
146 }
147 RCTModule.setUserId(mac, id)
148 },
149
150 /**
151 * Get user information
152 * @param {string} mac Device's mac address
153 */
154 getUserInfo: function (mac) {
155 RCTModule.getUserInfo(mac)
156 },
157
158 /**
159 * Set user's BMR
160 * @param {string} mac Device's mac address
161 * @param {number} bmr User's BMR<br/>
162 * <b>Range:</b> [1, 32767(0x7FFF)]
163 */
164 setUserBmr: function (mac, bmr) {
165 RCTModule.setUserBmr(mac, bmr)
166 },
167
168 /**
169 * Get the activity data.
170 * @param {string} mac Device's mac address
171 */
172 syncActivityData: function (mac) {
173 RCTModule.syncActivityData(mac)
174 },
175
176 /**
177 * Get the sleep data.
178 * @param {string} mac Device's mac address
179 */
180 syncSleepData: function (mac) {
181 RCTModule.syncSleepData(mac)
182 },
183
184 /**
185 * Get current time activity data.
186 * @param {string} mac Device's mac address
187 */
188 syncRealData: function (mac) {
189 RCTModule.syncRealData(mac)
190 },
191
192 /**
193 * Set the system time to AM device.
194 * @param {string} mac Device's mac address
195 */
196 syncRealTime: function (mac) {
197 RCTModule.syncRealTime(mac)
198 },
199
200 /**
201 * Set hour mode
202 * @param {string} mac Device's mac address
203 * @param {number} hourMode The value should be one of following:
204 * <ul>
205 * <li>{@link module:AMProfileModule.AM_SET_12_HOUR_MODE AMProfileModule.AM_SET_12_HOUR_MODE(0)}</li>
206 * <li>{@link module:AMProfileModule.AM_SET_24_HOUR_MODE AMProfileModule.AM_SET_24_HOUR_MODE(1)}</li>
207 * <li>{@link module:AMProfileModule.AM_SET_EXCEPT_EUROPE_12_HOUR_MODE AMProfileModule.AM_SET_EXCEPT_EUROPE_12_HOUR_MODE(2)}</li>
208 * <li>{@link module:AMProfileModule.AM_SET_EUROPE_12_HOUR_MODE AMProfileModule.AM_SET_EUROPE_12_HOUR_MODE(3)}</li>
209 * <li>{@link module:AMProfileModule.AM_SET_EXCEPT_EUROPE_24_HOUR_MODE AMProfileModule.AM_SET_EXCEPT_EUROPE_24_HOUR_MODE(4)}</li>
210 * <li>{@link module:AMProfileModule.AM_SET_EUROPE_24_HOUR_MODE AMProfileModule.AM_SET_EUROPE_24_HOUR_MODE(5)}</li>
211 * </ul>
212 */
213 setHourMode: function (mac, hourMode) {
214 RCTModule.setHourMode(mac, hourMode)
215 },
216
217 /**
218 * Get hour mode
219 * @param {string} mac Device's mac address
220 */
221 getHourMode: function (mac) {
222 RCTModule.getHourMode(mac)
223 },
224
225 /**
226 * Disconnect device
227 * @param {string} mac Device's mac address
228 */
229 disconnect: function (mac) {
230 RCTModule.disconnect(mac)
231 },
232
233 /**
234 * Set user information
235 * @param {string} mac Device's mac address
236 * @param {number} age User's age<br/>
237 * <b>Range:</b> [1, 255]
238 * @param {number} height User's height(int in cm)<br/>
239 * <b>Range:</b> [1, 255]
240 * @param {number} weight User's weight(float)<br/>
241 * <b>Range:</b> [1.0, 255.0]
242 * @param {number} gender User's gender<br/>
243 * <b>Value:</b>
244 * <ul>
245 * <li>{@link module:AMProfileModule.AM_SET_FEMALE AMProfileModule.AM_SET_FEMALE(0)}</li>
246 * <li>{@link module:AMProfileModule.AM_SET_MALE AMProfileModule.AM_SET_MALE(1)}</li>
247 * </ul>
248 * @param {number} unit Distance's unit type(kilometre or miles)<br/>
249 * <b>Value:</b>
250 * <ul>
251 * <li>{@link module:AMProfileModule.AM_SET_UNIT_IMPERIAL_STANDARD AMProfileModule.AM_SET_UNIT_IMPERIAL_STANDARD(0)} (miles)</li>
252 * <li>{@link module:AMProfileModule.AM_SET_UNIT_METRIC AMProfileModule.AM_SET_UNIT_METRIC(1)} (kilometre)</li>
253 * </ul>
254 * @param {number} target The goal of maximum steps<br/>
255 * <b>Range:</b> [4, 2147483647(0x7FFFFFFF)]
256 * @param {number} activityLevel The level of activity strength<br/>
257 * <ul>
258 * <li>1 indicates sedentary</li>
259 * <li>2 indicates active</li>
260 * <li>3 indicates very active</li>
261 * </ul>
262 * @param {number} min swim target time(in minutes)<br/>
263 * <b>Range:</b> [1, 1439(23 * 60 + 59)]
264 */
265 setUserInfo: function (mac, age, height, weight, gender, unit, target, activityLevel, min) {
266 RCTModule.setUserInfo(mac, age, height, weight, gender, unit, target, activityLevel, min)
267 },
268
269 /**
270 * Get stage report data
271 * @param {string} mac Device's mac address
272 */
273 syncStageReportData: function (mac) {
274 RCTModule.syncStageReportData(mac)
275 },
276
277 /**
278 * Send random number to device to prepare for binding, the number will be displayed on the device.
279 * @param {string} mac Device's mac address
280 */
281 sendRandom: function (mac) {
282 RCTModule.sendRandom(mac)
283 },
284
285 /**
286 * Get swim parameters
287 * @param {string} mac Device's mac address
288 */
289 checkSwimPara: function (mac) {
290 RCTModule.checkSwimPara(mac)
291 },
292
293 /**
294 * Set swim parameters
295 * @param {string} mac Device's mac address
296 * @param {boolean} isOpen Set true to open swim function, set false to close it.
297 * @param {number} poolLength the swimming pool's length.<br/>
298 * <b>Range:</b> [1, 255]
299 * @param {number} hours The cut out time's hour part<br/>
300 * <b>Range:</b> [0, 23]
301 * @param {number} minutes The cut out time's minute part<br/>
302 * Range[0, 59]
303 * @param {number} unit The pool length's unit type(metre or yard).
304 * <ul>
305 * <li>{@link module:AMProfileModule.AM_SET_UNIT_IMPERIAL_STANDARD AMProfileModule.AM_SET_UNIT_IMPERIAL_STANDARD(0)} (yard)</li>
306 * <li>{@link module:AMProfileModule.AM_SET_UNIT_METRIC AMProfileModule.AM_SET_UNIT_METRIC(1)} (metre)</li>
307 * </ul>
308 */
309 setSwimPara: function (mac, isOpen, poolLength, hours, minutes, unit) {
310 RCTModule.setSwimPara(mac, isOpen, poolLength, hours, minutes, unit)
311 },
312
313 /**
314 * Get all connected AM4 device
315 *
316 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
317 */
318 getAllConnectedDevices: function () {
319 RCTModule.getAllConnectedDevices()
320 },
321}
diff --git a/libs/ihealth-sdk/module/AM5Module.js b/libs/ihealth-sdk/module/AM5Module.js
new file mode 100755
index 0000000..ab9f0ae
--- /dev/null
+++ b/libs/ihealth-sdk/module/AM5Module.js
@@ -0,0 +1,150 @@
1'use strict';
2
3
4var {
5 NativeModules,
6 DeviceEventEmitter
7} = require('react-native');
8
9var AM5ProfileModule = require('./AM5ProfileModule.js');
10
11var RCTModule = NativeModules.AM5Module
12
13/**
14 * @module AM5Module
15 */
16module.exports = {
17
18 Event_Notify: RCTModule.Event_Notify,
19
20 /**
21 * Binding apps and devices.
22 * AM5 devices must be bound one-to-one. If you want to use other devices, you must unbind them first and then bind them to other devices.
23 * @param {string} mac Device's mac address
24 */
25 bindDevice: function (mac) {
26 RCTModule.bindDevice(mac)
27 },
28
29 /**
30 * UnBind apps and devices.
31 * @param {string} mac Device's mac address
32 */
33 unBindDevice: function (mac) {
34 RCTModule.unBindDevice(mac)
35 },
36
37 /**
38 * Get information of the device
39 * @param {string} mac Device's mac address
40 */
41 getBasicInfo: function (mac) {
42 RCTModule.getBasicInfo(mac)
43 },
44
45// /**
46// * Set time of the device
47// * @param year year
48// * @param month month
49// * @param day day
50// * @param hour hour
51// * @param minute minute
52// * @param second second
53// * @param week What day is today? Effective Value 1-7
54// */
55// setTime: function (mac, year, month, day, minute, second, week) {
56// RCTModule.setTime(mac, year, month, day, minute, second, week)
57// },
58
59 /**
60 * Set current time of the device
61 */
62 setTime: function (mac) {
63 RCTModule.setTime(mac)
64 },
65
66 /**
67 * Get the live data of the device
68 * @param {string} mac Device's mac address
69 * @param year Year of birth
70 * @param month Month of birth
71 * @param day Day of birth
72 * @param weight weight
73 * @param height height
74 * @param gander gender male: 1, female: 2
75 */
76 setUserInfo: function (mac, year, month, day, weight, height, gander) {
77 RCTModule.setUserInfo(mac, year, month, day, weight, height, gander)
78 },
79
80 /**
81 * Set unit
82 * When you never set them, treat them as defaults
83 * @param {string} mac Device's mac address
84 * @param type 0: Distance unit unit: 0 default ; 1 KM ; 2 MI
85 * @param type 1: Wight unit unit: 0 default ; 1 KG ; 2 LB ; 3 ST
86 * @param type 2: Temperature unit unit: 0 default ; 1 °C ; 2 °F
87 * @param type 3: Distance at each step unit: distance (cm) (default 0cm)
88 * @param type 4: Language unit: 0 default ; 1 zh ; 2 en ; 3 fr ; 4 de ; 5 it ; 6 es ; 7 ja ; 8 po ; 9 cz
89 * @param type 5: Time Mode unit: 0 default ; 1 24 hour system ; 2 12 hour system
90 * @param type 6: Distance at each step of run unit: distance (cm) (default 0cm)
91 * @param type 7: GPS calibration switch unit: 0 default ; 1 open ; 2 close
92 */
93 setUnit: function (mac, type, unit) {
94 RCTModule.setUnit(mac, type, unit)
95 },
96
97 /**
98 * Reboot the device
99 * @param {string} mac Device's mac address
100 */
101 reboot: function (mac) {
102 RCTModule.reboot(mac)
103 },
104
105 /**
106 * Set Hand Wear Mode
107 * @param {string} mac Device's mac address
108 * @param mode 0 left-hand 1 right-hand
109 */
110 setHandWearMode: function (mac, mode) {
111 RCTModule.setHandWearMode(mac, mode)
112 },
113
114 /**
115 * Get the live data of the device
116 * @param {string} mac Device's mac address
117 */
118 getLiveData: function (mac) {
119 RCTModule.getLiveData(mac)
120 },
121
122 /**
123 * Sync health data from device
124 * @param {string} mac Device's mac address
125 */
126 syncHealthData: function (mac) {
127 RCTModule.syncHealthData(mac)
128 },
129
130 /**
131 * Stop sync health data from device
132 * @param {string} mac Device's mac address
133 */
134 stopSyncHealthData: function (mac) {
135 RCTModule.stopSyncHealthData(mac)
136 },
137
138 /**
139 * Get all connected AM4 device
140 *
141 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
142 */
143 getAllConnectedDevices: function () {
144 RCTModule.getAllConnectedDevices()
145 },
146
147 disconnect: function (mac) {
148 RCTModule.disconnect(mac)
149 },
150}
diff --git a/libs/ihealth-sdk/module/AM5ProfileModule.js b/libs/ihealth-sdk/module/AM5ProfileModule.js
new file mode 100755
index 0000000..00621ea
--- /dev/null
+++ b/libs/ihealth-sdk/module/AM5ProfileModule.js
@@ -0,0 +1,68 @@
1'use strict';
2
3
4var {NativeModules} = require('react-native');
5
6var RCTModule = NativeModules.AM5ProfileModule
7
8/**
9 * @module AM5ProfileModule
10 */
11module.exports = {
12
13 ACTION_ERROR: RCTModule.ACTION_ERROR,
14 ERROR_NUM: RCTModule.ERROR_NUM,
15 ERROR_DESCRIPTION: RCTModule.ERROR_DESCRIPTION,
16
17 ACTION_USER_BIND: RCTModule.ACTION_ERROR,
18 ACTION_USER_UNBIND: RCTModule.ACTION_ERROR,
19 ACTION_FUNCTION_SUPPORT: RCTModule.ACTION_ERROR,
20 ACTION_BASIC_INFO: RCTModule.ACTION_ERROR,
21 ACTION_MAC_ADDRESS: RCTModule.ACTION_ERROR,
22
23 MAC_ADDRESS: RCTModule.MAC_ADDRESS,
24 BASIC_BATTSTATUS: RCTModule.BASIC_BATTSTATUS,
25 BASIC_DEIVCEID: RCTModule.BASIC_DEIVCEID,
26 BASIC_ENERGE: RCTModule.BASIC_ENERGE,
27 BASIC_FIRMWAREVERSION: RCTModule.BASIC_FIRMWAREVERSION,
28 BASIC_MODE: RCTModule.BASIC_MODE,
29 BASIC_PAIRFLAG: RCTModule.BASIC_PAIRFLAG,
30 BASIC_REBOOT: RCTModule.BASIC_REBOOT,
31
32 ACTION_LIVE_DATA: RCTModule.ACTION_LIVE_DATA,
33 ACTION_ACTIVITY_COUNT: RCTModule.ACTION_ACTIVITY_COUNT,
34 ACTION_SET_TIME: RCTModule.ACTION_SET_TIME,
35 ACTION_SET_ALARM: RCTModule.ACTION_SET_ALARM,
36 ACTION_SET_GOAL: RCTModule.ACTION_SET_GOAL,
37 ACTION_SET_LONG_SIT: RCTModule.ACTION_SET_LONG_SIT,
38 ACTION_SET_USER_INFO: RCTModule.ACTION_SET_USER_INFO,
39 ACTION_SET_UNIT: RCTModule.ACTION_SET_UNIT,
40 ACTION_SET_HAND_WEAR_MODE: RCTModule.ACTION_SET_HAND_WEAR_MODE,
41 ACTION_SET_UP_HAND_GESTURE: RCTModule.ACTION_SET_UP_HAND_GESTURE,
42 ACTION_SET_HEART_RATE_INTERVAL: RCTModule.ACTION_SET_HEART_RATE_INTERVAL,
43 ACTION_SET_HEART_RATE_MEASURE_MODE: RCTModule.ACTION_SET_HEART_RATE_MEASURE_MODE,
44 ACTION_SET_ONE_KEY_RESET: RCTModule.ACTION_SET_ONE_KEY_RESET,
45 ACTION_SET_NOT_DISTURB: RCTModule.ACTION_SET_NOT_DISTURB,
46 ACTION_SET_SPORT_MODE: RCTModule.ACTION_SET_SPORT_MODE,
47
48 OPERATION_RESULT: RCTModule.OPERATION_RESULT,
49 OPERATION_ACTION: RCTModule.OPERATION_ACTION,
50
51 ACTION_NOTICE_COMMING_CALL: RCTModule.ACTION_NOTICE_COMMING_CALL,
52 ACTION_NOTICE_COMMING_CALL_STOP: RCTModule.ACTION_NOTICE_COMMING_CALL_STOP,
53 ACTION_NOTICE_NEW_MESSAGE: RCTModule.ACTION_NOTICE_NEW_MESSAGE,
54
55 ACTION_SYNC_ACTIVITY: RCTModule.ACTION_SYNC_ACTIVITY,
56 ACTION_SYNC_ACTIVITY_DATA: RCTModule.ACTION_SYNC_ACTIVITY_DATA,
57 ACTION_SYNC_CONFIG: RCTModule.ACTION_SYNC_CONFIG,
58 ACTION_SYNC_HEALTH_DATA: RCTModule.ACTION_SYNC_HEALTH_DATA,
59 ACTION_SYNC_HEALTH_DATA_SPORT: RCTModule.ACTION_SYNC_HEALTH_DATA_SPORT,
60 ACTION_SYNC_HEALTH_DATA_SLEEP: RCTModule.ACTION_SYNC_HEALTH_DATA_SLEEP,
61 ACTION_SYNC_HEALTH_DATA_HEART_RATE: RCTModule.ACTION_SYNC_HEALTH_DATA_HEART_RATE,
62 ACTION_SYNC_HEALTH_DATA_BLOOD_PRESSURE: RCTModule.ACTION_SYNC_HEALTH_DATA_BLOOD_PRESSURE,
63
64 OPERATION_STATUS: RCTModule.OPERATION_STATUS,
65 PROGRESS: RCTModule.PROGRESS,
66
67 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
68}
diff --git a/libs/ihealth-sdk/module/AMProfileModule.js b/libs/ihealth-sdk/module/AMProfileModule.js
new file mode 100755
index 0000000..facb98b
--- /dev/null
+++ b/libs/ihealth-sdk/module/AMProfileModule.js
@@ -0,0 +1,463 @@
1/**
2 * Created by Jeepend on 15/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.AMProfileModule
10
11/**
12 * @module AMProfileModule
13 */
14module.exports = {
15
16 ACTION_ERROR_AM: RCTModule.ACTION_ERROR_AM,
17 ACTION_RESET_AM: RCTModule.ACTION_RESET_AM,
18 ACTION_USERID_AM: RCTModule.ACTION_USERID_AM,
19 ACTION_SET_USERID_SUCCESS_AM: RCTModule.ACTION_SET_USERID_SUCCESS_AM,
20 ACTION_SYNC_TIME_SUCCESS_AM: RCTModule.ACTION_SYNC_TIME_SUCCESS_AM,
21 ACTION_SET_USERINFO_SUCCESS_AM: RCTModule.ACTION_SET_USERINFO_SUCCESS_AM,
22 ACTION_GET_USERINFO_AM: RCTModule.ACTION_GET_USERINFO_AM,
23 ACTION_GET_ALARMNUM_AM: RCTModule.ACTION_GET_ALARMNUM_AM,
24 ACTION_GET_ALARMINFO_AM: RCTModule.ACTION_GET_ALARMINFO_AM,
25 ACTION_SET_ALARMINFO_SUCCESS_AM: RCTModule.ACTION_SET_ALARMINFO_SUCCESS_AM,
26 ACTION_DELETE_ALARM_SUCCESS_AM: RCTModule.ACTION_DELETE_ALARM_SUCCESS_AM,
27 ACTION_GET_ACTIVITY_REMIND_AM: RCTModule.ACTION_GET_ACTIVITY_REMIND_AM,
28 ACTION_SET_ACTIVITYREMIND_SUCCESS_AM: RCTModule.ACTION_SET_ACTIVITYREMIND_SUCCESS_AM,
29 ACTION_SYNC_ACTIVITY_DATA_AM: RCTModule.ACTION_SYNC_ACTIVITY_DATA_AM,
30 ACTION_SYNC_SLEEP_DATA_AM: RCTModule.ACTION_SYNC_SLEEP_DATA_AM,
31 ACTION_SYNC_STAGE_DATA_AM: RCTModule.ACTION_SYNC_STAGE_DATA_AM,
32 ACTION_QUERY_STATE_AM: RCTModule.ACTION_QUERY_STATE_AM,
33 ACTION_SYNC_REAL_DATA_AM: RCTModule.ACTION_SYNC_REAL_DATA_AM,
34 ACTION_SET_BMR_SUCCESS_AM: RCTModule.ACTION_SET_BMR_SUCCESS_AM,
35 ACTION_GET_SWIMINFO_AM: RCTModule.ACTION_GET_SWIMINFO_AM,
36 ACTION_SET_SWIMINFO_AM: RCTModule.ACTION_SET_SWIMINFO_AM,
37 ACTION_GET_RANDOM_AM: RCTModule.ACTION_GET_RANDOM_AM,
38 ACTION_SET_HOUR_MODE_SUCCESS_AM: RCTModule.ACTION_SET_HOUR_MODE_SUCCESS_AM,
39 ACTION_GET_HOUR_MODE_AM: RCTModule.ACTION_GET_HOUR_MODE_AM,
40 ACTION_SET_DEVICE_MODE_AM: RCTModule.ACTION_SET_DEVICE_MODE_AM,
41 ACTION_CLOUD_BINDING_AM_SUCCESS: RCTModule.ACTION_CLOUD_BINDING_AM_SUCCESS,
42 ACTION_CLOUD_BINDING_AM_FAIL: RCTModule.ACTION_CLOUD_BINDING_AM_FAIL,
43 ACTION_CLOUD_UNBINDING_AM_SUCCESS: RCTModule.ACTION_CLOUD_UNBINDING_AM_SUCCESS,
44 ACTION_CLOUD_UNBINDING_AM_FAIL: RCTModule.ACTION_CLOUD_UNBINDING_AM_FAIL,
45 ACTION_CLOUD_SEARCH_AM: RCTModule.ACTION_CLOUD_SEARCH_AM,
46 ACTION_CLOUD_SEARCH_FAIL_AM: RCTModule.ACTION_CLOUD_SEARCH_FAIL_AM,
47 ACTION_SET_PICTURE_SUCCESS_AM: RCTModule.ACTION_SET_PICTURE_SUCCESS_AM,
48 ACTION_GET_PICTURE_AM: RCTModule.ACTION_GET_PICTURE_AM,
49
50 // Keys
51 ERROR_NUM_AM: RCTModule.ERROR_NUM_AM,
52 ERROR_ID_ILLEGAL_ARGUMENT: RCTModule.ERROR_ID_ILLEGAL_ARGUMENT,
53 ERROR_ID_VERSION_NOT_SUPPORT: RCTModule.ERROR_ID_VERSION_NOT_SUPPORT,
54 ERROR_DESCRIPTION_AM: RCTModule.ERROR_DESCRIPTION_AM,
55 RESET_AM: RCTModule.RESET_AM,
56 USERID_AM: RCTModule.USERID_AM,
57 GET_USER_AGE_AM: RCTModule.GET_USER_AGE_AM,
58 GET_USER_STEP_AM: RCTModule.GET_USER_STEP_AM,
59 GET_USER_HEIGHT_AM: RCTModule.GET_USER_HEIGHT_AM,
60 GET_USER_SEX_AM: RCTModule.GET_USER_SEX_AM,
61 GET_USER_WEIGHT_AM: RCTModule.GET_USER_WEIGHT_AM,
62 GET_USER_UNIT_AM: RCTModule.GET_USER_UNIT_AM,
63 GET_USER_TARGET1_AM: RCTModule.GET_USER_TARGET1_AM,
64 GET_USER_TARGET2_AM: RCTModule.GET_USER_TARGET2_AM,
65 GET_USER_TARGET3_AM: RCTModule.GET_USER_TARGET3_AM,
66 GET_USER_SWIMTARGET_AM: RCTModule.GET_USER_SWIMTARGET_AM,
67 GET_ALARMNUM_AM: RCTModule.GET_ALARMNUM_AM,
68 GET_ALARMNUM_ID_AM: RCTModule.GET_ALARMNUM_ID_AM,
69 GET_ALARM_CLOCK_DETAIL: RCTModule.GET_ALARM_CLOCK_DETAIL,
70 GET_ALARM_ID_AM: RCTModule.GET_ALARM_ID_AM,
71 GET_ALARM_TIME_AM: RCTModule.GET_ALARM_TIME_AM,
72 GET_ALARM_ISREPEAT_AM: RCTModule.GET_ALARM_ISREPEAT_AM,
73 GET_ALARM_WEEK_AM: RCTModule.GET_ALARM_WEEK_AM,
74 GET_ALARM_WEEK_SUNDAY_AM: RCTModule.GET_ALARM_WEEK_SUNDAY_AM,
75 GET_ALARM_WEEK_MONDAY_AM: RCTModule.GET_ALARM_WEEK_MONDAY_AM,
76 GET_ALARM_WEEK_TUESDAY_AM: RCTModule.GET_ALARM_WEEK_TUESDAY_AM,
77 GET_ALARM_WEEK_WEDNESDAY_AM: RCTModule.GET_ALARM_WEEK_WEDNESDAY_AM,
78 GET_ALARM_WEEK_THURSDAY_AM: RCTModule.GET_ALARM_WEEK_THURSDAY_AM,
79 GET_ALARM_WEEK_FRIDAY_AM: RCTModule.GET_ALARM_WEEK_FRIDAY_AM,
80 GET_ALARM_WEEK_SATURDAY_AM: RCTModule.GET_ALARM_WEEK_SATURDAY_AM,
81 GET_ALARM_ISON_AM: RCTModule.GET_ALARM_ISON_AM,
82 GET_ACTIVITY_REMIND_TIME_AM: RCTModule.GET_ACTIVITY_REMIND_TIME_AM,
83 GET_ACTIVITY_REMIND_ISON_AM: RCTModule.GET_ACTIVITY_REMIND_ISON_AM,
84 /**
85 * The key of the whole activity data.("activity")
86 */
87 SYNC_ACTIVITY_DATA_AM: RCTModule.SYNC_ACTIVITY_DATA_AM,
88 /**
89 * The key of the time for every 5 min activity data.("time")<br/>
90 * <b>Value format: </b><br/>
91 * yyyy-MM-dd HH:mm:ss<br/>
92 * <b>Example: </b><br/>
93 * 2016-07-18 09:00:00
94 */
95 SYNC_ACTIVITY_DATA_TIME_AM: RCTModule.SYNC_ACTIVITY_DATA_TIME_AM,
96 /**
97 * The key of the step number for every 5 min activity data.("step")<br/>
98 * <b>Value range:</b><br/>
99 * 0-4294967295(0xFFFFFFFF)
100 */
101 SYNC_ACTIVITY_DATA_STEP_AM: RCTModule.SYNC_ACTIVITY_DATA_STEP_AM,
102 /**
103 * The key of the step length for every 5 min activity data.("stepsize")<br/>
104 * <b>Value range:</b><br/>
105 * 0-255(0xFF)
106 */
107 SYNC_ACTIVITY_DATA_STEP_LENGTH_AM: RCTModule.SYNC_ACTIVITY_DATA_STEP_LENGTH_AM,
108 /**
109 * The key of the calorie for every 5 min activity data.("calorie")<br/>
110 * <b>Value range:</b><br/>
111 * 0-65535(0xFFFF)
112 */
113 SYNC_ACTIVITY_DATA_CALORIE_AM: RCTModule.SYNC_ACTIVITY_DATA_CALORIE_AM,
114 /**
115 * The key of the whole data for every 5 min activity data.("activity_each_data")
116 */
117 SYNC_ACTIVITY_EACH_DATA_AM: RCTModule.SYNC_ACTIVITY_EACH_DATA_AM,
118 /**
119 * The key of the whole sleep data.("sleep")
120 */
121 SYNC_SLEEP_DATA_AM: RCTModule.SYNC_SLEEP_DATA_AM,
122 /**
123 * The key of the each 5 minute's sleep time.("time")<br/>
124 * <b>Value format:</b><br/>
125 * yyyy-MM-dd HH:mm:ss
126 */
127 SYNC_SLEEP_DATA_TIME_AM: RCTModule.SYNC_SLEEP_DATA_TIME_AM,
128 /**
129 * The key of the each 5 minute's sleep level.("level")<br/>
130 * <b>Value:</b><br/>
131 * <ul>
132 * <li>0 indicates awake</li>
133 * <li>1 indicates light sleep</li>
134 * <li>2 indicates deep sleep</li>
135 * </ul>
136 */
137 SYNC_SLEEP_DATA_LEVEL_AM: RCTModule.SYNC_SLEEP_DATA_LEVEL_AM,
138 SYNC_SLEEP_EACH_DATA_AM: RCTModule.SYNC_SLEEP_EACH_DATA_AM,
139 /**
140 * The key of data array of the stage data.("stage_data")
141 */
142 SYNC_STAGE_DATA_AM: RCTModule.SYNC_STAGE_DATA_AM,
143 SYNC_STAGE_DATA_TYPE_AM: RCTModule.SYNC_STAGE_DATA_TYPE_AM,
144 /**
145 * Type of work out.("stage_data_type_workout")
146 */
147 SYNC_STAGE_DATA_TYPE_WORKOUT_AM: RCTModule.SYNC_STAGE_DATA_TYPE_WORKOUT_AM,
148 /**
149 * Type of sleep.("sleep")
150 */
151 SYNC_STAGE_DATA_TYPE_SLEEP_AM: RCTModule.SYNC_STAGE_DATA_TYPE_SLEEP_AM,
152 /**
153 * Type of swim.("swim")
154 */
155 SYNC_STAGE_DATA_TYPE_SWIM_AM: RCTModule.SYNC_STAGE_DATA_TYPE_SWIM_AM,
156 /**
157 * Type of page view summary.("page_view_summary")
158 */
159 SYNC_STAGE_DATA_TYPE_PAGE_VIEW_SUMMARY: RCTModule.SYNC_STAGE_DATA_TYPE_PAGE_VIEW_SUMMARY,
160 /**
161 * The key of stage report stop time.("stoptime")<br/>
162 * <b>Value format:</b><br/>
163 * yyyy-MM-dd HH:mm:ss
164 */
165 SYNC_STAGE_DATA_STOP_TIME_AM: RCTModule.SYNC_STAGE_DATA_STOP_TIME_AM,
166 /**
167 * The key of stage report used time(in minutes).("usedtime")<br/>
168 * <b>Value range:</b><br/>
169 * 0-65535(0xFFFF)
170 */
171 SYNC_STAGE_DATA_USED_TIME_AM: RCTModule.SYNC_STAGE_DATA_USED_TIME_AM,
172 /**
173 * The key of the step number of work out.("stage_data_workout_step")<br/>
174 * <b>Value range:</b><br/>
175 * 0-4294967295(0xFFFFFFFF)
176 */
177 SYNC_STAGE_DATA_WORKOUT_STEP_AM: RCTModule.SYNC_STAGE_DATA_WORKOUT_STEP_AM,
178 /**
179 * The key of the distance.("stage_data_distance")<br/>
180 * It's string type<br/>
181 * <b>Value format&range:</b><br/>
182 * "123.456"("0.0"-"255.255"(0xFF.0xFF))
183 */
184 SYNC_STAGE_DATA_DISTANCE_AM: RCTModule.SYNC_STAGE_DATA_DISTANCE_AM,
185 /**
186 * The key of the calorie.("calorie")<br/>
187 * <b>Value range:</b><br/>
188 * 0-65535(0xFFFF)
189 */
190 SYNC_STAGE_DATA_CALORIE_AM: RCTModule.SYNC_STAGE_DATA_CALORIE_AM,
191 /**
192 * The key of sleep efficiency.("sleepefficiency")<br/>
193 * <b>Value range:</b><br/>
194 * 0.0-100.0
195 */
196 SYNC_STAGE_DATA_SLEEP_EFFICIENCY_AM: RCTModule.SYNC_STAGE_DATA_SLEEP_EFFICIENCY_AM,
197 /**
198 * The key of whether need to extend sleep 50 minutes or not.("is50min")<br/>
199 * <b>Value:</b><br/>
200 * <ul>
201 * <li>0 indicates not need to extend.</li>
202 * <li>1 indicates need to extend.</li>
203 * </ul>
204 */
205 SYNC_STAGE_DATA_SLEEP_IS50MIN_AM: RCTModule.SYNC_STAGE_DATA_SLEEP_IS50MIN_AM,
206 /**
207 * The key of swim stroke.("swimming stroke")<br/>
208 * <b>Value:</b><br/>
209 * <ul>
210 * <li>0 indicates freestyle.</li>
211 * <li>1 indicates breaststroke.</li>
212 * <li>2 indicates backstroke.</li>
213 * <li>5 indicates unknown.</li>
214 * </ul>
215 */
216 SYNC_STAGE_DATA_SWIM_STROKE_AM: RCTModule.SYNC_STAGE_DATA_SWIM_STROKE_AM,
217 /**
218 * The key of swim arm pulling time.("number of strokes")<br/>
219 * <b>Value range:</b><br/>
220 * 0-65535(0xFFFF)
221 */
222 SYNC_STAGE_DATA_SWIM_PULL_TIMES_AM: RCTModule.SYNC_STAGE_DATA_SWIM_PULL_TIMES_AM,
223 /**
224 * The key of swim round number.("number of turns")<br/>
225 * <b>Value range:</b><br/>
226 * 0-255(0xFF)
227 */
228 SYNC_STAGE_DATA_SWIM_TURNS_AM: RCTModule.SYNC_STAGE_DATA_SWIM_TURNS_AM,
229 /**
230 * The key of the swimming pool length.("stage_data_swimpool_length")<br/>
231 * <b>Value range:</b><br/>
232 * 0-255(0xFF)
233 */
234 SYNC_STAGE_DATA_SWIMPOOL_LENGTH_AM: RCTModule.SYNC_STAGE_DATA_SWIMPOOL_LENGTH_AM,
235 /**
236 * The key of the time of cut in swim and begin swim(in minutes).("stage_data_cutindif")<br/>
237 * <b>Value range:</b><br/>
238 * 0-65535(0xFFFF)
239 */
240 SYNC_STAGE_DATA_SWIM_CUTINDIF_AM: RCTModule.SYNC_STAGE_DATA_SWIM_CUTINDIF_AM,
241 /**
242 * The key of the time of cut out swim and end swim(in minutes).("stage_data_cutoutdif")<br/>
243 * <b>Value range:</b><br/>
244 * 0-65535(0xFFFF)
245 */
246 SYNC_STAGE_DATA_SWIM_CUTOUTDIF_AM: RCTModule.SYNC_STAGE_DATA_SWIM_CUTOUTDIF_AM,
247 /**
248 * The key of the swim process flag.("stage_data_processflag")<br/>
249 * <b>Value:</b><br/>
250 * <ul>
251 * <li>0 indicates swim in process.</li>
252 * <li>1 indicates start of swimming.</li>
253 * <li>2 indicates end of swimming.</li>
254 * <li>3 indicates the swim is only a single round.</li>
255 * </ul>
256 */
257 SYNC_STAGE_DATA_SWIM_PROCESSFLAG_AM: RCTModule.SYNC_STAGE_DATA_SWIM_PROCESSFLAG_AM,
258 /**
259 * The key of the date of page view summary.("stage_data_view_summary_date")<br/>
260 * <b>Value format:</b><br/>
261 * yyyy-MM-dd
262 */
263 SYNC_STAGE_DATA_VIEW_SUMMARY_DATE_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_DATE_AM,
264 /**
265 * The key of the count that user view the step page.("stage_data_view_summary_step")<br/>
266 * <b>Value range:</b><br/>
267 * 0-65535(0xFFFF)
268 */
269 SYNC_STAGE_DATA_VIEW_SUMMARY_STEP_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_STEP_AM,
270 /**
271 * The key of the count that user view the distance page.("stage_data_view_summary_distance")<br/>
272 * <b>Value range:</b><br/>
273 * 0-65535(0xFFFF)
274 */
275 SYNC_STAGE_DATA_VIEW_SUMMARY_DISTANCE_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_DISTANCE_AM,
276 /**
277 * The key of the count that user view the calorie page.("stage_data_view_summary_calorie")<br/>
278 * <b>Value range:</b><br/>
279 * 0-65535(0xFFFF)
280 */
281 SYNC_STAGE_DATA_VIEW_SUMMARY_CALORIE_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_CALORIE_AM,
282 /**
283 * The key of the count that user view the activity target page.("stage_data_view_summary_target")<br/>
284 * <b>Value range:</b><br/>
285 * 0-65535(0xFFFF)
286 */
287 SYNC_STAGE_DATA_VIEW_SUMMARY_TARGET_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_TARGET_AM,
288 /**
289 * The key of the count that user view the swim summary page.("stage_data_view_summary_swim")<br/>
290 * <b>Value range:</b><br/>
291 * 0-65535(0xFFFF)
292 */
293 SYNC_STAGE_DATA_VIEW_SUMMARY_SWIM_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_SWIM_AM,
294 /**
295 * The key of state information.("query_state")<br/>
296 * <b>Value:</b><br/>
297 * <ul>
298 * <li>0 indicates waist</li>
299 * <li>1 indicates wrist</li>
300 * <li>2 indicates sleep</li>
301 * </ul>
302 */
303 QUERY_STATE_AM: RCTModule.QUERY_STATE_AM,
304 /**
305 * The key of battery level.("battery")<br/>
306 * <b>Value range:</b><br/>
307 * 0-10(10 indicates full)
308 */
309 QUERY_BATTERY_AM: RCTModule.QUERY_BATTERY_AM,
310 /**
311 * The key of the real step count.("step")<br/>
312 * <b>Value range:</b><br/>
313 * 0-4294967295(0xFFFFFFFF)
314 */
315 SYNC_REAL_STEP_AM: RCTModule.SYNC_REAL_STEP_AM,
316 /**
317 * The key of the real calorie(not including BMR).("calorie")<br/>
318 * <b>Value range:</b><br/>
319 * 0-65535(0xFFFF)
320 */
321 SYNC_REAL_CALORIE_AM: RCTModule.SYNC_REAL_CALORIE_AM,
322 /**
323 * The key of the real summary calorie(including BMR).("totalcalories")<br/>
324 * <b>Value range:</b><br/>
325 * 0-65535 + BMR(0xFFFF + BMR)
326 */
327 SYNC_REAL_TOTALCALORIE_AM: RCTModule.SYNC_REAL_TOTALCALORIE_AM,
328 /**
329 * The key of swimming lane length.("get_swimlane_length")<br/>
330 * <b>Value range:</b><br/>
331 * 0-255(0xFF)
332 */
333 GET_SWIMLANE_LENGTH_AM: RCTModule.GET_SWIMLANE_LENGTH_AM,
334 /**
335 * The key of whether the swim function is open or not.("get_swim_switch_am")<br/>
336 * <b>Value:</b><br/>
337 * <ul>
338 * <li>0 indicates swim function closed</li>
339 * <li>1/2 indicates swim function open</li>
340 * </ul>
341 */
342 GET_SWIM_SWITCH_AM: RCTModule.GET_SWIM_SWITCH_AM,
343 /**
344 * The key of the hour part of cut out swim function.("get_swim_cutout_hour_am")<br/>
345 * <b>Value range:</b><br/>
346 * 0-255(0xFF)
347 */
348 GET_SWIM_CUTOUT_HOUR_AM: RCTModule.GET_SWIM_CUTOUT_HOUR_AM,
349 /**
350 * The key of the minute part of cut out swim function.("get_swim_cutout_min_am")<br/>
351 * <b>Value range:</b><br/>
352 * 0-255(0xFF)
353 */
354 GET_SWIM_CUTOUT_MINUTE_AM: RCTModule.GET_SWIM_CUTOUT_MINUTE_AM,
355 /**
356 * The key of swim unit type.("get_swim_unit_am")<br/>
357 * <b>Value:</b><br/>
358 * <ul>
359 * <li>{@link module:AMProfileModule.AM_SET_UNIT_METRIC AMProfileModule.AM_SET_UNIT_METRIC(1)}</li>
360 * <li>{@link module:AMProfileModule.AM_SET_UNIT_IMPERIAL_STANDARD AMProfileModule.AM_SET_UNIT_IMPERIAL_STANDARD(0)}</li>
361 * </ul>
362 */
363 GET_SWIM_UNIT_AM: RCTModule.GET_SWIM_UNIT_AM,
364 /**
365 * The key of the random number sent to device.("random")<br/>
366 * The value will be a 6-long number decimal string.<br/>
367 * <b>Value range:</b><br/>
368 * "000000"-"999999"
369 */
370 GET_RANDOM_AM: RCTModule.GET_RANDOM_AM,
371 AM_SWITCH_OPEN: RCTModule.AM_SWITCH_OPEN,
372 AM_SWITCH_CLOSE: RCTModule.AM_SWITCH_CLOSE,
373 AM_SWITCH_REPEAT: RCTModule.AM_SWITCH_REPEAT,
374 AM_SEITCH_NOT_REPEAT: RCTModule.AM_SEITCH_NOT_REPEAT,
375 /**
376 * The value indicates male.(1)
377 */
378 AM_SET_MALE: RCTModule.AM_SET_MALE,
379 /**
380 * The value indicates female.(0)
381 */
382 AM_SET_FEMALE: RCTModule.AM_SET_FEMALE,
383 /**
384 * The value indicates metric unit type(kilometre/metre).(1)
385 */
386 AM_SET_UNIT_METRIC: RCTModule.AM_SET_UNIT_METRIC,
387 /**
388 * The value indicates imperial standard unit type(miles/yard).(0)
389 */
390 AM_SET_UNIT_IMPERIAL_STANDARD: RCTModule.AM_SET_UNIT_IMPERIAL_STANDARD,
391 /**
392 * The value indicates whole world 12 hour mode(0)
393 */
394 AM_SET_12_HOUR_MODE: RCTModule.AM_SET_12_HOUR_MODE,
395 /**
396 * The value indicates whole world 24 hour mode(1)
397 */
398 AM_SET_24_HOUR_MODE: RCTModule.AM_SET_24_HOUR_MODE,
399 /**
400 * The value indicates Europe world 12 hour mode(3)
401 */
402 AM_SET_EUROPE_12_HOUR_MODE: RCTModule.AM_SET_EUROPE_12_HOUR_MODE,
403 /**
404 * The value indicates Europe world 24 hour mode(5)
405 */
406 AM_SET_EUROPE_24_HOUR_MODE: RCTModule.AM_SET_EUROPE_24_HOUR_MODE,
407 /**
408 * The value indicates except Europe world 12 hour mode(2)
409 */
410 AM_SET_EXCEPT_EUROPE_12_HOUR_MODE: RCTModule.AM_SET_EXCEPT_EUROPE_12_HOUR_MODE,
411 /**
412 * The value indicates except Europe world 24 hour mode(4)
413 */
414 AM_SET_EXCEPT_EUROPE_24_HOUR_MODE: RCTModule.AM_SET_EXCEPT_EUROPE_24_HOUR_MODE,
415 /**
416 * The key of the time mdoe.<br/>
417 * <b>Value:</b><br/>
418 * <ul>
419 * <li>{@link module:AMProfileModule.AM_SET_12_HOUR_MODE AMProfileModule.AM_SET_12_HOUR_MODE(0)}</li>
420 * <li>{@link module:AMProfileModule.AM_SET_24_HOUR_MODE AMProfileModule.AM_SET_24_HOUR_MODE(1)}</li>
421 * <li>{@link module:AMProfileModule.AM_SET_EXCEPT_EUROPE_12_HOUR_MODE AMProfileModule.AM_SET_EXCEPT_EUROPE_12_HOUR_MODE(2)}</li>
422 * <li>{@link module:AMProfileModule.AM_SET_EUROPE_12_HOUR_MODE AMProfileModule.AM_SET_EUROPE_12_HOUR_MODE(3)}</li>
423 * <li>{@link module:AMProfileModule.AM_SET_EXCEPT_EUROPE_24_HOUR_MODE AMProfileModule.AM_SET_EXCEPT_EUROPE_24_HOUR_MODE(4)}</li>
424 * <li>{@link module:AMProfileModule.AM_SET_EUROPE_24_HOUR_MODE AMProfileModule.AM_SET_EUROPE_24_HOUR_MODE(5)}</li>
425 * </ul>
426 */
427 GET_HOUR_MODE_AM: RCTModule.GET_HOUR_MODE_AM,
428 /**
429 * Indicates device is sleep mode.(0)
430 */
431 AM_DEVICE_MODE_SLEEP: RCTModule.AM_DEVICE_MODE_SLEEP,
432 /**
433 * Indicates device is activity mode.(1)
434 */
435 AM_DEVICE_MODE_ACTIVITY: RCTModule.AM_DEVICE_MODE_ACTIVITY,
436 /**
437 * Indicates device is flight mode.(2)
438 */
439 AM_DEVICE_MODE_FLIGHT: RCTModule.AM_DEVICE_MODE_FLIGHT,
440 /**
441 * Indicates device is driving mode.(3)
442 */
443 AM_DEVICE_MODE_DRIVING: RCTModule.AM_DEVICE_MODE_DRIVING,
444 CLOUD_SEARCH_AM: RCTModule.CLOUD_SEARCH_AM,
445 /**
446 * The key of the MD5 hash of the data.("dataID")
447 */
448 DATAID: RCTModule.DATAID,
449 /**
450 * The key of the picture index.("get_picture_am")<br/>
451 * <b>Value:</b><br/>
452 * <ul>
453 * <li>0 indicates the frog picture.</li>
454 * <li>1 indicates the default picture.</li>
455 * </ul>
456 */
457 GET_PICTURE_AM: RCTModule.GET_PICTURE_AM,
458
459 /**
460 * Indicates get all connected devices.
461 */
462 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
463}
diff --git a/libs/ihealth-sdk/module/BG1Module.js b/libs/ihealth-sdk/module/BG1Module.js
new file mode 100755
index 0000000..ed55f2c
--- /dev/null
+++ b/libs/ihealth-sdk/module/BG1Module.js
@@ -0,0 +1,40 @@
1'use strict';
2
3
4var { NativeModules } = require('react-native');
5
6var RCTModule = NativeModules.BG1Module
7
8/**
9 * @module BG1Module
10 */
11module.exports = {
12 Event_Notify: RCTModule.Event_Notify,
13
14 /**
15 * Send code to bg1 device
16 * @param {string} QRCode the result string of scanning strip bottle(ignore if use GDH strip)
17 * @param {int} stripType 1:GOD 2:GDH
18 * @param {int} measureType 1:Test with Blood 2:Test with control liquid (CTL)
19 */
20 sendCode: function(QRCode, stripType, measureType) {
21 if (RCTModule != null) {
22 RCTModule.sendCode(QRCode, stripType, measureType);
23 }else {
24 console.log('~~~~~ RCTModule is null')
25 }
26 },
27
28 /**
29 * Parse bottle info from QRCode, include strip expire time,strip number,bottle id
30 * @param {string} QRCode
31 */
32 getBottleInfoFromQR: function(QRCode){
33 if (RCTModule != null) {
34 RCTModule.getBottleInfoFromQR(QRCode);
35 }else {
36 console.log('~~~~~ RCTModule is null')
37 }
38 }
39
40}
diff --git a/libs/ihealth-sdk/module/BG1ProfileModule.js b/libs/ihealth-sdk/module/BG1ProfileModule.js
new file mode 100755
index 0000000..02f39dc
--- /dev/null
+++ b/libs/ihealth-sdk/module/BG1ProfileModule.js
@@ -0,0 +1,90 @@
1'use strict';
2
3
4var { NativeModules } = require('react-native');
5
6var RCTModule = NativeModules.BG1ProfileModule
7
8/**
9 * @module BG1ProfileModule
10 */
11module.exports = {
12
13 /**
14 * Callback indicating the send code result of bg1 device.
15 */
16 ACTION_BG1_SENDCODE_RESULT:RCTModule.ACTION_BG1_SENDCODE_RESULT,
17
18 /**
19 * The send code result of bg1 device.
20 * value : 0 success; other error
21 */
22 BG1_SENDCODE_RESULT:RCTModule.BG1_SENDCODE_RESULT,
23
24 /**
25 * Callback indicating the error of Bg1 device.
26 */
27 ACTION_BG1_MEASURE_ERROR:RCTModule.ACTION_BG1_MEASURE_ERROR,
28
29 /**
30 * Flag Error number of Bg1 device.
31 */
32 BG1_MEASURE_ERROR:RCTModule.BG1_MEASURE_ERROR,
33
34 /**
35 * Callback indicating the strip in action.
36 */
37 ACTION_BG1_MEASURE_STRIP_IN:RCTModule.ACTION_BG1_MEASURE_STRIP_IN,
38
39 /**
40 * Callback indicating the get blood action.
41 */
42 ACTION_BG1_MEASURE_GET_BLOOD:RCTModule.ACTION_BG1_MEASURE_GET_BLOOD,
43
44 /**
45 * Callback indicating the measure result.
46 */
47 ACTION_BG1_MEASURE_RESULT:RCTModule.ACTION_BG1_MEASURE_RESULT,
48
49 /**
50 * The measure result
51 * Range : 20-600 mg/dL
52 */
53 BG1_MEASURE_RESULT:RCTModule.BG1_MEASURE_RESULT,
54
55 /**
56 * Callback indicating the strip out action.
57 */
58 ACTION_BG1_MEASURE_STRIP_OUT:RCTModule.ACTION_BG1_MEASURE_STRIP_OUT,
59
60 /**
61 * Callback indicating the Bg1 device get in standby mode.
62 */
63 ACTION_BG1_MEASURE_STANDBY:RCTModule.ACTION_BG1_MEASURE_STANDBY,
64
65 /**
66 * the data id
67 */
68 DATA_ID:RCTModule.DATA_ID,
69
70 /**
71 * Callback indicating the code analysis result.
72 */
73 ACTION_CODE_ANALYSIS:RCTModule.ACTION_CODE_ANALYSIS,
74
75 /**
76 * the strip number
77 */
78 STRIP_NUM_BG:RCTModule.STRIP_NUM_BG,
79
80 /**
81 * the expire time
82 */
83 STRIP_EXPIRETIME_BG:RCTModule.STRIP_EXPIRETIME_BG,
84
85 /**
86 * the bottle id
87 */
88 BOTTLEID_BG:RCTModule.BOTTLEID_BG
89
90}
diff --git a/libs/ihealth-sdk/module/BG1SModule.js b/libs/ihealth-sdk/module/BG1SModule.js
new file mode 100644
index 0000000..e3b922b
--- /dev/null
+++ b/libs/ihealth-sdk/module/BG1SModule.js
@@ -0,0 +1,48 @@
1'use strict';
2
3var {NativeModules} = require('react-native');
4
5var RCTModule = NativeModules.BG1SModule
6
7 /**
8 * @module BG1SModule
9 */
10module.exports = {
11
12 Event_Notify: RCTModule.Event_Notify,
13
14 /**
15 * listen getFunction
16 * @param {string} mac Device's mac address
17 */
18 getFunction: function (mac) {
19 RCTModule.getFunction(mac)
20 },
21
22
23 /**
24 * listen measurement
25 * @param {string} mac Device's mac address
26 */
27 measure: function (mac, measureMode) {
28 RCTModule.measure(mac, measureMode)
29 },
30
31 /**
32 * Disconnect the BG1S
33 * @param mac The mac address for BG1S
34 */
35 disconnect: function (mac) {
36 RCTModule.disconnect(mac)
37 },
38
39 /**
40 * Get all connected BG1S device
41 *
42 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
43 */
44 getAllConnectedDevices: function () {
45 RCTModule.getAllConnectedDevices()
46 }
47}
48
diff --git a/libs/ihealth-sdk/module/BG1SProfileModule.js b/libs/ihealth-sdk/module/BG1SProfileModule.js
new file mode 100644
index 0000000..c950330
--- /dev/null
+++ b/libs/ihealth-sdk/module/BG1SProfileModule.js
@@ -0,0 +1,30 @@
1'use strict';
2
3var { NativeModules } = require('react-native');
4
5var RCTModule = NativeModules.BG1SProfileModule
6
7/**
8 * @module BG1SProfileModule
9 */
10module.exports = {
11 ACTION_GET_DEVICE_INFO: RCTModule.ACTION_GET_DEVICE_INFO,
12 INFO_BATTERY_BG1S: RCTModule.INFO_BATTERY_BG1S,
13 INFO_VERSION_CODE_BLOOD_BG1S: RCTModule.INFO_VERSION_CODE_BLOOD_BG1S,
14 INFO_VERSION_CODE_CTL_BG1S: RCTModule.INFO_VERSION_CODE_CTL_BG1S,
15
16 ACTION_STRIP_INSERTION_STATUS: RCTModule.ACTION_STRIP_INSERTION_STATUS,
17 ACTION_GET_BLOOD: RCTModule.ACTION_GET_BLOOD,
18
19 ACTION_SET_MEASURE_MODE: RCTModule.ACTION_SET_MEASURE_MODE,
20
21 ACTION_MEASURE_RESULT: RCTModule.ACTION_SET_MEASURE_MODE,
22 MEASURE_MODE: RCTModule.MEASURE_MODE,
23 MEASURE_RESULT: RCTModule.MEASURE_RESULT,
24
25 ACTION_ERROR_BG1S: RCTModule.ACTION_ERROR_BG1S,
26 ERROR_NUM_BG1S: RCTModule.ERROR_NUM_BG1S,
27 ERROR_DESCRIPTION_BG1S: RCTModule.ERROR_DESCRIPTION_BG1S,
28
29 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
30}
diff --git a/libs/ihealth-sdk/module/BG5Module.js b/libs/ihealth-sdk/module/BG5Module.js
new file mode 100755
index 0000000..9e1f895
--- /dev/null
+++ b/libs/ihealth-sdk/module/BG5Module.js
@@ -0,0 +1,184 @@
1/**
2 * Created by gaoyuanlong on 16/11/17.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.BG5Module
10
11/**
12 * @module BG5Module
13 */
14module.exports = {
15 Event_Notify: RCTModule.Event_Notify,
16
17 /**
18 * Keep BG5 connecting.
19 * @param {string} mac Device's mac address
20 */
21 holdLink: function (mac){
22 if (RCTModule != null) {
23 RCTModule.holdLink(mac);
24 } else {
25 console.log('~~~~~ BG5 holdLink RCTModule is null')
26 }
27 },
28
29 /**
30 * Get battery level of BG5 device.
31 * @param {string} mac Device's mac address
32 */
33 getBattery: function (mac){
34 if (RCTModule != null) {
35 RCTModule.getBattery(mac);
36 } else {
37 console.log('~~~~~ BG5 getBattery RCTModule is null')
38 }
39 },
40
41 /**
42 * Set time to BG5 device.
43 * @param {string} mac Device's mac address
44 */
45 setTime: function (mac){
46 if (RCTModule != null) {
47 RCTModule.setTime(mac);
48 } else {
49 console.log('~~~~~ BG5 setTime RCTModule is null')
50 }
51 },
52
53 /**
54 * Set unit to BG5 device.
55 * @param {string} mac Device's mac address
56 * @param {number} type 1:mmol/L 2:mg/dL
57 */
58 setUnit: function (mac, type){
59 if (RCTModule != null) {
60 RCTModule.setUnit(mac, type);
61 } else {
62 console.log('~~~~~ BG5 setUnit RCTModule is null')
63 }
64 },
65
66 /**
67 * Start measure with specific measure type.
68 * @param {string} mac Device's mac address
69 * @param {number} type Measure type, 1.Measure with blood measure, 2.Measure with control liquid
70 */
71 startMeasure: function (mac, type){
72 if (RCTModule != null) {
73 RCTModule.startMeasure(mac, type);
74 } else {
75 console.log('~~~~~ BG5 startMeasure RCTModule is null')
76 }
77 },
78
79 /**
80 * Get offline data of BG5 device.
81 * @param {string} mac Device's mac address
82 */
83 getOfflineData: function (mac){
84 if (RCTModule != null) {
85 RCTModule.getOfflineData(mac);
86 } else {
87 console.log('~~~~~ BG5 getOffineData RCTModule is null')
88 }
89 },
90
91 /**
92 * Delete the offline data in BG5 device.
93 * @param {string} mac Device's mac address
94 */
95 deleteOfflineData: function (mac){
96 if (RCTModule != null) {
97 RCTModule.deleteOfflineData(mac);
98 } else {
99 console.log('~~~~~ BG5 deleteOfflineData RCTModule is null')
100 }
101 },
102
103 /**
104 * Set bottle message to BG5 device.
105 * @param {string} mac Device's mac address
106 * @param {number} stripType GOD(value 1) or GDH(value 2)
107 * @param {number} measureType measure with blood(value 1) or measure with control liquid(value 2)
108 * @param {number} QRCode the QR code send to the deivce(GOD strip), GDH ignore
109 * @param {number} stripNum the left count of strip, range [1, 255]
110 * @param {string} overDate the expire time of the strip, format: yyyy-MM-dd, should be valid
111 */
112 setBottleMessage: function (mac, stripType, measureType, QRCode, stripNum, overDate){
113 if (RCTModule != null) {
114 RCTModule.setBottleMessageWithInfo(mac, stripType, measureType, QRCode, stripNum, overDate);
115 } else {
116 console.log('~~~~~ BG5 setBottleMessage RCTModule is null')
117 }
118 },
119
120 /**
121 * Get bottle message from BG5 device.
122 * @param {string} mac Device's mac address
123 */
124 getBottleMessage: function (mac){
125 if (RCTModule != null) {
126 RCTModule.getBottleMessage(mac);
127 } else {
128 console.log('~~~~~ BG5 getBottleMessage RCTModule is null')
129 }
130 },
131
132 /**
133 * Set bottleId to BG5 device.
134 * @param {string} mac Device's mac address
135 * @param {string} ID UserID set to device
136 */
137 setBottleID: function (mac, ID){
138 if (RCTModule != null) {
139 RCTModule.setBottleId(mac, ID);
140 } else {
141 console.log('~~~~~ BG5 setBottleID RCTModule is null')
142 }
143 },
144
145 /**
146 * Get bottleId from BG5 device.
147 * @param {string} mac Device's mac address
148 */
149 getBottleID: function (mac){
150 if (RCTModule != null) {
151 RCTModule.getBottleId(mac);
152 } else {
153 console.log('~~~~~ BG5 getBottleID RCTModule is null')
154 }
155 },
156
157 disConnect: function (mac){
158 if (RCTModule != null) {
159 RCTModule.disConnect(mac);
160 } else {
161 console.log('~~~~~ BG5 getBottleID RCTModule is null')
162 }
163 },
164
165 /**
166 * Parse bottle info from QRCode, include strip expire time,strip number,bottle id
167 * @param {string} QRCode
168 */
169 getBottleInfoFromQR: function(QRCode){
170 if (RCTModule != null) {
171 RCTModule.getBottleInfoFromQR(QRCode);
172 }else {
173 console.log('~~~~~ RCTModule is null')
174 }
175 },
176 /**
177 * Get all connected BG5 device
178 *
179 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
180 */
181 getAllConnectedDevices: function () {
182 RCTModule.getAllConnectedDevices()
183 },
184}
diff --git a/libs/ihealth-sdk/module/BG5SModule.js b/libs/ihealth-sdk/module/BG5SModule.js
new file mode 100644
index 0000000..28ee38d
--- /dev/null
+++ b/libs/ihealth-sdk/module/BG5SModule.js
@@ -0,0 +1,145 @@
1/**
2 * @author chenxuewei
3 */
4'use strict';
5
6
7var { NativeModules, Platform } = require('react-native');
8
9var RCTModule = NativeModules.BG5SModule;
10
11/**
12 * @module BG5SModule
13 */
14module.exports = {
15
16 Event_Notify: RCTModule.Event_Notify,
17
18 /**
19 * Get status information of BG5 device.
20 * @param {string} mac Device's mac address
21 */
22 getStatusInfo: function (mac){
23
24 if (RCTModule != null) {
25 RCTModule.getStatusInfo(mac);
26 } else {
27 console.log('~~~~~ BG5S getStatusInfo RCTModule is null')
28 }
29 },
30
31 /**
32 * Set time to BG5 device.
33 * @param {string} mac Device's mac address
34 */
35 setTime: function (mac, date, timezone){
36 if (RCTModule != null) {
37 RCTModule.setTime(mac, date, timezone);
38 } else {
39 console.log('~~~~~ BG5S setTime RCTModule is null')
40 }
41 },
42
43 /**
44 * Set unit to BG5 device.
45 * @param {string} mac Device's mac address
46 * @param {number} type 1:mmol/L 2:mg/dL
47 */
48 setUnit: function (mac, type){
49 if (RCTModule != null) {
50 RCTModule.setUnit(mac, type);
51 } else {
52 console.log('~~~~~ BG5S setUnit RCTModule is null')
53 }
54 },
55
56 /**
57 * Delete the offline data in BG5 device.
58 * @param {string} mac Device's mac address
59 */
60 deleteUsedStrip: function (mac){
61 if (RCTModule != null) {
62 RCTModule.deleteUsedStrip(mac);
63 } else {
64 console.log('~~~~~ BG5S deleteUsedStrip RCTModule is null')
65 }
66 },
67
68 /**
69 * Delete the offline data in BG5 device.
70 * @param {string} mac Device's mac address
71 */
72 deleteOfflineData: function (mac){
73 if (RCTModule != null) {
74 RCTModule.deleteOfflineData(mac);
75 } else {
76 console.log('~~~~~ BG5S deleteOfflineData RCTModule is null')
77 }
78 },
79
80 /**
81 * Delete the offline data in BG5 device.
82 * @param {string} mac Device's mac address
83 */
84 getOfflineData: function (mac){
85 if (RCTModule != null) {
86 RCTModule.getOfflineData(mac);
87 } else {
88 console.log('~~~~~ BG5S getOfflineData RCTModule is null')
89 }
90 },
91
92 /**
93 * Start measure with specific measure type.
94 * @param {string} mac Device's mac address
95 * @param {number} type Measure type, 1.Measure with blood measure, 2.Measure with control liquid
96 */
97 startMeasure: function (mac, type){
98 if (RCTModule != null) {
99 RCTModule.startMeasure(mac, type);
100 } else {
101 console.log('~~~~~ BG5S startMeasure RCTModule is null')
102 }
103 },
104
105 /**
106 * Get offline data of BG5 device.
107 * @param {string} mac Device's mac address
108 */
109 adjustOfflineData: function (mac, timeString, originData){
110 if (RCTModule != null) {
111 RCTModule.adjustOfflineData(mac, timeString, originData);
112 } else {
113 console.log('~~~~~ BG5S adjustOfflineData RCTModule is null')
114 }
115 },
116
117 setOfflineModel: function (mac, enable) {
118 if (RCTModule != null) {
119 RCTModule.getAllConnectedDevices(mac, enable);
120 } else {
121 console.log('~~~~~ BG5S adjustOfflineData RCTModule is null')
122 }
123 },
124
125 disConnect: function (mac){
126 if (RCTModule != null) {
127 if (Platform.OS === 'ios'){
128 RCTModule.disConnect(mac);
129 } else {
130 RCTModule.disconnect(mac);
131 }
132 } else {
133 console.log('~~~~~ BG5S disConnect RCTModule is null')
134 }
135 },
136
137 /**
138 * Get all connected BG5S device
139 *
140 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
141 */
142 getAllConnectedDevices: function () {
143 RCTModule.getAllConnectedDevices()
144 },
145}
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}
diff --git a/libs/ihealth-sdk/module/BGProfileModule.js b/libs/ihealth-sdk/module/BGProfileModule.js
new file mode 100755
index 0000000..03dacb5
--- /dev/null
+++ b/libs/ihealth-sdk/module/BGProfileModule.js
@@ -0,0 +1,413 @@
1/**
2 * Created by gaoyuanlong on 16/11/16.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.BGProfileModule
10
11/**
12 * @module BGProfileModule
13 */
14module.exports = {
15
16 /**
17 * The action value of event indicating the error of BG device.<br/>
18 * The key and value will be as below:
19 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
20 * <tbody>
21 * <tr><td>Key</td><td>Value</td></tr>
22 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_ERROR_BG BGProfileModule.ACTION_ERROR_BG("action_measure_error")}</td></tr>
23 * <tr><td>{@link module:BGProfileModule.ERROR_NUM_BG BGProfileModule.ERROR_NUM_BG("error_num")}</td><td> The error num</td></tr>
24 * <tr><td>{@link module:BGProfileModule.ERROR_DESCRIPTION_BG BGProfileModule.ERROR_DESCRIPTION_BG("description")}</td><td>Detailed description of the error</td></tr>
25 * </tbody>
26 * </table>
27 * <b>Example:</b><br/>
28 * {"description":"Strip removed in the middle of reading, repeat the test with a new strip.","error_num":9,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_error"}
29 * <br/>
30 */
31 ACTION_ERROR_BG: RCTModule.ACTION_ERROR_BG,
32
33 /**
34 * The action value of event indicating keep link success.<br/>
35 * The key and value will be as below:
36 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
37 * <tbody>
38 * <tr><td>Key</td><td>Value</td></tr>
39 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_KEEP_LINK BGProfileModule.ACTION_KEEP_LINK("action_keep_link")}</td></tr>
40 * </tbody>
41 * </table>
42 * <b>Example:</b><br/>
43 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_keep_link"}<br/>
44 */
45 ACTION_KEEP_LINK: RCTModule.ACTION_KEEP_LINK,
46
47 /**
48 * The action value of event indicating set time success.<br/>
49 * The key and value will be as below:
50 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
51 * <tbody>
52 * <tr><td>Key</td><td>Value</td></tr>
53 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_SET_TIME BGProfileModule.ACTION_SET_TIME("action_set_time")}</td></tr>
54 * </tbody>
55 * </table>
56 * <b>Example:</b><br/>
57 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_time"}<br/>
58 */
59 ACTION_SET_TIME: RCTModule.ACTION_SET_TIME,
60
61 /**
62 * The action value of event indicating set unit success.<br/>
63 * The key and value will be as below:
64 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
65 * <tbody>
66 * <tr><td>Key</td><td>Value</td></tr>
67 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_SET_UNIT BGProfileModule.ACTION_SET_UNIT("action_set_unit")}</td></tr>
68 * </tbody>
69 * </table>
70 * <b>Example:</b><br/>
71 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_unit"}<br/>
72 */
73 ACTION_SET_UNIT: RCTModule.ACTION_SET_UNIT,
74
75 /**
76 * The action value of event indicating the result of get battery command.<br/>
77 * The key and value will be as below:
78 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
79 * <tbody>
80 * <tr><td>Key</td><td>Value</td></tr>
81 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_BATTERY BGProfileModule.ACTION_GET_BATTERY("action_battery_bg")}</td></tr>
82 * <tr><td>{@link module:BGProfileModule.GET_BATTERY BGProfileModule.GET_BATTERY("battery")}</td><td>The battery value.</td></tr>
83 * </tbody>
84 * </table>
85 * <b>Example:</b><br/>
86 * {"mac":"8CDE52B5FAC2","battery":32,"type":"BG5","action":"action_battery_bg"}<br/>
87 */
88 ACTION_GET_BATTERY: RCTModule.ACTION_GET_BATTERY,
89
90 /**
91 * The action value of event indicating start measure success.<br/>
92 * The key and value will be as below:
93 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
94 * <tbody>
95 * <tr><td>Key</td><td>Value</td></tr>
96 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_START_MEASURE BGProfileModule.ACTION_START_MEASURE("action_start_measure")}</td></tr>
97 * </tbody>
98 * </table>
99 * <b>Example:</b><br/>
100 * {mac":"8CDE52B5FAC2","type":"BG5","action":"action_start_measure"}<br/>
101 */
102 ACTION_START_MEASURE: RCTModule.ACTION_START_MEASURE,
103
104 /**
105 * The action value of event indicating the offline data count.<br/>
106 * The key and value will be as below:
107 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
108 * <tbody>
109 * <tr><td>Key</td><td>Value</td></tr>
110 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_OFFLINEDATA_COUNT BGProfileModule.ACTION_GET_OFFLINEDATA_COUNT("action_historicalnum_bg")}</td></tr>
111 * <tr><td>{@link module:BGProfileModule.GET_OFFLINEDATA_COUNT BGProfileModule.GET_OFFLINEDATA_COUNT("count")}</td><td>The offline data count value.</td></tr>
112 * </tbody>
113 * </table>
114 * <b>Example:</b><br/>
115 * {"count":2,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_historicalnum_bg"}
116 * <br/>
117 */
118 ACTION_GET_OFFLINEDATA_COUNT: RCTModule.ACTION_GET_OFFLINEDATA_COUNT,
119
120 /**
121 * The action value of event indicating the result of offline data.<br/>
122 * The key and value will be as below:
123 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
124 * <tbody>
125 * <tr><td>Key</td><td>Value</td></tr>
126 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_OFFLINEDATA BGProfileModule.ACTION_GET_OFFLINEDATA("action_historicaldata_bg")}</td></tr>
127 * <tr><td>{@link module:BGProfileModule.GET_OFFLINEDATA BGProfileModule.GET_OFFLINEDATA("his_data_bg")}</td><td>Get offline data command result</td></tr>
128 * </tbody>
129 * </table>
130 * <b>Example:</b><br/>
131 * {<br/>
132 * {"his_data_bg":{"history":[{"dataID":"1B92511DE36F54508415257160F9D0EA","value":39,"date":"2017-06-08 15:08:00"},
133 * {"dataID":"862D10B79A8560505720B983D658E095","timeProofing":0,"value":38,"date":"2017-06-08 15:09:01"}]},
134 * "mac":"8CDE52B5FAC2","type":"BG5","action":"action_historicaldata_bg"}
135 * <br/>
136 */
137 ACTION_GET_OFFLINEDATA: RCTModule.ACTION_GET_OFFLINEDATA,
138
139 /**
140 * The action value of event indicating delete offline data success.<br/>
141 * The key and value will be as below:
142 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
143 * <tbody>
144 * <tr><td>Key</td><td>Value</td></tr>
145 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_DELETE_OFFLINEDATA BGProfileModule.ACTION_DELETE_OFFLINEDATA("action_delete_historical_data")}</td></tr>
146 * </tbody>
147 * </table>
148 * <b>Example:</b><br/>
149 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_delete_historical_data"}
150 * <br/>
151 */
152 ACTION_DELETE_OFFLINEDATA: RCTModule.ACTION_DELETE_OFFLINEDATA,
153
154 /**
155 * The action value of event indicating the result of set bottle message command.<br/>
156 * The key and value will be as below:
157 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
158 * <tbody>
159 * <tr><td>Key</td><td>Value</td></tr>
160 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_SET_BOTTLEMESSAGE BGProfileModule.ACTION_SET_BOTTLEMESSAGE("action_set_bottle_message_success")}</td></tr>
161 * <tr><td>{@link module:BGProfileModule.SET_BOTTLEMESSAGE BGProfileModule.SET_BOTTLEMESSAGE("set_bottle_message")}</td><td>Set bottle message command result</td></tr>
162 * <tr><td>{@link module:BGProfileModule.START_MODE BGProfileModule.START_MODE("start_mode")}</td><td>The start mode of Bg5 device.</td></tr>
163 * </tbody>
164 * </table>
165 * <b>Example:</b><br/>
166 * {"start_mode":2,"set_bottle_message":true,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_bottle_message_success"}
167 * <br/>
168 */
169 ACTION_SET_BOTTLEMESSAGE: RCTModule.ACTION_SET_BOTTLEMESSAGE,
170
171 /**
172 * The action value of event indicating the result of get bottle message command.<br/>
173 * The key and value will be as below:
174 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
175 * <tbody>
176 * <tr><td>Key</td><td>Value</td></tr>
177 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_BOTTLEMESSAGE BGProfileModule.ACTION_GET_BOTTLEMESSAGE("action_get_codeinfo")}</td></tr>
178 * <tr><td>{@link module:BGProfileModule.GET_EXPIRECTIME BGProfileModule.GET_EXPIRECTIME("expiretime")}</td><td>The strip expire time of Bg5 device.</td></tr>
179 * <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>
180 * </tbody>
181 * </table>
182 * <b>Example:</b><br/>
183 * {"expiretime":"2099-12-16","usenum":0,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_get_codeinfo"}
184 * <br/>
185 */
186 ACTION_GET_BOTTLEMESSAGE: RCTModule.ACTION_GET_BOTTLEMESSAGE,
187
188 /**
189 * The action value of event indicating set bottleID success.<br/>
190 * The key and value will be as below:
191 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
192 * <tbody>
193 * <tr><td>Key</td><td>Value</td></tr>
194 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_SET_BOTTLEID BGProfileModule.ACTION_SET_BOTTLEID("action_setbottleid_success")}</td></tr>
195 * </tbody>
196 * </table>
197 * <b>Example:</b><br/>
198 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_setbottleid_success"}
199 * <br/>
200 */
201 ACTION_SET_BOTTLEID: RCTModule.ACTION_SET_BOTTLEID,
202
203 /**
204 * The action value of event indicating the result of get bottleID command.<br/>
205 * The key and value will be as below:
206 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
207 * <tbody>
208 * <tr><td>Key</td><td>Value</td></tr>
209 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_BOTTLEID BGProfileModule.ACTION_GET_BOTTLEID("action_get_bottleid")}</td></tr>
210 * <tr><td>{@link module:BGProfileModule.GET_BOTTLEID BGProfileModule.GET_BOTTLEID("bottleid")}</td><td>The bottleId of Bg5 device.</td></tr>
211 * </tbody>
212 * </table>
213 * <b>Example:</b><br/>
214 * {"bottleid":926305,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_get_bottleid"}
215 * <br/>
216 */
217 ACTION_GET_BOTTLEID: RCTModule.ACTION_GET_BOTTLEID,
218
219
220 /**
221 * The action value of event indicating the result of strip was put in the devices.<br/>
222 * The key and value will be as below:
223 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
224 * <tbody>
225 * <tr><td>Key</td><td>Value</td></tr>
226 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_STRIP_IN BGProfileModule.ACTION_STRIP_IN("action_measure_strip_in")}</td></tr>
227 * </tbody>
228 * </table>
229 * <b>Example:</b><br/>
230 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_strip_in"}<br/>
231 */
232 ACTION_STRIP_IN: RCTModule.ACTION_STRIP_IN,
233
234 /**
235 * The action value of event indicating the result of strip out of the devices.<br/>
236 * The key and value will be as below:
237 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
238 * <tbody>
239 * <tr><td>Key</td><td>Value</td></tr>
240 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_STRIP_OUT BGProfileModule.ACTION_STRIP_OUT("action_measure_strip_out")}</td></tr>
241 * </tbody>
242 * </table>
243 * <b>Example:</b><br/>
244 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_strip_out"}
245 * <br/>
246 */
247 ACTION_STRIP_OUT: RCTModule.ACTION_STRIP_OUT,
248
249 /**
250 * The action value of event indicating the result of get the blood.<br/>
251 * The key and value will be as below:
252 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
253 * <tbody>
254 * <tr><td>Key</td><td>Value</td></tr>
255 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_GET_BLOOD BGProfileModule.ACTION_GET_BLOOD("action_measure_get_blood")}</td></tr>
256 * </tbody>
257 * </table>
258 * <b>Example:</b><br/>
259 * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_get_blood"}
260 * <br/>
261 */
262 ACTION_GET_BLOOD: RCTModule.ACTION_GET_BLOOD,
263
264 /**
265 * The action value of event indicating the result of get measure value from devices.<br/>
266 * The key and value will be as below:
267 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
268 * <tbody>
269 * <tr><td>Key</td><td>Value</td></tr>
270 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_ONLINE_RESULT_BG BGProfileModule.ACTION_ONLINE_RESULT_BG("action_value_bg")}</td></tr>
271 * <tr><td>{@link module:BGProfileModule.ONLINE_RESULT_BG BGProfileModule.ONLINE_RESULT_BG("result")}</td><td>The bg value measured by device</td></tr>
272 * <tr><td>{@link module:BGProfileModule.DATA_ID BGProfileModule.DATA_ID("dataID")}</td><td>The dataID measured by device</td></tr>
273 * </tbody>
274 * </table>
275 * <b>Example:</b><br/>
276 * {"dataID":"E0A831AE7D2220A6417D4E050EA3FCA1","result":141,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_value_bg"}
277 * <br/>
278 */
279 ACTION_ONLINE_RESULT_BG: RCTModule.ACTION_ONLINE_RESULT_BG,
280
281 /**
282 * The error num means different error.
283 * <p>0:Battery is low.</p>
284 * <p>1:Glucose test result is out of the measurement range.</p>
285 * <p>2:Unknown interference detected, please repeat the test.</p>
286 * <p>3:Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip..</p>
287 * <p>4:Reading transmission error. Repeat the test with a new test strip. If the problem persists, contact iHealth customer service for assistance.</p>
288 * <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>
289 * <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>
290 * <p>7:Test strip coding error.</p>
291 * <p>8:Communication error, press"START" or rescan the code to repeat the test.</p>
292 * <p>9:Strip removed in the middle of reading, repeat the test with a new strip.</p>
293 * <p>10:Insert a new test strip and repeat the test.</p>
294 * <p>11:Cannot write to SN or KEY.</p>
295 * <p>12:Please set time.</p>
296 * <p>13:0 test strips remaining.</p>
297 * <p>14:Test strip expired.</p>
298 * <p>15:Unplug the charging cable before testing.</p>
299 * <p>18:Unplug the charging cable before read the history data</>
300 * <p>19:Charging line is inserted</>
301 * <p>20:Charging line pull out</>
302 * <p>21:The bluetooth module failure</>
303 * <p>100:The device is disconnected (Android doesn't support this code)</>
304 * <p>112:Device don't support to query energy.</p>
305 * <p>400:Parameters out of range.</p>
306 * <p>402:The order of call is wrong.</p>
307 * <p>403:Parameter type is not matched in function call.</p>
308 * <p>404:Function(disConnect) is not supported in iOS platform.(Only available in iOS platform)</p>
309 * <p>405:QRCode format error</p>
310 */
311 ERROR_NUM_BG: RCTModule.ERROR_NUM_BG,
312
313 /**
314 * The error discription.
315 */
316 ERROR_DESCRIPTION_BG: RCTModule.ERROR_DESCRIPTION_BG,
317
318 /**
319 * The battery value.
320 */
321 GET_BATTERY: RCTModule.GET_BATTERY,
322
323 /**
324 * The offline data count value.
325 */
326 GET_OFFLINEDATA_COUNT: RCTModule.GET_OFFLINEDATA_COUNT,
327
328 /**
329 * Get offline data value.
330 */
331 GET_OFFLINEDATA: RCTModule.GET_OFFLINEDATA,
332
333 /**
334 * Set bottle message result value.
335 */
336 SET_BOTTLEMESSAGE: RCTModule.SET_BOTTLEMESSAGE,
337
338 /**
339 * the start mode of Bg5 device.
340 * <li>
341 * value=1, start by insert strip, no need to call <BG5Module.startMeasure>
342 * </li>
343 * <li>
344 * value=2, start by tap the button, need to call <BG5Module.startMeasure>
345 * </li>
346 * </ul>
347 */
348 START_MODE: RCTModule.START_MODE,
349
350 /**
351 * The strip expire time of Bg5 device.
352 */
353 GET_EXPIRECTIME: RCTModule.GET_EXPIRECTIME,
354
355 /**
356 * The strip used num, from offline data by Bg5 device.
357 */
358 GET_USENUM: RCTModule.GET_USENUM,
359
360
361 /**
362 * The bottleId of Bg5 device.
363 */
364 GET_BOTTLEID: RCTModule.GET_BOTTLEID,
365
366 /**
367 * The bg value measured by device
368 */
369 ONLINE_RESULT_BG: RCTModule.ONLINE_RESULT_BG,
370
371 /**
372 * The dataID measured by device
373 */
374 DATA_ID: RCTModule.DATA_ID,
375
376 /**
377 * Callback indicating the code analysis result.
378 * The key and value will be as below:
379 * <table style="width:100px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
380 * <tbody>
381 * <tr><td>Key</td><td>Value</td></tr>
382 * <tr><td>action</td><td>{@link module:BGProfileModule.ACTION_CODE_ANALYSIS BGProfileModule.ACTION_CODE_ANALYSIS("action_code_analysis")}</td></tr>
383 * <tr><td>{@link module:BGProfileModule.STRIP_NUM_BG BGProfileModule.STRIP_NUM_BG("strip_num")}</td><td>The strip number of the QRCode</td></tr>
384 * <tr><td>{@link module:BGProfileModule.STRIP_EXPIRETIME_BG BGProfileModule.STRIP_EXPIRETIME_BG("expire_time")}</td><td>The expire time of the QRCode</td></tr>
385 * <tr><td>{@link module:BGProfileModule.BOTTLEID_BG BGProfileModule.BOTTLEID_BG("bottle_id")}</td><td>The bottle id of the QRCode</td></tr>
386 * </tbody>
387 * </table>
388 * <b>Example:</b><br/>
389 * {"bottle_id":"926305","expire_time":"2017-03-01","strip_num":"25","action":"action_code_analysis"}
390 * <br/>
391 */
392 ACTION_CODE_ANALYSIS:RCTModule.ACTION_CODE_ANALYSIS,
393
394 /**
395 * the strip number
396 */
397 STRIP_NUM_BG:RCTModule.STRIP_NUM_BG,
398
399 /**
400 * the expire time
401 */
402 STRIP_EXPIRETIME_BG:RCTModule.STRIP_EXPIRETIME_BG,
403
404 /**
405 * the bottle id
406 */
407 BOTTLEID_BG:RCTModule.BOTTLEID_BG,
408
409 /**
410 * Indicates get all connected devices.
411 */
412 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
413}
diff --git a/libs/ihealth-sdk/module/BP3LModule.js b/libs/ihealth-sdk/module/BP3LModule.js
new file mode 100755
index 0000000..27bca9a
--- /dev/null
+++ b/libs/ihealth-sdk/module/BP3LModule.js
@@ -0,0 +1,75 @@
1/**
2 * Created by zhangxu on 16/11/14.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.BP3LModule;
10
11/**
12 * @module BP3LModule
13 */
14module.exports = {
15
16 Event_Notify: RCTModule.Event_Notify,
17
18 /**
19 * Start measure blood pressure monitor
20 * @param {string} mac Device's mac address
21 */
22 startMeasure: function (mac) {
23 if (RCTModule != null) {
24 RCTModule.startMeasure(mac);
25 } else {
26 console.log('~~~~~ RCTModule is null')
27 }
28 },
29
30
31 /**
32 * Cancel the measuring process immediately if device is in measuring state.
33 * @param {string} mac Device's mac address
34 */
35 stopMeasure: function (mac) {
36 if (RCTModule != null) {
37 RCTModule.stopMeasure(mac);
38 } else {
39 console.log('~~~~~ RCTModule is null')
40 }
41 },
42
43 /**
44 * Get the BP3L device's battery.
45 * @param {string} mac Device's mac address
46 */
47 getBattery: function (mac) {
48 if (RCTModule != null) {
49 RCTModule.getBattery(mac);
50 } else {
51 console.log('~~~~~ RCTModule is null')
52 }
53 },
54
55 /**
56 * Disconnect the BP3L
57 * @param {string} mac Device's mac address
58 */
59 disconnect: function (mac) {
60 if (RCTModule != null) {
61 RCTModule.disconnect(mac);
62 } else {
63 console.log('~~~~~ RCTModule is null')
64 }
65 },
66
67 /**
68 * Get all connected AM3S device
69 *
70 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
71 */
72 getAllConnectedDevices: function () {
73 RCTModule.getAllConnectedDevices()
74 }
75}
diff --git a/libs/ihealth-sdk/module/BP550BTModule.js b/libs/ihealth-sdk/module/BP550BTModule.js
new file mode 100755
index 0000000..126e245
--- /dev/null
+++ b/libs/ihealth-sdk/module/BP550BTModule.js
@@ -0,0 +1,90 @@
1/**
2 * Created by zhangxu on 16/11/20.
3 */
4'use strict';
5
6
7var { NativeModules } = require('react-native');
8
9var RCTModule = NativeModules.BP550BTModule;
10
11/**
12 * @module BP550BTModule
13 */
14
15module.exports = {
16
17 Event_Notify: RCTModule.Event_Notify,
18
19 /**
20 * Get the BP550BT device's battery.
21 * @param {string} mac Device's mac address
22 */
23 getBattery: function (mac) {
24 if (RCTModule != null) {
25 RCTModule.getBattery(mac);
26 }else {
27 console.log('~~~~~ RCTModule is null')
28 }
29
30 },
31
32 /**
33 * get offline data number.
34 * @param {string} mac Device's mac address
35 */
36 getOffLineNum: function (mac) {
37 if (RCTModule != null) {
38 RCTModule.getOffLineNum(mac);
39 }else {
40 console.log('~~~~~ RCTModule is null')
41 }
42 },
43
44 /**
45 * get offline data number.
46 * @param {string} mac Device's mac address
47 */
48 getOffLineData: function (mac) {
49 if (RCTModule != null) {
50 RCTModule.getOffLineData(mac);
51 }else {
52 console.log('~~~~~ RCTModule is null')
53 }
54 },
55
56 /**
57 * Get the KN-550BT device's functionInfo.
58 * @param {string} mac Device's mac address
59 */
60 getFunctionInfo: function (mac) {
61 if (RCTModule != null) {
62 RCTModule.getFunctionInfo(mac);
63 }else {
64 console.log('~~~~~ RCTModule is null')
65 }
66 },
67
68 /**
69 * Disconnect the KN-550BT
70 *
71 * @param {string} mac Device's mac address
72 */
73 disconnect: function (mac) {
74 if (RCTModule != null) {
75 RCTModule.disconnect(mac);
76 }else {
77 console.log('~~~~~ RCTModule is null')
78 }
79 },
80
81 /**
82 * Get all connected BP550BT device
83 *
84 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
85 */
86 getAllConnectedDevices: function () {
87 RCTModule.getAllConnectedDevices()
88 }
89}
90
diff --git a/libs/ihealth-sdk/module/BP5Module.js b/libs/ihealth-sdk/module/BP5Module.js
new file mode 100755
index 0000000..1dbc7ff
--- /dev/null
+++ b/libs/ihealth-sdk/module/BP5Module.js
@@ -0,0 +1,125 @@
1'use strict';
2
3
4var {NativeModules} = require('react-native');
5
6var RCTModule = NativeModules.BP5Module
7
8/**
9 * @module BP5Module
10 */
11module.exports = {
12
13 Event_Notify: RCTModule.Event_Notify,
14
15 /**
16 * Start measure blood pressure monitor
17 * @param {string} mac Device's mac address
18 */
19
20 startMeasure: function (mac) {
21 RCTModule.startMeasure(mac)
22 },
23
24 /**
25 * Cancel the measuring process immediately if device is in measuring state.
26 * @param {string} mac Device's mac address
27 */
28 stopMeasure: function (mac) {
29 RCTModule.stopMeasure(mac)
30 },
31
32 /**
33 * Get the BP5 device's battery.
34 * @param {string} mac Device's mac address
35 */
36 getBattery: function (mac) {
37 if (RCTModule != null) {
38 RCTModule.getBattery(mac);
39 } else {
40 console.log('~~~~~ RCTModule is null')
41 }
42 },
43
44 /**
45 * Enable device can measure offline .
46 * @param {string} mac Device's mac address
47 */
48 enbleOffline: function (mac) {
49 if (RCTModule != null) {
50 RCTModule.enbleOffline(mac);
51 } else {
52 console.log('~~~~~ RCTModule is null')
53 }
54 },
55
56 /**
57 * Enable device can't measure offline .
58 * @param {string} mac Device's mac address
59 */
60 disableOffline: function (mac) {
61 if (RCTModule != null) {
62 RCTModule.disableOffline(mac);
63 } else {
64 console.log('~~~~~ RCTModule is null')
65 }
66 },
67
68 /**
69 * Enable device can't measure offline.
70 * @param {string} mac Device's mac address
71 */
72 isEnableOffline: function (mac) {
73 if (RCTModule != null) {
74 RCTModule.isEnableOffline(mac);
75 } else {
76 console.log('~~~~~ RCTModule is null')
77 }
78 },
79
80 /**
81 * get offline data number. (iOS not support)
82 * @param {string} mac Device's mac address
83 */
84 getOfflineNum: function (mac) {
85 if (RCTModule != null) {
86 RCTModule.getOfflineNum(mac);
87 } else {
88 console.log('~~~~~ RCTModule is null')
89 }
90 },
91
92 /**
93 * get offline data.
94 * @param {string} mac Device's mac address
95 */
96 getOfflineData: function (mac) {
97 if (RCTModule != null) {
98 RCTModule.getOfflineData(mac);
99 } else {
100 console.log('~~~~~ RCTModule is null')
101 }
102 },
103
104 /**
105 * Disconnect the BP5 (iOS not support)
106 *
107 * @param {string} mac Device's mac address
108 */
109 disconnect: function (mac) {
110 if (RCTModule != null) {
111 RCTModule.disconnect(mac);
112 } else {
113 console.log('~~~~~ RCTModule is null')
114 }
115 },
116
117 /**
118 * Get all connected BP5 device
119 *
120 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
121 */
122 getAllConnectedDevices: function () {
123 RCTModule.getAllConnectedDevices()
124 }
125}
diff --git a/libs/ihealth-sdk/module/BP5SModule.js b/libs/ihealth-sdk/module/BP5SModule.js
new file mode 100755
index 0000000..9c115ea
--- /dev/null
+++ b/libs/ihealth-sdk/module/BP5SModule.js
@@ -0,0 +1,139 @@
1/**
2 * Created by chenxuewei on 04/05/2019.
3 */
4
5'use strict';
6
7
8var { NativeModules, Platform } = require('react-native');
9
10var RCTModule = NativeModules.BP5SModule;
11
12/**
13 * @module BP5SModule
14 */
15
16module.exports = {
17
18 Event_Notify: RCTModule.Event_Notify,
19
20 startMeasure: (mac) => {
21 if (RCTModule != null) {
22 RCTModule.startMeasure(mac);
23 }else {
24 console.log('~~~~~ RCTModule is null')
25 }
26 },
27
28 stopMeasure: (mac) => {
29 if (RCTModule != null) {
30 RCTModule.stopMeasure(mac);
31 }else {
32 console.log('~~~~~ RCTModule is null')
33 }
34
35 },
36
37 deleteData: (mac) => {
38 if (RCTModule != null) {
39 RCTModule.deleteData(mac);
40 }else {
41 console.log('~~~~~ RCTModule is null')
42 }
43 },
44
45 enbleOffline: (mac, mode) => {
46 if (RCTModule != null) {
47 RCTModule.enbleOffline(mac, mode);
48 }else {
49 console.log('~~~~~ RCTModule is null')
50 }
51 },
52
53
54 /**
55 * Get the BP7S device's battery.
56 * @param {string} mac Device's mac address
57 */
58 getBattery: (mac) => {
59 if (RCTModule != null) {
60 RCTModule.getBattery(mac);
61 }else {
62 console.log('~~~~~ RCTModule is null')
63 }
64 },
65
66 /**
67 * get offline data number.
68 * @param {string} mac Device's mac address
69 */
70 getOffLineNum: (mac) => {
71 if (RCTModule != null) {
72 RCTModule.getOffLineNum(mac);
73 }else {
74 console.log('~~~~~ RCTModule is null')
75 }
76 },
77
78 /**
79 * get offline data number.
80 * @param {string} mac Device's mac address
81 */
82 getOffLineData: (mac) => {
83 if (RCTModule != null) {
84 RCTModule.getOffLineData(mac);
85 }else {
86 console.log('~~~~~ RCTModule is null')
87 }
88 },
89
90 /**
91 * Set BP7S device unit.
92 * @param {string} mac Device's mac address
93 * @param {int} unit 0:mmHg,1:kPa
94 */
95 setUnit: (mac, unit) => {
96 if (RCTModule != null) {
97 RCTModule.setUnit(mac, unit);
98 }else {
99 console.log('~~~~~ RCTModule is null')
100 }
101 },
102
103 /**
104 * Get the BP7S device's functionInfo.
105 * @param {string} mac Device's mac address
106 */
107
108 getFunctionInfo: (mac) => {
109 if (RCTModule != null) {
110 RCTModule.getFunctionInfo(mac);
111 }else {
112 console.log('~~~~~ RCTModule is null')
113 }
114 },
115
116
117 /**
118 * Disconnect the BP5S
119 *
120 * @param {string} mac Device's mac address
121 */
122
123 disconnect: (mac) => {
124 if (RCTModule != null) {
125 RCTModule.disconnect(mac);
126 }else {
127 console.log('~~~~~ RCTModule is null')
128 }
129 },
130
131 /**
132 * Get all connected BP5S device
133 *
134 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
135 */
136 getAllConnectedDevices: () => {
137 RCTModule.getAllConnectedDevices()
138 }
139};
diff --git a/libs/ihealth-sdk/module/BP7Module.js b/libs/ihealth-sdk/module/BP7Module.js
new file mode 100755
index 0000000..bfd2852
--- /dev/null
+++ b/libs/ihealth-sdk/module/BP7Module.js
@@ -0,0 +1,149 @@
1'use strict';
2
3
4var { NativeModules } = require('react-native');
5
6var RCTModule = NativeModules.BP7Module;
7
8/**
9 * @module BP7Module
10 */
11
12module.exports = {
13
14 Event_Notify: RCTModule.Event_Notify,
15
16 /**
17 * Get the BP7 device's battery.
18 * @param {string} mac Device's mac address
19 */
20 getBattery: function (mac) {
21 if (RCTModule != null) {
22 RCTModule.getBattery(mac);
23 }else {
24 console.log('~~~~~ RCTModule is null')
25 }
26 },
27
28 /**
29 * Start bp7 measurement.
30 * @param {string} mac Device's mac address
31 * @param {int} unit 0:mmHg,1:kPa
32 */
33 startMeasure: function(mac){
34 if (RCTModule != null) {
35 RCTModule.startMeasure(mac);
36 }else {
37 console.log('~~~~~ RCTModule is null')
38 }
39 },
40
41 /**
42 * Stop bp7 measurement.
43 * @param {string} mac Device's mac address
44 */
45 stopMeasure: function (mac) {
46 if (RCTModule != null) {
47 RCTModule.stopMeasure(mac);
48 }else {
49 console.log('~~~~~ RCTModule is null')
50 }
51 },
52
53 /**
54 * Enable offline measurement mode.
55 * @param {string} mac Device's mac address
56 */
57 enableOfflineMeasurement: function (mac) {
58 if (RCTModule != null) {
59 RCTModule.enableOfflineMeasurement(mac);
60 }else {
61 console.log('~~~~~ RCTModule is null')
62 }
63 },
64
65 /**
66 * Disable offline measurement mode.
67 * @param {string} mac Device's mac address
68 */
69 disableOfflineMeasurement: function (mac) {
70 if (RCTModule != null) {
71 RCTModule.disableOfflineMeasurement(mac);
72 }else {
73 console.log('~~~~~ RCTModule is null')
74 }
75 },
76
77 /**
78 * get the count of offline data.
79 * @param {string} mac Device's mac address
80 */
81 getOfflineNum: function (mac) {
82 if (RCTModule != null) {
83 RCTModule.getOfflineNum(mac);
84 }else {
85 console.log('~~~~~ RCTModule is null')
86 }
87 },
88
89 /**
90 * Get offline data number.
91 * @param {string} mac Device's mac address
92 */
93 getOfflineData: function (mac) {
94 if (RCTModule != null) {
95 RCTModule.getOfflineData(mac);
96 }else {
97 console.log('~~~~~ RCTModule is null')
98 }
99 },
100
101 /**
102 * Check offline measurement mode.
103 * @param {string} mac Device's mac address
104 * @param {int} unit 0:mmHg,1:kPa
105 */
106 isEnableOffline: function(mac, unit){
107 if (RCTModule != null) {
108 RCTModule.isEnableOffline(mac, unit);
109 }else {
110 console.log('~~~~~ RCTModule is null')
111 }
112 },
113
114 /**
115 * Set BP7 device unit.
116 * @param {string} mac Device's mac address
117 * @param {int} unit 0:mmHg,1:kPa
118 */
119 conformAngle: function(mac){
120 if (RCTModule != null) {
121 RCTModule.conformAngle(mac);
122 }else {
123 console.log('~~~~~ RCTModule is null')
124 }
125 },
126
127 /**
128 * Disconnect the BP7
129 *
130 * @param {string} mac Device's mac address
131 */
132
133 disconnect: function (mac) {
134 if (RCTModule != null) {
135 RCTModule.disconnect(mac);
136 }else {
137 console.log('~~~~~ RCTModule is null')
138 }
139 },
140
141 /**
142 * Get all connected BP7 device
143 *
144 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
145 */
146 getAllConnectedDevices: function () {
147 RCTModule.getAllConnectedDevices()
148 }
149};
diff --git a/libs/ihealth-sdk/module/BP7SModule.js b/libs/ihealth-sdk/module/BP7SModule.js
new file mode 100755
index 0000000..e2be830
--- /dev/null
+++ b/libs/ihealth-sdk/module/BP7SModule.js
@@ -0,0 +1,121 @@
1/**
2 * Created by zhangxu on 16/11/20.
3 */
4
5'use strict';
6
7
8var { NativeModules } = require('react-native');
9
10var RCTModule = NativeModules.BP7SModule;
11
12/**
13 * @module BP7SModule
14 */
15
16module.exports = {
17
18 Event_Notify: RCTModule.Event_Notify,
19
20 /**
21 * Get the BP7S device's battery.
22 * @param {string} mac Device's mac address
23 */
24 getBattery: function (mac) {
25 if (RCTModule != null) {
26 RCTModule.getBattery(mac);
27 }else {
28 console.log('~~~~~ RCTModule is null')
29 }
30 },
31
32 /**
33 * get offline data number.
34 * @param {string} mac Device's mac address
35 */
36 getOffLineNum:function (mac) {
37 if (RCTModule != null) {
38 RCTModule.getOffLineNum(mac);
39 }else {
40 console.log('~~~~~ RCTModule is null')
41 }
42 },
43
44 /**
45 * get offline data number.
46 * @param {string} mac Device's mac address
47 */
48 getOffLineData:function (mac) {
49 if (RCTModule != null) {
50 RCTModule.getOffLineData(mac);
51 }else {
52 console.log('~~~~~ RCTModule is null')
53 }
54 },
55
56 /**
57 * Set BP7S device unit.
58 * @param {string} mac Device's mac address
59 * @param {int} unit 0:mmHg,1:kPa
60 */
61 setUnit:function (mac, unit){
62 if (RCTModule != null) {
63 RCTModule.setUnit(mac,unit);
64 }else {
65 console.log('~~~~~ RCTModule is null')
66 }
67 },
68
69 /**
70 * Set BP7S device angle.
71 * @param {string} mac Device's mac address
72 * @param {int} leftUpper the maximum measure angle of left hand, the maximum value must less than 90.
73 * @param {int} leftLows the minimum measure angle of left hand, the minimum value must more than 0, and less than leftUpper.
74 * @param {int} rightUpper the maximum measure angle of right hand, the maximum value must less than 90.
75 * @param {int} rightLow the minimum measure angle of right hand, the minimum value must more than 0, and less than rightUpper.
76 *
77 */
78 angleSet:function (mac, leftUpper, leftLows, rightUpper, rightLow) {
79 if (RCTModule != null) {
80 RCTModule.angleSet(mac,leftUpper,leftLows,rightUpper,rightLow);
81 }else {
82 console.log('~~~~~ RCTModule is null')
83 }
84 },
85
86 /**
87 * Get the BP7S device's functionInfo.
88 * @param {string} mac Device's mac address
89 */
90 getFunctionInfo:function (mac) {
91 if (RCTModule != null) {
92 RCTModule.getFunctionInfo(mac);
93 }else {
94 sconsole.log('~~~~~ RCTModule is null')
95 }
96 },
97
98 /**
99 * Disconnect the BP7S
100 *
101 * @param {string} mac Device's mac address
102 */
103
104 disconnect: function (mac) {
105
106 if (RCTModule != null) {
107 RCTModule.disconnect(mac);
108 }else {
109 console.log('~~~~~ RCTModule is null')
110 }
111 },
112
113 /**
114 * Get all connected BP7S device
115 *
116 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
117 */
118 getAllConnectedDevices: function () {
119 RCTModule.getAllConnectedDevices()
120 }
121};
diff --git a/libs/ihealth-sdk/module/BPProfileModule.js b/libs/ihealth-sdk/module/BPProfileModule.js
new file mode 100755
index 0000000..4cee41a
--- /dev/null
+++ b/libs/ihealth-sdk/module/BPProfileModule.js
@@ -0,0 +1,69 @@
1/**
2 * Created by zhangxu on 16/11/16.
3 */
4'use strict';
5
6
7var { NativeModules } = require('react-native');
8
9var RCTModule = NativeModules.BPProfileModule
10
11/**
12 * @module BPProfileModule
13 */
14module.exports = {
15
16 ACTION_ERROR_BP:RCTModule.ACTION_ERROR_BP,
17 ERROR_NUM_BP:RCTModule.ERROR_NUM_BP,
18 ERROR_DESCRIPTION_BP:RCTModule.ERROR_DESCRIPTION_BP,
19
20 ACTION_BATTERY_BP:RCTModule.ACTION_BATTERY_BP,
21 BATTERY_BP:RCTModule.BATTERY_BP,
22
23 ACTION_ZOREING_BP:RCTModule.ACTION_ZOREING_BP,
24 ACTION_ZOREOVER_BP:RCTModule.ACTION_ZOREOVER_BP,
25 ACTION_ONLINE_PRESSURE_BP:RCTModule.ACTION_ONLINE_PRESSURE_BP,
26 BLOOD_PRESSURE_BP:RCTModule.BLOOD_PRESSURE_BP,
27 ACTION_ONLINE_PULSEWAVE_BP:RCTModule.ACTION_ONLINE_PULSEWAVE_BP,
28 FLAG_HEARTBEAT_BP:RCTModule.FLAG_HEARTBEAT_BP,
29 PULSEWAVE_BP:RCTModule.PULSEWAVE_BP,
30 ACTION_ONLINE_RESULT_BP:RCTModule.ACTION_ONLINE_RESULT_BP,
31 HIGH_BLOOD_PRESSURE_BP:RCTModule.HIGH_BLOOD_PRESSURE_BP,
32 LOW_BLOOD_PRESSURE_BP:RCTModule.LOW_BLOOD_PRESSURE_BP,
33 PULSE_BP:RCTModule.PULSE_BP,
34 MEASUREMENT_AHR_BP:RCTModule.MEASUREMENT_AHR_BP,
35 MEASUREMENT_HSD_BP:RCTModule.MEASUREMENT_HSD_BP,
36 DATAID:RCTModule.DATAID,
37
38 ACTION_HISTORICAL_NUM_BP:RCTModule.ACTION_HISTORICAL_NUM_BP,
39 HISTORICAL_NUM_BP:RCTModule.HISTORICAL_NUM_BP,
40
41 ACTION_HISTORICAL_DATA_BP:RCTModule.ACTION_HISTORICAL_DATA_BP,
42 HISTORICAL_DATA_BP:RCTModule.HISTORICAL_DATA_BP,
43 MEASUREMENT_DATE_BP:RCTModule.MEASUREMENT_DATE_BP,
44 MEASUREMENT_STRAT_ANGLE_BP:RCTModule.MEASUREMENT_STRAT_ANGLE_BP,
45 MEASUREMENT_ANGLE_CHANGE_BP:RCTModule.MEASUREMENT_ANGLE_CHANGE_BP,
46 MEASUREMENT_HAND_BP:RCTModule.MEASUREMENT_HAND_BP,
47 ACTION_HISTORICAL_OVER_BP:RCTModule.ACTION_HISTORICAL_OVER_BP,
48
49 ACTION_FUNCTION_INFORMATION_BP:RCTModule.ACTION_FUNCTION_INFORMATION_BP,
50 FUNCTION_IS_UPAIR_MEASURE:RCTModule.FUNCTION_IS_UPAIR_MEASURE,
51 FUNCTION_IS_ARM_MEASURE:RCTModule.FUNCTION_IS_ARM_MEASURE,
52 FUNCTION_HAVE_ANGLE_SENSOR:RCTModule.FUNCTION_HAVE_ANGLE_SENSOR,
53 FUNCTION_HAVE_OFFLINE:RCTModule.FUNCTION_HAVE_OFFLINE,
54 FUNCTION_HAVE_HSD:RCTModule.FUNCTION_HAVE_HSD,
55 FUNCTION_HAVE_ANGLE_SETTING:RCTModule.FUNCTION_HAVE_ANGLE_SETTING,
56 FUNCTION_IS_MULTI_UPLOAD:RCTModule.FUNCTION_IS_MULTI_UPLOAD,
57 FUNCTION_HAVE_SELF_UPDATE:RCTModule.FUNCTION_HAVE_SELF_UPDATE,
58
59 ACTION_SET_UNIT_SUCCESS_BP:RCTModule.ACTION_SET_UNIT_SUCCESS_BP,
60 ACTION_SET_ANGLE_SUCCESS_BP:RCTModule.ACTION_SET_ANGLE_SUCCESS_BP,
61 ACTION_ENABLE_OFFLINE_BP:RCTModule.ACTION_ENABLE_OFFLINE_BP,
62 ACTION_DISENABLE_OFFLINE_BP:RCTModule.ACTION_DISENABLE_OFFLINE_BP,
63 ACTION_IS_ENABLE_OFFLINE:RCTModule.ACTION_IS_ENABLE_OFFLINE,
64
65 IS_ENABLE_OFFLINE:RCTModule.IS_ENABLE_OFFLINE,
66
67 ACTION_INTERRUPTED_BP:RCTModule.ACTION_INTERRUPTED_BP,
68 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
69}
diff --git a/libs/ihealth-sdk/module/BTMModule.js b/libs/ihealth-sdk/module/BTMModule.js
new file mode 100755
index 0000000..d7601d5
--- /dev/null
+++ b/libs/ihealth-sdk/module/BTMModule.js
@@ -0,0 +1,88 @@
1/**
2 * Created by lixuesong on 11/11/2016.
3 */
4'use strict';
5
6var {NativeModules} = require('react-native');
7
8var RCTModule = NativeModules.BTMModule
9
10 /**
11 * @module BTMModule
12 */
13module.exports = {
14
15 Event_Notify: RCTModule.Event_Notify,
16
17 /**
18 * Get the BTM battery status.
19 * @param {string} mac Device's mac address
20 */
21 getBattery: function (mac) {
22 RCTModule.getBattery(mac)
23 },
24
25 /**
26 * Get the value of historical data in the BTM.
27 * @param {string} mac Device's mac address
28 */
29 getMemoryData: function (mac) {
30 RCTModule.getMemoryData(mac)
31 },
32
33 /**
34 * Set the standby time
35 * @param {string} mac Device's mac address
36 * @param {number} hour Standby time hours [0, 23]
37 * @param {number} minute Standby time minute [0, 59]
38 * @param {number} second Standby time second [0, 59]
39 */
40 setStandbyTime: function (mac, hour, minute, second) {
41 RCTModule.setStandbyTime(mac, hour, minute, second)
42 },
43
44 /**
45 * Set the temperature unit
46 * @param {string} mac Device's mac address
47 * @param {number} unit temperature unit<br/>
48 * <b>The unit of:</b> BtmControl.TEMPERATURE_UNIT_C or BtmControl.TEMPERATURE_UNIT_F
49 */
50 setTemperatureUnit: function (mac, unit) {
51 RCTModule.setTemperatureUnit(mac, unit)
52 },
53
54 /**
55 * Set the measuring target
56 * @param {string} mac Device's mac address
57 * @param {number} measuring target
58 */
59 setMeasuringTarget: function (mac, target) {
60 RCTModule.setMeasuringTarget(mac, target)
61 },
62
63 /**
64 * Set the offline target
65 * @param {string} mac Device's mac address
66 * @param {number} measuring target
67 */
68 setOfflineTarget: function (mac, target) {
69 RCTModule.setOfflineTarget(mac, target)
70 },
71
72 /**
73 * Disconnect the BTM
74 * @param mac The mac address for BTM
75 */
76 disconnect: function (mac) {
77 RCTModule.disconnect(mac)
78 },
79
80 /**
81 * Get all connected BTM device
82 *
83 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
84 */
85 getAllConnectedDevices: function () {
86 RCTModule.getAllConnectedDevices()
87 }
88}
diff --git a/libs/ihealth-sdk/module/BTMProfileModule.js b/libs/ihealth-sdk/module/BTMProfileModule.js
new file mode 100755
index 0000000..5d88dc6
--- /dev/null
+++ b/libs/ihealth-sdk/module/BTMProfileModule.js
@@ -0,0 +1,33 @@
1/**
2 * Created by lixuesong on 15/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.BTMProfileModule
10
11/**
12 * @module BTMProfileModule
13 */
14module.exports = {
15
16 ACTION_BTM_BATTERY: RCTModule.ACTION_BTM_BATTERY,
17 ACTION_BTM_MEMORY: RCTModule.ACTION_BTM_MEMORY,
18 ACTION_BTM_MEASURE: RCTModule.ACTION_BTM_MEASURE,
19 ACTION_BTM_CALLBACK: RCTModule.ACTION_BTM_CALLBACK,
20 ACTION_ERROR_BTM: RCTModule.ACTION_ERROR_BTM,
21
22 //Keys
23 BTM_BATTERY: RCTModule.BTM_BATTERY,
24 MEMORY_COUNT: RCTModule.MEMORY_COUNT,
25 BTM_TEMPERATURE_ARRAY: RCTModule.BTM_TEMPERATURE_ARRAY,
26 BTM_TEMPERATURE_TARGET: RCTModule.BTM_TEMPERATURE_TARGET,
27 BTM_TEMPERATURE: RCTModule.BTM_TEMPERATURE,
28 BTM_MEASURE_TIME: RCTModule.BTM_MEASURE_TIME,
29 ERROR_NUM_BTM: RCTModule.ERROR_NUM_BTM,
30 ERROR_DESCRIPTION_BTM: RCTModule.ERROR_DESCRIPTION_BTM,
31
32 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
33}
diff --git a/libs/ihealth-sdk/module/ECGModule.js b/libs/ihealth-sdk/module/ECGModule.js
new file mode 100755
index 0000000..439dd99
--- /dev/null
+++ b/libs/ihealth-sdk/module/ECGModule.js
@@ -0,0 +1,60 @@
1/**
2 *
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.ECGModule;
10
11/**
12 * @module ECGModule
13 */
14module.exports = {
15
16 Event_Notify: RCTModule.Event_Notify,
17
18 /**
19 * SyncTime.
20 */
21 sysTime: function (mac) {
22 RCTModule.sysTime(mac)
23 },
24
25 /**
26 * startMeasure
27 */
28 startMeasure: function (mac) {
29 RCTModule.startMeasure(mac)
30 },
31 /**
32 * getBattery
33 * @param {string} serialNumber the mac address of scale
34 */
35 getBattery: function (mac) {
36 RCTModule.getBattery(mac)
37 },
38 /**
39 * stopMeasure
40 */
41 stopMeasure: function (mac) {
42 RCTModule.stopMeasure(mac)
43 },
44 /**
45 * Get all connected ECG device
46 *
47 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
48 */
49
50 getAllConnectedDevices: function () {
51 RCTModule.getAllConnectedDevices()
52 },
53 /**
54 * Disconnect the ECG3
55 * @param mac The mac address
56 */
57 disconnect: function (mac) {
58 RCTModule.disconnect(mac)
59 }
60}
diff --git a/libs/ihealth-sdk/module/ECGProfileModule.js b/libs/ihealth-sdk/module/ECGProfileModule.js
new file mode 100755
index 0000000..4377e9c
--- /dev/null
+++ b/libs/ihealth-sdk/module/ECGProfileModule.js
@@ -0,0 +1,208 @@
1/**
2 *
3 */
4'use strict';
5
6
7var { NativeModules } = require('react-native');
8
9var RCTModule = NativeModules.ECGProfileModule;
10
11/**
12 * @module ECGProfileModule
13 */
14module.exports = {
15
16 /**
17 * The action value of event indicates the error of ECG device.
18 */
19 ACTION_ERROR_ECG:RCTModule.ACTION_ERROR_ECG,
20
21 /**
22 * The Key of error number of ECG device.
23 */
24 ERROR_NUM_ECG:RCTModule.ERROR_NUM_ECG,
25
26 /**
27 * The Key of error description of ECG device.
28 */
29 ERROR_DESCRIPTION_ECG:RCTModule.ERROR_DESCRIPTION_ECG,
30
31 /**
32 * The action value of event indicates the battery of ECG device.
33 */
34 ACTION_BATTERY_ECG:RCTModule.ACTION_BATTERY_ECG,
35
36 /**
37 * The Key of BATTERY_ECG for ECG device.
38 */
39 BATTERY_ECG:RCTModule.BATTERY_ECG,
40
41 /**
42 * sync time.
43 */
44 ACTION_SYSTIME:RCTModule.ACTION_SYSTIME,
45
46 /**
47 * Stop Measure.
48 */
49 ACTION_STOPMEASURE_ECG:RCTModule.ACTION_STOPMEASURE_ECG,
50
51 /**
52 * ACTION_MEASURE_WAVEData. <br>
53 *
54 * examples:<br/>
55 * {"MEASURE_WAVEData":[-2.2548201084136963,-2.531399965286255,-2.8357763290405273,-3.1377346515655518,-3.4188733100891113,-3.680877685546875],"mac":"FC86F8390F66","type":"ECG3","action":"ACTION_MEASURE_WAVEData"}<br/>
56 */
57 ACTION_MEASURE_WAVEData:RCTModule.ACTION_MEASURE_WAVEData,
58
59 MEASURE_WAVEData:RCTModule.MEASURE_WAVEData,
60 /**
61 * ACTION_MEASURE_ECGPulse. <br>
62 * <b>Value range:</b><br/><br/>
63 * examples:<br/>
64 * {"MEASURE_ECGPulse":0,"action":"ACTION_MEASURE_ECGPulse","mac":"FC86F8390F66","type":"ECG3"}</b>
65 */
66 ACTION_MEASURE_ECGPulse:RCTModule.ACTION_MEASURE_ECGPulse,
67
68 MEASURE_ECGPulse:RCTModule.MEASURE_ECGPulse,
69 /**
70 * ACTION_STARTSYNCDATA_ECGUSB. <br>
71 * <b>Value range:</b><br/><br/>
72 * <b>true: sufficiently</b><br/>
73 * <b>false: insufficiently</b>
74 */
75 ACTION_STARTSYNCDATA_ECGUSB:RCTModule.ACTION_STARTSYNCDATA_ECGUSB,
76 /**
77 * ACTION_SYNCDATAINFO_ECGUSB. <br>
78 * <b>Value range:</b><br/><br/>
79 * <b>true: sufficiently</b><br/>
80 * <b>false: insufficiently</b>
81 */
82 ACTION_SYNCDATAINFO_ECGUSB:RCTModule.ACTION_SYNCDATAINFO_ECGUSB,
83 /**
84 * DATAINFO. <br>
85 * <b>Value range:</b><br/><br/>
86 * <b>true: sufficiently</b><br/>
87 * <b>false: insufficiently</b>
88 */
89 DATAINFO:RCTModule.DATAINFO,
90 /**
91 * ACTION_SYNCDATAPROGRESS_ECGUSB. <br>
92 * <b>Value range:</b><br/><br/>
93 * <b>true: sufficiently</b><br/>
94 * <b>false: insufficiently</b>
95 */
96 ACTION_SYNCDATAPROGRESS_ECGUSB:RCTModule.ACTION_SYNCDATAPROGRESS_ECGUSB,
97 /**
98 * PROGRESS. <br>
99 * <b>Value range:</b><br/><br/>
100 * <b>true: sufficiently</b><br/>
101 * <b>false: insufficiently</b>
102 */
103 PROGRESS:RCTModule.PROGRESS,
104 /**
105 * ACTION_DELETEDATA_ECGUSB. <br>
106 * <b>Value range:</b><br/><br/>
107 * <b>true: sufficiently</b><br/>
108 * <b>false: insufficiently</b>
109 */
110 ACTION_DELETEDATA_ECGUSB:RCTModule.ACTION_DELETEDATA_ECGUSB,
111 /**
112 * Indicates get all connected devices.
113 */
114 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES,
115 /**
116 * ECGUSB error action.
117 */
118 ACTION_ERROR_ECGUSB:RCTModule.ACTION_ERROR_ECGUSB,
119 /**
120 * ECGUSB error number.
121 *
122 * <b>Value range:</b><br/>
123 *
124 * <p>0:Query command timeout</p>
125 * <p>1:Received SD card info is wrong.</p>
126 * <p>2:Receive devce's error log: SD card error.</p>
127 * <p>3:There is not enough space for ECG's offline data.</p>
128 * <p>4:Receive wrong data.</p>
129 * <p>5:Receive wrong data.</p>
130 * <p>6:Receive data timeout.</p>
131 * <p>7:Save file error.</p>
132 * <p>8:Device is disconnected.</p>
133 * <p>9:Format fail.</p>
134 * <p>13:Format command timeout.</p>
135 * <p>500:Command timeout.</p>
136 */
137 ERROR_NUM_ECGUSB:RCTModule.ERROR_NUM_ECGUSB,
138 /**
139 * ECGUSB error description.
140 *
141 * <b>Value range:</b><br/>
142 *
143 * <p>0:Query command timeout</p>
144 * <p>1:Received SD card info is wrong.</p>
145 * <p>2:Receive devce's error log: SD card error.</p>
146 * <p>3:There is not enough space for ECG's offline data.</p>
147 * <p>4:Receive wrong data.</p>
148 * <p>5:Receive wrong data.</p>
149 * <p>6:Receive data timeout.</p>
150 * <p>7:Save file error.</p>
151 * <p>8:Device is disconnected.</p>
152 * <p>9:Format fail.</p>
153 * <p>10:Splicing files fail.</p>
154 * <p>11:get ECG data from cache fail.</p>
155 * <p>12:get filter files fail by filename.</p>
156 * <p>500:Command timeout.</p>
157 */
158
159 ERROR_DESCRIPTION_ECGUSB:RCTModule.ERROR_DESCRIPTION_ECGUSB,
160 /**
161 * Splice action.
162 */
163 ACTION_SPLICE:RCTModule.ACTION_SPLICE,
164 /**
165 * The key of splice result.
166 */
167 SPLICE_DATA:RCTModule.SPLICE_DATA,
168 /**
169 * The key of splice error description.
170 */
171 SPLICE_ERROR_DESCRIPTION:RCTModule.SPLICE_ERROR_DESCRIPTION,
172 /**
173 * Electrode status action.
174 */
175 ACTION_ELECTRODE_STATUS:RCTModule.ACTION_ELECTRODE_STATUS,
176 /**
177 * Electrode status. In fact, 2 and 3 will not send. Receive ACTION_MEASURE_WAVEData again means Electrode loss recovery. <br/>
178 *
179 * <b>Value range:</b><br/>
180 * <p>1:Electrode Loss.</p>
181 * <p>2:Electrode Loss Recovery.</p>
182 * <p>3:Electrode Loss Timeout.</p>
183 */
184 ELECTRODE_STATUS:RCTModule.ELECTRODE_STATUS,
185 /**
186 * Get cache.
187 * If app crashes during syncData, there may be some data not return to your callback (ACTION_SYNCDATAINFO_ECGUSB). Then you can call this api to get the unreturned data.
188 */
189 ACTION_GET_CACHE:RCTModule.ACTION_GET_CACHE,
190 /**
191 * The key of getCache result.
192 */
193 GET_CACHE_DATA:RCTModule.GET_CACHE_DATA,
194 /**
195 * Filter.
196 * To analyze the SPLICE_DATA returned by synthesize api.
197 */
198 ACTION_FILTER:RCTModule.ACTION_FILTER,
199 /**
200 * The key of filter result.
201 */
202 FILTER_DATA:RCTModule.FILTER_DATA,
203 /**
204 * The key of filter error description. only for iOS
205 */
206 FILTER_ERROR_DESCRIPTION:RCTModule.FILTER_ERROR_DESCRIPTION
207
208}
diff --git a/libs/ihealth-sdk/module/ECGUSBModule.js b/libs/ihealth-sdk/module/ECGUSBModule.js
new file mode 100755
index 0000000..29e3a17
--- /dev/null
+++ b/libs/ihealth-sdk/module/ECGUSBModule.js
@@ -0,0 +1,119 @@
1/**
2 *
3 */
4'use strict';
5
6var { NativeModules, Platform } = require('react-native');
7
8var RCTModule = NativeModules.ECGUSBModule
9
10/**
11 * @module ECGUSBModule
12 */
13module.exports = {
14 /**
15 * Notify event type for ECG
16 */
17 Event_Notify: RCTModule.Event_Notify,
18
19 /**
20 * SyncTime.
21 */
22 syncData: function () {
23 RCTModule.syncData()
24 },
25
26 /**
27 * deleteData.
28 */
29 deleteData: function () {
30 RCTModule.deleteData()
31 },
32
33 /**
34 * Get all connected ECG device
35 *
36 * e.g. {"devices":"A4D5783FB00C"}
37 */
38 getAllConnectedDevices: function () {
39 RCTModule.getAllConnectedDevices()
40 },
41
42 /**
43 * Get device idps info (only for android)
44 *
45 * e.g. {"firmwareversion":"1.2.6","serialnumber":"F26265594E00","modenumber":"ECG3 11070","hardwareversion":"3.1.0","manufacture":"iHealth","accessoryname":"ECG recorder","protocolstring":"com.jiuan.ECGV10"}
46 */
47 getIdps: function () {
48 RCTModule.getIdps()
49 },
50
51 /**
52 * Splicing original files
53 *
54 * You can add a listener for ECGProfileModule.ACTION_SPLICE;
55 *
56 * success example:
57 *
58 * {"action":ECGProfileModule.ACTION_SPLICE,ECGProfileModule.SPLICE_DATA:{"DataFileName":"ECG_Total_Data_yyyyMMddHHmmss.dat","MarkFileName":"ECG_Total_Mark_yyyyMMddHHmmss.txt","StartTime":"yyyyMMddHHmmss","EndTime":"yyyyMMddHHmmss","FilePath":"xxx"},"type":"ECG3USB","mac":"F26265594E00"}
59 *
60 * fail example:
61 *
62 * {"action":ECGProfileModule.ACTION_SPLICE,ECGProfileModule.SPLICE_ERROR_DESCRIPTION:"fileNames's length is less than 1.","type":"ECG3USB","mac":""}
63 *
64 *
65 */
66 spliceData: function (filesNames){
67 RCTModule.spliceData(filesNames)
68 },
69
70
71 /**
72 * Get cache
73 *
74 * You can add a listener for ECGProfileModule.ACTION_GET_CACHE;
75 *
76 * result example:
77 *
78 * {"action":ECGProfileModule.ACTION_GET_CACHE,ECGProfileModule.GET_CACHE_DATA:[see ECGProfileModule.DATAINFO],"type":"ECG3USB","mac":"F26265594E00"}
79 *
80 */
81 getCache: function () {
82 RCTModule.getCache()
83 },
84
85 /**
86 * Delete cache files
87 * only android
88 * if you get the cache files of ECG, you should clear the cache files
89 */
90 deleteCacheData: function (){
91 if (Platform.OS === 'ios'){
92 console.log('deleteCacheData is not available in iOS.')
93 } else {
94 RCTModule.deleteCacheData()
95 }
96 },
97
98 /**
99 * get ECG filter files by filename
100 *
101 * you can edit "ECG_Data_20180930123000" and "ECG_Mark_20180930123000"
102 * or can edit "ECG_Total_Data_20180930123000" and "ECG_Mark_Data_20180930123000"
103 *
104 * You can add a listener for ECGProfileModule.ACTION_FILTER;
105 *
106 * success example:
107 *
108 * {"action":ECGProfileModule.ACTION_FILTER,ECGProfileModule.FILTER_DATA:[{"SampleRate":249.999999,"FileName":"ECG_SDK_yyyyMMddHHmmss","StartTime":"yyyyMMddHHmmss","EndTime":"yyyyMMddHHmmss","FilePath":"xxx"}],"type":"ECG3USB","mac":"F26265594E00"}
109 *
110 * fail example:
111 *
112 * {"action":ECGProfileModule.ACTION_FILTER,ECGProfileModule.FILTER_ERROR_DESCRIPTION:"input parameter is invalid.","type":"ECG3USB","mac":"F26265594E00"}
113 *
114 *
115 */
116 getFilterDataByFileName: function (dataFileName ,markFileName){
117 RCTModule.getFilterDataByFileName(dataFileName,markFileName)
118 }
119}
diff --git a/libs/ihealth-sdk/module/HS2Module.js b/libs/ihealth-sdk/module/HS2Module.js
new file mode 100755
index 0000000..5430b20
--- /dev/null
+++ b/libs/ihealth-sdk/module/HS2Module.js
@@ -0,0 +1,63 @@
1/**
2 * Created by lixuesong on 11/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.HS2Module
10
11/**
12 * @module hs2Module
13 */
14module.exports = {
15 /**
16 * Notify event type for hs2
17 */
18 Event_Notify: RCTModule.Event_Notify,
19
20 /**
21 * Start real-time measurement.
22 * @param {string} mac Device's mac address
23 * @param {string} unit Device's unit
24 * @param {string} userId user id
25 */
26 measureOnline: function (mac, unit, userId) {
27 RCTModule.measureOnline(mac, unit, userId)
28 },
29
30 /**
31 * Get the value of historical data in the hs2.
32 * @param {string} mac Device's mac address
33 */
34 getOfflineData: function (mac) {
35 RCTModule.getOfflineData(mac)
36 },
37
38 /**
39 * Disconnect the HS2
40 * @param mac The mac address for blood pressure monitor
41 */
42 disconnect: function (mac) {
43 RCTModule.disconnect(mac)
44 },
45
46 /**
47 * Get all connected hs2 device
48 *
49 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
50 */
51 getAllConnectedDevices: function () {
52 RCTModule.getAllConnectedDevices()
53 },
54
55 /**
56 * Get all connected hs2 device
57 *
58 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
59 */
60 getBattery: function (mac) {
61 RCTModule.getBattery(mac)
62 }
63}
diff --git a/libs/ihealth-sdk/module/HS2SModule.js b/libs/ihealth-sdk/module/HS2SModule.js
new file mode 100755
index 0000000..8c8b6e5
--- /dev/null
+++ b/libs/ihealth-sdk/module/HS2SModule.js
@@ -0,0 +1,110 @@
1'use strict';
2
3
4var {NativeModules} = require('react-native');
5
6var RCTModule = NativeModules.HS2SModule
7
8/**
9 * @module hs2sModule
10 */
11module.exports = {
12 /**
13 * Notify event type for hs2s
14 */
15 Event_Notify: RCTModule.Event_Notify,
16
17
18 getDeviceInfo: function (mac) {
19 RCTModule.getDeviceInfo(mac)
20 },
21 /**
22 * Get hs2s device battary
23 *
24 */
25 getBattery: function (mac) {
26 RCTModule.getBattery(mac)
27 },
28
29 setUnit: function (mac,unit) {
30 RCTModule.setUnit(mac,unit)
31 },
32 getUserInfo: function (mac) {
33 RCTModule.getUserInfo(mac)
34 },
35 updateUserInfo: function (mac,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark) {
36 RCTModule.updateUserInfo(mac,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark);
37 },
38
39 deleteUser: function (mac,userID) {
40 RCTModule.deleteUser(mac,userID);
41 },
42
43 getMemoryDataCount: function (mac,userID) {
44 RCTModule.getMemoryDataCount(mac,userID);
45 },
46
47 getMemoryData: function (mac,userID) {
48 RCTModule.getMemoryData(mac,userID);
49 },
50
51 deleteMemoryData: function (mac,userID) {
52 RCTModule.deleteMemoryData(mac,userID);
53 },
54
55 getAnonymousMemoryDataCount: function (mac) {
56 RCTModule.getAnonymousMemoryDataCount(mac);
57 },
58
59 getAnonymousMemoryData: function (mac) {
60 RCTModule.getAnonymousMemoryData(mac);
61 },
62
63 deleteAnonymousMemoryData: function (mac) {
64 RCTModule.deleteAnonymousMemoryData(mac)
65 },
66
67 measure: function (mac,userType,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark) {
68 RCTModule.measure(mac,userType,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark)
69 },
70
71 resetDevice: function (mac) {
72 RCTModule.resetDevice(mac)
73 },
74
75 broadCastTypeDevice: function (mac) {
76 RCTModule.broadCastTypeDevice(mac)
77 },
78
79 setDeviceLightUp: function (mac) {
80 RCTModule.setDeviceLightUp(mac)
81 },
82
83 enterHS2SHeartRateMeasurementMode: function (mac) {
84 RCTModule.enterHS2SHeartRateMeasurementMode(mac)
85 },
86
87 exitHS2SHeartRateMeasurementMode: function (mac) {
88 RCTModule.exitHS2SHeartRateMeasurementMode(mac)
89 },
90
91
92 /**
93 * Disconnect the HS2S
94 * @param mac The mac address for blood pressure monitor
95 */
96 disconnect: function (mac) {
97 RCTModule.disconnect(mac)
98 },
99
100 /**
101 * Get all connected hs2s device
102 *
103 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
104 */
105 getAllConnectedDevices: function () {
106 RCTModule.getAllConnectedDevices()
107 }
108
109
110}
diff --git a/libs/ihealth-sdk/module/HS2SProfileModule.js b/libs/ihealth-sdk/module/HS2SProfileModule.js
new file mode 100644
index 0000000..7c0368b
--- /dev/null
+++ b/libs/ihealth-sdk/module/HS2SProfileModule.js
@@ -0,0 +1,103 @@
1'use strict';
2
3var {NativeModules} = require('react-native');
4
5var RCTModule = NativeModules.HS2SProfileModule
6
7/**
8 * @module HS2SProfileModule
9 */
10module.exports = {
11
12 ACTION_ERROR_HS: RCTModule.ACTION_ERROR_HS,
13 ERROR_NUM_HS: RCTModule.ERROR_NUM_HS,
14 ERROR_DESCRIPTION_HS: RCTModule.ERROR_DESCRIPTION_HS,
15
16 ACTION_GET_DEVICE_INFO: RCTModule.ACTION_GET_DEVICE_INFO,
17 HS_USER_COUNT: RCTModule.HS_USER_COUNT,
18 HS_UNIT_CURRENT: RCTModule.HS_UNIT_CURRENT,
19
20 ACTION_BATTERY_HS: RCTModule.ACTION_BATTERY_HS,
21 BATTERY_HS: RCTModule.BATTERY_HS,
22
23 ACTION_SET_UNIT_SUCCESS: RCTModule.ACTION_SET_UNIT_SUCCESS,
24
25 ACTION_GET_USER_INFO: RCTModule.ACTION_GET_USER_INFO,
26 USER_INFO_COUNT: RCTModule.USER_INFO_COUNT,
27 USER_INFO_ARRAY: RCTModule.USER_INFO_ARRAY,
28 USER_INFO_USER_ID: RCTModule.USER_INFO_USER_ID,
29 USER_INFO_CREATE_TIME: RCTModule.USER_INFO_CREATE_TIME,
30 USER_INFO_WEIGHT: RCTModule.USER_INFO_WEIGHT,
31 USER_INFO_GENDER: RCTModule.USER_INFO_GENDER,
32 USER_INFO_AGE: RCTModule.USER_INFO_AGE,
33 USER_INFO_HEIGHT: RCTModule.USER_INFO_HEIGHT,
34 USER_INFO_IMPEDANCE: RCTModule.USER_INFO_IMPEDANCE,
35 USER_INFO_BODYBUILDING: RCTModule.USER_INFO_BODYBUILDING,
36
37 ACTION_CREATE_OR_UPDATE_USER_INFO: RCTModule.ACTION_CREATE_OR_UPDATE_USER_INFO,
38 OPERATION_STATUS: RCTModule.OPERATION_STATUS,
39 OPERATION_DESCRIBE: RCTModule.OPERATION_DESCRIBE,
40
41 ACTION_DELETE_USER_INFO: RCTModule.ACTION_DELETE_USER_INFO,
42
43 ACTION_SPECIFY_USERS: RCTModule.ACTION_SPECIFY_USERS,
44
45 ACTION_MEASURE_FINISH_AT_CRITICAL: RCTModule.ACTION_MEASURE_FINISH_AT_CRITICAL,
46
47 ACTION_HISTORY_DATA_NUM: RCTModule.ACTION_HISTORY_DATA_NUM,
48 HISTORY_DATA_USER_COUNT: RCTModule.HISTORY_DATA_USER_COUNT,
49 HISTORY_DATA_COUNT_ARRAY: RCTModule.HISTORY_DATA_COUNT_ARRAY,
50 HISTORY_DATA_COUNT: RCTModule.HISTORY_DATA_COUNT,
51
52 ACTION_HISTORY_DATA: RCTModule.ACTION_HISTORY_DATA,
53 DATA_ID: RCTModule.DATA_ID,
54 DATA_WEIGHT: RCTModule.DATA_WEIGHT,
55 DATA_IMPEDANCE: RCTModule.DATA_IMPEDANCE,
56 DATA_USER_NUM: RCTModule.DATA_USER_NUM,
57 DATA_GENDER: RCTModule.DATA_GENDER,
58 DATA_AGE: RCTModule.DATA_AGE,
59 DATA_HEIGHT: RCTModule.DATA_HEIGHT,
60 DATA_MEASURE_TIME: RCTModule.DATA_MEASURE_TIME,
61 DATA_RIGHT_TIME: RCTModule.DATA_RIGHT_TIME,
62 DATA_BODYBUILDING: RCTModule.DATA_BODYBUILDING,
63 DATA_INSTRUCTION_TYPE: RCTModule.DATA_INSTRUCTION_TYPE,
64 DATA_BODY_FIT_PERCENTAGE: RCTModule.DATA_BODY_FIT_PERCENTAGE,
65 DATA_MUSCLE_MASS: RCTModule.DATA_MUSCLE_MASS,
66 DATA_BONE_SALT_CONTENT: RCTModule.DATA_BONE_SALT_CONTENT,
67 DATA_BODY_WATER_RATE: RCTModule.DATA_BODY_WATER_RATE,
68 DATA_PROTEIN_RATE: RCTModule.DATA_PROTEIN_RATE,
69 DATA_SKELETAL_MUSCLE_MASS: RCTModule.DATA_SKELETAL_MUSCLE_MASS,
70 DATA_BASAL_METABOLIC_RATE: RCTModule.DATA_BASAL_METABOLIC_RATE,
71 DATA_VISCERAL_FAT_GRADE: RCTModule.DATA_VISCERAL_FAT_GRADE,
72 DATA_PHYSICAL_AGE: RCTModule.DATA_PHYSICAL_AGE,
73 DATA_BODY_MASS_INDEX: RCTModule.DATA_BODY_MASS_INDEX,
74
75 DATA_STANDARD_WEIGHT: RCTModule.DATA_STANDARD_WEIGHT,
76 DATA_WEIGHT_CONTROL: RCTModule.DATA_WEIGHT_CONTROL,
77 DATA_MUSCLE_CONTROL: RCTModule.DATA_MUSCLE_CONTROL,
78 DATA_FAT_CONTROL: RCTModule.DATA_FAT_CONTROL,
79 DATA_FAT_WEIGHT: RCTModule.DATA_FAT_WEIGHT,
80 DATA_DE_FAT_WEIGHT: RCTModule.DATA_DE_FAT_WEIGHT,
81
82 ACTION_ONLINE_RESULT: RCTModule.ACTION_ONLINE_RESULT,
83 ACTION_DELETE_HISTORY_DATA: RCTModule.ACTION_DELETE_HISTORY_DATA,
84
85 ACTION_ANONYMOUS_DATA_NUM: RCTModule.ACTION_ANONYMOUS_DATA_NUM,
86 ANONYMOUS_DATA_COUNT: RCTModule.ANONYMOUS_DATA_COUNT,
87
88 ACTION_DELETE_ANONYMOUS_DATA: RCTModule.ACTION_DELETE_ANONYMOUS_DATA,
89 ACTION_ONLINE_REAL_TIME_WEIGHT: RCTModule.ACTION_ONLINE_REAL_TIME_WEIGHT,
90 ACTION_BODY_FAT_RESULT: RCTModule.ACTION_BODY_FAT_RESULT,
91 DATA_BODY_FAT_RESULT: RCTModule.DATA_BODY_FAT_RESULT,
92
93 ACTION_HS2S_LightUp_DEVICE: RCTModule.ACTION_HS2S_LightUp_DEVICE,
94 HS2S_DEVICE_STATUS: RCTModule.HS2S_DEVICE_STATUS,
95
96 ACTION_HS2S_MEASURE_HEARTRATE: RCTModule.ACTION_HS2S_MEASURE_HEARTRATE,
97 HS2S_MEASURE_HEARTRATE_RESULT: RCTModule.HS2S_MEASURE_HEARTRATE_RESULT,
98 ACTION_HS2S_EXIT_MEASURE_HEARTRATE_STATUS: RCTModule.ACTION_HS2S_EXIT_MEASURE_HEARTRATE_STATUS,
99
100 ACTION_RESTORE_FACTORY_SETTINGS: RCTModule.ACTION_RESTORE_FACTORY_SETTINGS,
101
102 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
103}
diff --git a/libs/ihealth-sdk/module/HS4SModule.js b/libs/ihealth-sdk/module/HS4SModule.js
new file mode 100755
index 0000000..5bba0c3
--- /dev/null
+++ b/libs/ihealth-sdk/module/HS4SModule.js
@@ -0,0 +1,53 @@
1/**
2 * Created by lixuesong on 11/11/2016.
3 */
4'use strict';
5
6var {NativeModules} = require('react-native');
7
8var RCTModule = NativeModules.HS4SModule
9
10/**
11 * @module HS4SModule
12 */
13module.exports = {
14 /**
15 * Notify event type for HS4S
16 */
17 Event_Notify: RCTModule.Event_Notify,
18
19 /**
20 * Start real-time measurement.
21 * @param {string} mac Device's mac address
22 * @param {string} unit Device's unit
23 * @param {string} userId user id
24 */
25 measureOnline: function (mac, unit, userId) {
26 RCTModule.measureOnline(mac, unit, userId)
27 },
28
29 /**
30 * Get the value of historical data in the HS4S.
31 * @param {string} mac Device's mac address
32 */
33 getOfflineData: function (mac) {
34 RCTModule.getOfflineData(mac)
35 },
36
37 /**
38 * Disconnect the HS4S
39 * @param mac The mac address for blood pressure monitor
40 */
41 disconnect: function (mac) {
42 RCTModule.disconnect(mac)
43 },
44
45 /**
46 * Get all connected HS4S device
47 *
48 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
49 */
50 getAllConnectedDevices: function () {
51 RCTModule.getAllConnectedDevices()
52 },
53}
diff --git a/libs/ihealth-sdk/module/HS6Module.js b/libs/ihealth-sdk/module/HS6Module.js
new file mode 100755
index 0000000..06356cd
--- /dev/null
+++ b/libs/ihealth-sdk/module/HS6Module.js
@@ -0,0 +1,94 @@
1/**
2 * Created by lixuesong on 11/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.HS6Module
10
11/**
12 * @module HS6Module
13 */
14module.exports = {
15
16 Event_Notify: RCTModule.Event_Notify,
17
18 /**
19 * Initializes method.
20 * @param {string} userName the name of user
21 */
22 init: function (userName) {
23 RCTModule.init(userName)
24 },
25
26 /**
27 * Set wifi to the scale.
28 * @param {string} ssid the name of net
29 * @param {string} password the password of the net
30 */
31 setWifi: function (ssid, password) {
32 RCTModule.setWifi(ssid, password)
33 },
34
35 /**
36 * Bind the user and scale together,after bind success user's weight datas can be transmitted to the cloud.
37 * And this method is a time consuming operation that cannot be called in the main thread.
38 * @param {string} birthday format like yyyy-MM-dd HH:mm:ss
39 * @param {float} weight the unit is kg
40 * @param {int} height the unit is cm
41 * @param {int} isSporter is sporter; 2 is not ;3 unknown
42 * @param {int} gender 0 is male ;1 is female
43 * @param {string} serialNumber the mac address of the scale
44 */
45 bindDeviceHS6: function (birthday, weight, height, isSporter, gender, serialNumber) {
46 RCTModule.bindDeviceHS6(birthday, weight, height, isSporter, gender, serialNumber)
47 },
48
49 /**
50 * Unbind the user and scale,and this method is a time consuming operation that cannot be called in the main thread.
51 * @param {string} serialNumber the mac address of scale
52 */
53 unBindDeviceHS6: function (serialNumber) {
54 RCTModule.unBindDeviceHS6(serialNumber)
55 },
56
57 /**
58 * Get AccessToken of HS6 user,and this method is a time consuming operation that cannot be called
59 * in the main thread.
60 * After get AccessToken, you can call openApi(http://developer.ihealthlabs.com) to pull data form iHealth cloud.
61 * @param {string} clientId the identification of the SDK
62 * @param {string} clientSecret the identification of the SDK
63 * @param {string} username the identification of the user
64 * @param {string} clientPara a random string,return back without change
65 */
66 getToken: function (clientId, clientSecret, username, clientPara) {
67 RCTModule.getToken(clientId, clientSecret, username, clientPara)
68 },
69
70 /**
71 * Set unit of HS6,and this method is a time consuming operation that cannot be called
72 * in the main thread.
73 * @param {string} username the identification of the user
74 * @param {int} unitType the unit type
75 * <p>0 Kg
76 * <p>1 lbs
77 * <p>2 st
78 */
79 setUnit: function (username, unitType) {
80 RCTModule.setUnit(username, unitType)
81 },
82
83 /**
84 * DownloadHS6 CloudData
85 * @param {string} clientId the identification of the SDK
86 * @param {string} clientSecret the identification of the SDK
87 * @param {string} username the identification of the user
88 * @param {long} ts time stamp of HS6 measure data. UTC time, unit in milliseconds.
89 * @param {long} pageSize the specific size of data in one download progress
90 */
91 getCloudData: function (clientId, clientSecret, username, ts, pageSize) {
92 RCTModule.getCloudData(clientId, clientSecret, username, ts, pageSize)
93 },
94}
diff --git a/libs/ihealth-sdk/module/HS6ProfileModule.js b/libs/ihealth-sdk/module/HS6ProfileModule.js
new file mode 100755
index 0000000..d461b5c
--- /dev/null
+++ b/libs/ihealth-sdk/module/HS6ProfileModule.js
@@ -0,0 +1,50 @@
1/**
2 * Created by lixuesong on 15/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.HS6ProfileModule
10
11/**
12 * @module HS6ProfileModule
13 */
14module.exports = {
15
16 ACTION_HS6_SETWIFI: RCTModule.ACTION_HS6_SETWIFI,
17 ACTION_HS6_BIND: RCTModule.ACTION_HS6_BIND,
18 ACTION_HS6_UNBIND: RCTModule.ACTION_HS6_UNBIND,
19 ACTION_HS6_GET_TOKEN: RCTModule.ACTION_HS6_GET_TOKEN,
20 ACTION_HS6_SET_UNIT: RCTModule.ACTION_HS6_SET_UNIT,
21
22 ACTION_HS6_GET_CLOUDDATA:RCTModule.ACTION_HS6_GET_CLOUDDATA,
23 HS6_CLOUDDATA:RCTModule.HS6_CLOUDDATA,
24
25 ACTION_HS6_GET_CLOUDDATA_LASTTS:RCTModule.ACTION_HS6_GET_CLOUDDATA_LASTTS,
26 HS6_CLOUDDATA_LASTTS:RCTModule.HS6_CLOUDDATA_LASTTS,
27
28 ACTION_HS6_GET_CLOUDDATA_LEFTNUM:RCTModule.ACTION_HS6_GET_CLOUDDATA_LEFTNUM,
29 HS6_CLOUDDATA_LEFTNUM:RCTModule.HS6_CLOUDDATA_LEFTNUM,
30
31 ACTION_HS6_ERROR: RCTModule.ACTION_HS6_ERROR,
32 ACTION_HS6_GET_DATA: RCTModule.ACTION_HS6_GET_DATA,
33
34 //Keys
35 SETWIFI_RESULT: RCTModule.SETWIFI_RESULT,
36 HS6_BIND_EXTRA: RCTModule.HS6_BIND_EXTRA,
37 BIND_HS6_RESULT: RCTModule.BIND_HS6_RESULT,
38 HS6_MODEL: RCTModule.HS6_MODEL,
39 HS6_POSITION: RCTModule.HS6_POSITION,
40 HS6_SETTED_WIFI: RCTModule.HS6_SETTED_WIFI,
41 HS6_UNBIND_RESULT: RCTModule.HS6_UNBIND_RESULT,
42 GET_TOKEN_RESULT: RCTModule.GET_TOKEN_RESULT,
43 SET_UNIT_RESULT: RCTModule.SET_UNIT_RESULT,
44 HS6_ERROR: RCTModule.HS6_ERROR,
45
46 DATA_RESULT: RCTModule.DATA_RESULT,
47 DATA_DOWNLOAD_TS: RCTModule.DATA_DOWNLOAD_TS,
48
49 DATA_LEFTNUMBER: RCTModule.DATA_LEFTNUMBER
50}
diff --git a/libs/ihealth-sdk/module/HSProfileModule.js b/libs/ihealth-sdk/module/HSProfileModule.js
new file mode 100755
index 0000000..0c63c27
--- /dev/null
+++ b/libs/ihealth-sdk/module/HSProfileModule.js
@@ -0,0 +1,42 @@
1/**
2 * Created by lixuesong on 15/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.HSProfileModule
10
11/**
12 * @module HSProfileModule
13 */
14module.exports = {
15
16 ACTION_LIVEDATA_HS: RCTModule.ACTION_LIVEDATA_HS,
17 ACTION_ONLINE_RESULT_HS: RCTModule.ACTION_ONLINE_RESULT_HS,
18 ACTION_HISTORICAL_DATA_HS: RCTModule.ACTION_HISTORICAL_DATA_HS,
19 ACTION_HISTORICAL_DATA_COMPLETE_HS: RCTModule.ACTION_HISTORICAL_DATA_COMPLETE_HS,
20 ACTION_NO_HISTORICALDATA: RCTModule.ACTION_NO_HISTORICALDATA,
21 ACTION_ERROR_HS: RCTModule.ACTION_ERROR_HS,
22
23 //Keys
24 LIVEDATA_HS: RCTModule.LIVEDATA_HS,
25 DATAID: RCTModule.DATAID,
26 WEIGHT_HS: RCTModule.WEIGHT_HS,
27 FAT_HS: RCTModule.FAT_HS,
28 WATER_HS: RCTModule.WATER_HS,
29 MUSCLE_HS: RCTModule.MUSCLE_HS,
30 SKELETON_HS: RCTModule.SKELETON_HS,
31 FATELEVEL_HS: RCTModule.FATELEVEL_HS,
32 DCI_HS: RCTModule.DCI_HS,
33 HISTORDATA__HS: RCTModule.HISTORDATA__HS,
34 MEASUREMENT_DATE_HS: RCTModule.MEASUREMENT_DATE_HS,
35
36 ERROR_NUM_HS: RCTModule.ERROR_NUM_HS,
37 ERROR_ID_ILLEGAL_ARGUMENT: RCTModule.ERROR_ID_ILLEGAL_ARGUMENT,
38 ERROR_ID_WIFI_DISABLED: RCTModule.ERROR_ID_WIFI_DISABLED,
39 ERROR_DESCRIPTION_HS: RCTModule.ERROR_DESCRIPTION_HS,
40
41 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
42}
diff --git a/libs/ihealth-sdk/module/NT13BModule.js b/libs/ihealth-sdk/module/NT13BModule.js
new file mode 100644
index 0000000..81392fc
--- /dev/null
+++ b/libs/ihealth-sdk/module/NT13BModule.js
@@ -0,0 +1,39 @@
1'use strict';
2
3var {NativeModules} = require('react-native');
4
5var RCTModule = NativeModules.NT13BModule
6
7 /**
8 * @module NT13BModule
9 */
10module.exports = {
11
12 Event_Notify: RCTModule.Event_Notify,
13
14 /**
15 * listen measurement
16 * @param {string} mac Device's mac address
17 */
18 measure: function (mac) {
19 RCTModule.measure(mac)
20 },
21
22 /**
23 * Disconnect the nt13b
24 * @param mac The mac address for BTM
25 */
26 disconnect: function (mac) {
27 RCTModule.disconnect(mac)
28 },
29
30 /**
31 * Get all connected BTM device
32 *
33 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
34 */
35 getAllConnectedDevices: function () {
36 RCTModule.getAllConnectedDevices()
37 }
38}
39
diff --git a/libs/ihealth-sdk/module/NT13BProfileModule.js b/libs/ihealth-sdk/module/NT13BProfileModule.js
new file mode 100644
index 0000000..93e6604
--- /dev/null
+++ b/libs/ihealth-sdk/module/NT13BProfileModule.js
@@ -0,0 +1,20 @@
1'use strict';
2
3var { NativeModules } = require('react-native');
4
5var RCTModule = NativeModules.NT13BProfileModule
6
7/**
8 * @module NT13BProfileModule
9 */
10module.exports = {
11 ACTION_MEASUREMENT_RESULT: RCTModule.ACTION_MEASUREMENT_RESULT,
12 UNIT_FLAG: RCTModule.UNIT_FLAG,
13 RESULT: RCTModule.RESULT,
14 TS_FLAG: RCTModule.TS_FLAG,
15 TS: RCTModule.TS,
16 THERMOMETER_TYPE_FLAG: RCTModule.THERMOMETER_TYPE_FLAG,
17 THERMOMETER_TYPE: RCTModule.THERMOMETER_TYPE,
18
19 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
20}
diff --git a/libs/ihealth-sdk/module/PO1Module.js b/libs/ihealth-sdk/module/PO1Module.js
new file mode 100644
index 0000000..2b877bd
--- /dev/null
+++ b/libs/ihealth-sdk/module/PO1Module.js
@@ -0,0 +1,38 @@
1'use strict';
2
3var {NativeModules} = require('react-native');
4
5var RCTModule = NativeModules.PO1Module
6
7/**
8 * @module PO1Module
9 */
10module.exports = {
11
12 Event_Notify: RCTModule.Event_Notify,
13
14 /**
15 * Get the PO1 battery status.
16 * @param {string} mac Device's mac address
17 */
18 getBattery: function (mac) {
19 RCTModule.getBattery(mac)
20 },
21
22 /**
23 * Disconnect the PO1
24 * @param mac The mac address
25 */
26 disconnect: function (mac) {
27 RCTModule.disconnect(mac)
28 },
29
30 /**
31 * Get all connected PO1 device
32 *
33 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
34 */
35 getAllConnectedDevices: function () {
36 RCTModule.getAllConnectedDevices()
37 }
38}
diff --git a/libs/ihealth-sdk/module/PO1ProfileModule.js b/libs/ihealth-sdk/module/PO1ProfileModule.js
new file mode 100644
index 0000000..329b72a
--- /dev/null
+++ b/libs/ihealth-sdk/module/PO1ProfileModule.js
@@ -0,0 +1,33 @@
1/**
2 * Created by lixuesong on 15/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.PO1ProfileModule
10
11/**
12 * @module POProfileModule
13 */
14module.exports = {
15
16 //Actions
17 ACTION_BO_MEASUREMENT: RCTModule.ACTION_BO_MEASUREMENT,
18 ACTION_GET_BATTERY: RCTModule.ACTION_GET_BATTERY,
19 ACTION_ERROR_PO1: RCTModule.ACTION_ERROR_PO1,
20 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES,
21
22 //Keys
23 ERROR_ID: RCTModule.ERROR_ID,
24 ERROR_DESCRIPTION: RCTModule.ERROR_DESCRIPTION,
25 BATTERY: RCTModule.BATTERY,
26 STATUS: RCTModule.STATUS,
27 BLOOD_OXYGEN: RCTModule.BLOOD_OXYGEN,
28 PULSE: RCTModule.PULSE,
29 PULSE_FORCE: RCTModule.PULSE_FORCE,
30 PI: RCTModule.PI,
31 WAVE: RCTModule.WAVE,
32
33}
diff --git a/libs/ihealth-sdk/module/PO3Module.js b/libs/ihealth-sdk/module/PO3Module.js
new file mode 100755
index 0000000..2185bcf
--- /dev/null
+++ b/libs/ihealth-sdk/module/PO3Module.js
@@ -0,0 +1,58 @@
1/**
2 * Created by lixuesong on 11/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.PO3Module
10
11/**
12 * @module PO3Module
13 */
14module.exports = {
15
16 Event_Notify: RCTModule.Event_Notify,
17
18 /**
19 * Get the PO3 battery status.
20 * @param {string} mac Device's mac address
21 */
22 getBattery: function (mac) {
23 RCTModule.getBattery(mac)
24 },
25
26 /**
27 * Start real-time measurement.
28 * @param {string} mac Device's mac address
29 */
30 startMeasure: function (mac) {
31 RCTModule.startMeasure(mac)
32 },
33
34 /**
35 * Get the value of historical data in the PO3.
36 * @param {string} mac Device's mac address
37 */
38 getHistoryData: function (mac) {
39 RCTModule.getHistoryData(mac)
40 },
41
42 /**
43 * Disconnect the PO3
44 * @param mac The mac address
45 */
46 disconnect: function (mac) {
47 RCTModule.disconnect(mac)
48 },
49
50 /**
51 * Get all connected PO3 device
52 *
53 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
54 */
55 getAllConnectedDevices: function () {
56 RCTModule.getAllConnectedDevices()
57 }
58}
diff --git a/libs/ihealth-sdk/module/POProfileModule.js b/libs/ihealth-sdk/module/POProfileModule.js
new file mode 100755
index 0000000..1e50159
--- /dev/null
+++ b/libs/ihealth-sdk/module/POProfileModule.js
@@ -0,0 +1,34 @@
1/**
2 * Created by lixuesong on 15/11/2016.
3 */
4'use strict';
5
6
7var {NativeModules} = require('react-native');
8
9var RCTModule = NativeModules.POProfileModule
10
11/**
12 * @module POProfileModule
13 */
14module.exports = {
15
16 ACTION_BATTERY_PO: RCTModule.ACTION_BATTERY_PO,
17 ACTION_LIVEDA_PO: RCTModule.ACTION_LIVEDA_PO,
18 ACTION_RESULTDATA_PO: RCTModule.ACTION_RESULTDATA_PO,
19 ACTION_OFFLINEDATA_PO: RCTModule.ACTION_OFFLINEDATA_PO,
20 ACTION_NO_OFFLINEDATA_PO: RCTModule.ACTION_NO_OFFLINEDATA_PO,
21 ACTION_ERROR_PO: RCTModule.ACTION_ERROR_PO,
22
23 //Keys
24 BATTERY_PO: RCTModule.BATTERY_PO,
25 PULSE_WAVE_PO: RCTModule.PULSE_WAVE_PO,
26 PI_PO: RCTModule.PI_PO,
27 PULSE_STRENGTH_PO: RCTModule.PULSE_STRENGTH_PO,
28 BLOOD_OXYGEN_PO: RCTModule.BLOOD_OXYGEN_PO,
29 PULSE_RATE_PO: RCTModule.PULSE_RATE_PO,
30 DATAID: RCTModule.DATAID,
31 OFFLINEDATA_PO: RCTModule.OFFLINEDATA_PO,
32 MEASURE_DATE_PO: RCTModule.MEASURE_DATE_PO,
33 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
34}
diff --git a/libs/ihealth-sdk/module/PT3SBTModule.js b/libs/ihealth-sdk/module/PT3SBTModule.js
new file mode 100644
index 0000000..0cfa516
--- /dev/null
+++ b/libs/ihealth-sdk/module/PT3SBTModule.js
@@ -0,0 +1,87 @@
1'use strict';
2
3var {NativeModules} = require('react-native');
4
5var RCTModule = NativeModules.PT3SBTModule
6
7 /**
8 * @module PT3SBTModule
9 */
10module.exports = {
11
12 Event_Notify: RCTModule.Event_Notify,
13
14 /**
15 * set time
16 * @param {string} mac Device's mac address
17 */
18 setTime: function (mac) {
19 RCTModule.setTime(mac)
20 },
21
22 /**
23 * get battery
24 * @param {string} mac Device's mac address
25 */
26 getBattery: function (mac) {
27 RCTModule.getBattery(mac)
28 },
29
30 /**
31 * set unit
32 * @param {string} mac Device's mac address
33 */
34 setUnit: function (mac, unit) {
35 RCTModule.setUnit(mac, unit)
36 },
37
38 /**
39 * get unit
40 * @param {string} mac Device's mac address
41 */
42 getUnit: function (mac) {
43 RCTModule.getUnit(mac)
44 },
45
46 /**
47 * get history data count
48 * @param {string} mac Device's mac address
49 */
50 getHistoryCount: function (mac) {
51 RCTModule.getHistoryCount(mac)
52 },
53
54 /**
55 * get history data
56 * @param {string} mac Device's mac address
57 */
58 getHistoryData: function (mac) {
59 RCTModule.getHistoryData(mac)
60 },
61
62 /**
63 * delete history data
64 * @param {string} mac Device's mac address
65 */
66 deleteHistory: function (mac) {
67 RCTModule.deleteHistory(mac)
68 },
69
70 /**
71 * Disconnect the pt3sbt
72 * @param mac The mac address for PT3SBT
73 */
74 disconnect: function (mac) {
75 RCTModule.disconnect(mac)
76 },
77
78 /**
79 * Get all connected BTM device
80 *
81 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
82 */
83 getAllConnectedDevices: function () {
84 RCTModule.getAllConnectedDevices()
85 }
86}
87
diff --git a/libs/ihealth-sdk/module/PT3SBTProfileModule.js b/libs/ihealth-sdk/module/PT3SBTProfileModule.js
new file mode 100644
index 0000000..ee1cdfe
--- /dev/null
+++ b/libs/ihealth-sdk/module/PT3SBTProfileModule.js
@@ -0,0 +1,31 @@
1'use strict';
2
3var { NativeModules } = require('react-native');
4
5var RCTModule = NativeModules.PT3SBTProfileModule
6
7/**
8 * @module PT3SBTProfileModule
9 */
10module.exports = {
11 // actions
12 ACTION_SET_TIME: RCTModule.ACTION_SET_TIME,
13 ACTION_GET_BATTERY: RCTModule.ACTION_GET_BATTERY,
14 ACTION_SET_UNIT: RCTModule.ACTION_SET_UNIT,
15 ACTION_GET_UNIT: RCTModule.ACTION_GET_UNIT,
16 ACTION_GET_HISTORY_COUNT: RCTModule.ACTION_GET_HISTORY_COUNT,
17 ACTION_GET_HISTORY_DATA: RCTModule.ACTION_GET_HISTORY_DATA,
18 ACTION_DELETE_HISTORY_DATA: RCTModule.ACTION_DELETE_HISTORY_DATA,
19 ACTION_TEMPERATURE_MEASUREMENT: RCTModule.ACTION_TEMPERATURE_MEASUREMENT,
20 ACTION_PUB_UNIT: RCTModule.ACTION_PUB_UNIT,
21 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES,
22
23 // keys
24 STATUS: RCTModule.STATUS,
25 BATTERY: RCTModule.BATTERY,
26 UNIT: RCTModule.UNIT,
27 TS: RCTModule.TS,
28 COUNT: RCTModule.COUNT,
29 TEMPERATURE: RCTModule.TEMPERATURE,
30 HISTORY: RCTModule.HISTORY
31}
diff --git a/libs/ihealth-sdk/module/TS28BModule.js b/libs/ihealth-sdk/module/TS28BModule.js
new file mode 100644
index 0000000..bda03db
--- /dev/null
+++ b/libs/ihealth-sdk/module/TS28BModule.js
@@ -0,0 +1,39 @@
1'use strict';
2
3var {NativeModules} = require('react-native');
4
5var RCTModule = NativeModules.TS28BModule
6
7 /**
8 * @module TS28BModule
9 */
10module.exports = {
11
12 Event_Notify: RCTModule.Event_Notify,
13
14 /**
15 * listen measurement
16 * @param {string} mac Device's mac address
17 */
18 measure: function (mac) {
19 RCTModule.measure(mac)
20 },
21
22 /**
23 * Disconnect the nt13b
24 * @param mac The mac address for BTM
25 */
26 disconnect: function (mac) {
27 RCTModule.disconnect(mac)
28 },
29
30 /**
31 * Get all connected BTM device
32 *
33 * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
34 */
35 getAllConnectedDevices: function () {
36 RCTModule.getAllConnectedDevices()
37 }
38}
39
diff --git a/libs/ihealth-sdk/module/TS28BProfileModule.js b/libs/ihealth-sdk/module/TS28BProfileModule.js
new file mode 100644
index 0000000..ff16184
--- /dev/null
+++ b/libs/ihealth-sdk/module/TS28BProfileModule.js
@@ -0,0 +1,20 @@
1'use strict';
2
3var { NativeModules } = require('react-native');
4
5var RCTModule = NativeModules.TS28BProfileModule
6
7/**
8 * @module TS28BProfileModule
9 */
10module.exports = {
11 ACTION_MEASUREMENT_RESULT: RCTModule.ACTION_MEASUREMENT_RESULT,
12 UNIT_FLAG: RCTModule.UNIT_FLAG,
13 RESULT: RCTModule.RESULT,
14 TS_FLAG: RCTModule.TS_FLAG,
15 TS: RCTModule.TS,
16 THERMOMETER_TYPE_FLAG: RCTModule.THERMOMETER_TYPE_FLAG,
17 THERMOMETER_TYPE: RCTModule.THERMOMETER_TYPE,
18
19 ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES
20}
diff --git a/libs/ihealth-sdk/module/iHealthDeviceManagerModule.js b/libs/ihealth-sdk/module/iHealthDeviceManagerModule.js
new file mode 100644
index 0000000..cee7b03
--- /dev/null
+++ b/libs/ihealth-sdk/module/iHealthDeviceManagerModule.js
@@ -0,0 +1,277 @@
1'use strict';
2
3
4var {NativeModules,Platform} = require('react-native');
5
6var RCTModule = NativeModules.iHealthDeviceManagerModule
7
8/**
9 * @module iHealthDeviceManagerModule
10 */
11module.exports = {
12 //Device Type
13 AM3S: RCTModule.AM3S,
14 /**
15 * Device type number for AM4(4) 1 << 2
16 */
17 AM4: RCTModule.AM4,
18 /**
19 * Device type number for PO3(8) 1 << 3
20 */
21 PO3: RCTModule.PO3,
22 /**
23 * Device type number for BP5(33554432) 1 << 25
24 */
25 BP5: RCTModule.BP5,
26 BP5S: RCTModule.BP5S,
27 /**
28 * Device type number for BP3L(32) 1 << 5
29 */
30 BP3L: RCTModule.BP3L,
31 /**
32 * Device type number for BP7S(16777216) 1 << 24
33 */
34 BP7: RCTModule.BP7,
35 BP7S: RCTModule.BP7S,
36 /**
37 * Device type number for Bp550BT(128) 1 << 7
38 */
39 KN550: RCTModule.KN550,
40 /**
41 * Device type number for HS2(131072) 1 << 17
42 */
43 HS2: RCTModule.HS2,
44 /**
45 * Device type number for HS4S(268435456) 1 << 28
46 */
47 HS4S: RCTModule.HS4S,
48 HS6: 10086,
49 /**
50 * Device type number for BG1(110)
51 */
52 BG1: RCTModule.BG1,
53 /**
54 * Device type number for BG5(4294967296) 1 << 32
55 */
56 BG5: RCTModule.BG5,
57
58 BG5S: RCTModule.BG5S,
59
60 ECG3: RCTModule.ECG3,
61
62 ECG3USB: RCTModule.ECG3USB,
63
64 BTM: RCTModule.BTM,
65
66 TS28B: RCTModule.TS28B,
67
68 NT13B: RCTModule.NT13B,
69
70 HS2S: RCTModule.HS2S,
71
72 BG1S: RCTModule.BG1S,
73
74 /**
75 * Notify event type for scan device result.("event_scan_device")
76 */
77 Event_Scan_Device: RCTModule.Event_Scan_Device,
78 /**
79 * Notify event type for scan action finish.("event_scan_finish")
80 */
81 Event_Scan_Finish: RCTModule.Event_Scan_Finish,
82 /**
83 * Notify event type for connect device successfully.("event_device_connected")
84 */
85 Event_Device_Connected: RCTModule.Event_Device_Connected,
86 /**
87 * Notify event type for connect device failed.("event_device_connect_failed")
88 */
89 Event_Device_Connect_Failed: RCTModule.Event_Device_Connect_Failed,
90 /**
91 * Notify event type for device disconnect.("event_device_disconnect")
92 */
93 Event_Device_Disconnect: RCTModule.Event_Device_Disconnect,
94 /**
95 * Notify event type for authenticate result.("event_authenticate_result")
96 */
97 Event_Authenticate_Result: RCTModule.Event_Authenticate_Result,
98
99
100 /**
101 * Authentication the configure information.
102 * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Authenticate_Result) before call the api.
103 * @param {string} userName User's user name you use when you sign up
104 * @param {string} clientID User's client id.
105 * @param {string} clientSecret User's client secret.
106 * @return {callback} Callback with a json object. Eg.{"authen":2}
107 * <p/><li/>The measurement via SDK will be operated in the case of 1-3, and there is 10-day tryout if SDK Verification failed in case of SDK cannot connect Internet or Userid/clientID/clientSecret verification failed or SDK has not been authorized or User has not been authorized.
108 * SDK is fully functional during tryout period, but will be terminated without verification through Internet after 10 days.The interface needs to be re-called after analyzing the return parameters. SDK application requires Internet connection.
109 * If you encounter user status 4 with full internet access, please send Userid/clientID/clientSecret to this email sdk@ihealthlabs.com.cn to get help.
110 * <p/>
111 * The result value and description will be as below:
112 * <table style="width:200px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
113 * <tbody>
114 * <tr><td>Value</td><td>Description</td></tr>
115 * <tr><td>1</td><td>New-user registration succeeded.</td></tr>
116 * <tr><td>2</td><td>User login succeeded.</td></tr>
117 * <tr><td>3</td><td>The user is iHealth user as well, measurement via SDK has been activated, and the data from the measurement belongs to the user.</td></tr>
118 * <tr><td>4</td><td>Testing without Internet connection succeeded.</td></tr>
119 * <tr><td>5</td><td>Userid/clientID/clientSecret verification failed.</td></tr>
120 * <tr><td>6</td><td>SDK has not been authorized.</td></tr>
121 * <tr><td>7</td><td>User has not been authorized.</td></tr>
122 * <tr><td>8</td><td>Internet error, verification failed.</td></tr>
123 * </tbody>
124 * </table>
125 */
126 authenConfigureInfo: function (userName, clientID, clientSecret) {
127 RCTModule.authenConfigureInfo(userName, clientID, clientSecret)
128 },
129 /**
130 * Authencation the appSecret
131 * @param {string} appSecret
132 * @return {callback} Callback with a boolen object. true:authencation success false:authencation failed .<br/>
133 */
134
135 authenAppSecret: function (appSecret, callback) {
136 RCTModule.authenAppSecret(appSecret, callback)
137 },
138
139 /**
140 * Start discovery iHealth device with type
141 * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Scan_Device) before call the api.
142 *
143 * @param {number} type The type to be discovered.<br/>
144 * e.g. startDiscovery(iHealthDeviceManagerModule.AM4) will discover AM4 devices.<br/>
145 */
146 startDiscovery: function (type) {
147 RCTModule.startDiscovery(type)
148 },
149
150
151 /**
152 * Stop discovery iHealth device
153 * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Scan_Finish) before call the api.
154 */
155 stopDiscovery: function () {
156 RCTModule.stopDiscovery()
157 },
158
159 /**
160 * Connect iHealth device
161 * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Device_Connected or iHealthDeviceManagerModel.Event_Device_Connect_Failed) before call the api.
162 * @param {string} mac The mac address of device to be connected.<br/>
163 * e.g. "004D3208D5D4"
164 * @param {string} type Device type string.
165 * @return {callback} Callback with events {@link module:iHealthDeviceManagerModule.Event_Device_Connected Event_Device_Connected}
166 * or {@link module:iHealthDeviceManagerModule.Event_Device_Connect_Failed Event_Device_Connect_Failed}.
167 * And the mesage is format as {"errorid":0,"type":"BP5","mac":"8CDE52B62521"}
168 * <p/>The key and value in the message will be as below:
169 * <table style="width:200px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
170 * <tbody>
171 * <tr><td>Key</td><td>value</td></tr>
172 * <tr><td>errorid</td><td>This value is to reflect the state of the system when the connection fails. Normally, it's 0.
173 Please note, this field is different from the ErrorId of the DeviceProfileModule.</td></tr>
174 * <tr><td>type</td><td>The device type. Eg.BP5</td></tr>
175 * <tr><td>mac</td><td>The mac address.</td></tr>
176 * </tbody>
177 * </table>
178 */
179 connectDevice: function (mac, type) {
180 RCTModule.connectDevice(mac, type)
181 },
182
183 /**
184 * Connect BTM device
185 * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Device_Connected or iHealthDeviceManagerModel.Event_Device_Connect_Failed) before call the api.
186 * @param {string} mac The mac address of device to be connected.<br/>
187 * e.g. "004D3208D5D4"
188 * @param {string} type Device type string.
189 * @return {callback} Callback with events {@link module:iHealthDeviceManagerModule.Event_Device_Connected Event_Device_Connected}
190 * or {@link module:iHealthDeviceManagerModule.Event_Device_Connect_Failed Event_Device_Connect_Failed}.
191 * And the mesage is format as {"errorid":0,"type":"BP5","mac":"8CDE52B62521"}
192 * <p/>The key and value in the message will be as below:
193 * <table style="width:200px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
194 * <tbody>
195 * <tr><td>Key</td><td>value</td></tr>
196 * <tr><td>errorid</td><td>This value is to reflect the state of the system when the connection fails. Normally, it's 0.
197 Please note, this field is different from the ErrorId of the DeviceProfileModule.</td></tr>
198 * <tr><td>username</td><td>the identification of the user, could be the form of email address or mobile phone</td></tr>
199 * <tr><td>mac</td><td>a valid FDIR-V3 mac.</td></tr>
200 * <tr><td>type</td><td>TYPE_FDIR_V3</td></tr>
201 * <tr><td>unit</td><td>Temperature unit.1: c 2: f</td></tr>
202 * <tr><td>measureTarget</td><td>Measuring target.1: body 2: object</td></tr>
203 * <tr><td>functionTarget</td><td>Offline target.1: offline 2: online</td></tr>
204 * <tr><td>hour</td><td>Standby time hours. eg. 24</td></tr>
205 * <tr><td>minute</td><td>Standby time minutes. eg.60</td></tr>
206 * <tr><td>second</td><td>Standby time seconds. eg.60</td></tr>
207 * </tbody>
208 * </table>
209 */
210 connectTherm: function (username, mac, type, unit, measureTarget, functionTarget, hour, minute, second) {
211 RCTModule.connectTherm(username, mac, type, unit, measureTarget, functionTarget, hour, minute, second)
212 },
213
214
215 /**
216 * Get information for iHealth device
217 *
218 * @param {string} mac The mac address of device.<br/>
219 * e.g. "004D3208D5D4"
220 * @return {callback} Callback with a map object.<br/>
221 * e.g. {"protocolstring":"com.jiuan.AMV12","accessoryname":"AM4","firmwareversion":"138","hardwareversion":"100","manufacture":"iHealth","serialnumber":"004D32079148","modenumber":"AM4 11070"}
222 */
223 getDevicesIDPS: function (mac, callback) {
224 RCTModule.getDevicesIDPS(mac, callback)
225 },
226
227 /**
228 * [Only for android] Disconnect an iHealth device that has been connected or in connecting status.
229 * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Device_Disconnect or iHealthDeviceManagerModel.Event_Device_Connect_Failed) before call the api.
230 * @param {string} mac The mac address of device to be connected or in connecting.<br/>
231 * e.g. "004D3208D5D4"
232 * @param {string} type Device type string.
233 * @return {callback} Callback with events {@link module:iHealthDeviceManagerModule.Event_Device_Disconnect Event_Device_Disconnect}
234 * or {@link module:iHealthDeviceManagerModule.Event_Device_Connect_Failed Event_Device_Connect_Failed}.
235 * And the mesage is format as {"errorid":0,"type":"BP5","mac":"8CDE52B62521"}
236 * <p/>The key and value in the message will be as below:
237 * <table style="width:200px;" cellpadding="2" cellspacing="0" border="1" bordercolor="#000000">
238 * <tbody>
239 * <tr><td>Key</td><td>value</td></tr>
240 * <tr><td>errorid</td><td>This value is to reflect the state of the system when the connection fails. Normally, it's 0.
241 Please note, this field is different from the ErrorId of the DeviceProfileModule.</td></tr>
242 * <tr><td>type</td><td>The device type. Eg.BP5</td></tr>
243 * <tr><td>mac</td><td>The mac address.</td></tr>
244 * </tbody>
245 * </table>
246 */
247 disconnectDevice: function (mac, type) {
248 RCTModule.disconnectDevice(mac, type)
249 },
250
251 /**
252 * If you want to use the iHealth Device, you must first call authentication method before connect a device.
253 * To get a license, please refer to [iHealth Developer](https://dev.ihealthlabs.com).
254 * @param license The license file name is like 'com_example_android.pem'. Download the license file from the website, integrate to your native project.
255 * For android: should save the license file to the /assets/ folder.
256 * @return {callback} Callback with a map object.<br/>
257 * e.g. {"access": true}
258 */
259 sdkAuthWithLicense: function (license) {
260 RCTModule.sdkAuthWithLicense(license)
261 },
262
263 /**
264 * get the phone is support OTG or not
265 * @return true or false
266 */
267
268 isSupportOTG: function (callback){
269 if (Platform.OS === 'ios'){
270 callback(true);
271 } else {
272 RCTModule.isSupportOTG(callback);
273 }
274
275 },
276
277}