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