summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/module/PT3SBTModule.js
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/module/PT3SBTModule.js')
-rw-r--r--libs/ihealth-sdk/module/PT3SBTModule.js87
1 files changed, 87 insertions, 0 deletions
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