summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/module/PT3SBTModule.js
blob: 0cfa51648cd3d2fac820dbd960b8f778dbec45c8 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
'use strict';

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

var RCTModule = NativeModules.PT3SBTModule

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

  Event_Notify: RCTModule.Event_Notify,

  /**
   * set time
   * @param {string} mac Device's mac address
   */
  setTime: function (mac) {
    RCTModule.setTime(mac)
  },

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

  /**
   * set unit
   * @param {string} mac Device's mac address
   */
  setUnit: function (mac, unit) {
    RCTModule.setUnit(mac, unit)
  },

  /**
   * get unit
   * @param {string} mac Device's mac address
   */
  getUnit: function (mac) {
    RCTModule.getUnit(mac)
  },

  /**
   * get history data count
   * @param {string} mac Device's mac address
   */
  getHistoryCount: function (mac) {
    RCTModule.getHistoryCount(mac)
  },

  /**
   * get history data
   * @param {string} mac Device's mac address
   */
  getHistoryData: function (mac) {
    RCTModule.getHistoryData(mac)
  },

  /**
   * delete history data
   * @param {string} mac Device's mac address
   */
  deleteHistory: function (mac) {
    RCTModule.deleteHistory(mac)
  },

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

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