summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/module/PO3Module.js
blob: 2185bcf5f49459a003cbd90e3033cba8bd1faaa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
 * Created by lixuesong on 11/11/2016.
 */
'use strict';


var {NativeModules} = require('react-native');

var RCTModule = NativeModules.PO3Module

/**
 * @module PO3Module
 */
module.exports = {

  Event_Notify: RCTModule.Event_Notify,

  /**
   * Get the PO3 battery status.
   * @param {string} mac Device's mac address
   */
  getBattery: function (mac) {
      RCTModule.getBattery(mac)
  },

  /**
   * Start real-time measurement.
   * @param {string} mac Device's mac address
   */
  startMeasure: function (mac) {
      RCTModule.startMeasure(mac)
  },

  /**
   * Get the value of historical data in the PO3.
   * @param {string} mac Device's mac address
   */
  getHistoryData: function (mac) {
      RCTModule.getHistoryData(mac)
  },

  /**
   * Disconnect the PO3
   * @param mac The mac address
   */
  disconnect: function (mac) {
      RCTModule.disconnect(mac)
  },

  /**
   * Get all connected PO3 device
   *
   * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]}
   */
  getAllConnectedDevices: function () {
      RCTModule.getAllConnectedDevices()
  }
}