summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/module/HS2Module.js
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/module/HS2Module.js')
-rwxr-xr-xlibs/ihealth-sdk/module/HS2Module.js63
1 files changed, 63 insertions, 0 deletions
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}