diff options
Diffstat (limited to 'libs/ihealth-sdk/module/HS2SModule.js')
| -rwxr-xr-x | libs/ihealth-sdk/module/HS2SModule.js | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/module/HS2SModule.js b/libs/ihealth-sdk/module/HS2SModule.js new file mode 100755 index 0000000..8c8b6e5 --- /dev/null +++ b/libs/ihealth-sdk/module/HS2SModule.js | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | 'use strict'; | ||
| 2 | |||
| 3 | |||
| 4 | var {NativeModules} = require('react-native'); | ||
| 5 | |||
| 6 | var RCTModule = NativeModules.HS2SModule | ||
| 7 | |||
| 8 | /** | ||
| 9 | * @module hs2sModule | ||
| 10 | */ | ||
| 11 | module.exports = { | ||
| 12 | /** | ||
| 13 | * Notify event type for hs2s | ||
| 14 | */ | ||
| 15 | Event_Notify: RCTModule.Event_Notify, | ||
| 16 | |||
| 17 | |||
| 18 | getDeviceInfo: function (mac) { | ||
| 19 | RCTModule.getDeviceInfo(mac) | ||
| 20 | }, | ||
| 21 | /** | ||
| 22 | * Get hs2s device battary | ||
| 23 | * | ||
| 24 | */ | ||
| 25 | getBattery: function (mac) { | ||
| 26 | RCTModule.getBattery(mac) | ||
| 27 | }, | ||
| 28 | |||
| 29 | setUnit: function (mac,unit) { | ||
| 30 | RCTModule.setUnit(mac,unit) | ||
| 31 | }, | ||
| 32 | getUserInfo: function (mac) { | ||
| 33 | RCTModule.getUserInfo(mac) | ||
| 34 | }, | ||
| 35 | updateUserInfo: function (mac,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark) { | ||
| 36 | RCTModule.updateUserInfo(mac,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark); | ||
| 37 | }, | ||
| 38 | |||
| 39 | deleteUser: function (mac,userID) { | ||
| 40 | RCTModule.deleteUser(mac,userID); | ||
| 41 | }, | ||
| 42 | |||
| 43 | getMemoryDataCount: function (mac,userID) { | ||
| 44 | RCTModule.getMemoryDataCount(mac,userID); | ||
| 45 | }, | ||
| 46 | |||
| 47 | getMemoryData: function (mac,userID) { | ||
| 48 | RCTModule.getMemoryData(mac,userID); | ||
| 49 | }, | ||
| 50 | |||
| 51 | deleteMemoryData: function (mac,userID) { | ||
| 52 | RCTModule.deleteMemoryData(mac,userID); | ||
| 53 | }, | ||
| 54 | |||
| 55 | getAnonymousMemoryDataCount: function (mac) { | ||
| 56 | RCTModule.getAnonymousMemoryDataCount(mac); | ||
| 57 | }, | ||
| 58 | |||
| 59 | getAnonymousMemoryData: function (mac) { | ||
| 60 | RCTModule.getAnonymousMemoryData(mac); | ||
| 61 | }, | ||
| 62 | |||
| 63 | deleteAnonymousMemoryData: function (mac) { | ||
| 64 | RCTModule.deleteAnonymousMemoryData(mac) | ||
| 65 | }, | ||
| 66 | |||
| 67 | measure: function (mac,userType,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark) { | ||
| 68 | RCTModule.measure(mac,userType,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark) | ||
| 69 | }, | ||
| 70 | |||
| 71 | resetDevice: function (mac) { | ||
| 72 | RCTModule.resetDevice(mac) | ||
| 73 | }, | ||
| 74 | |||
| 75 | broadCastTypeDevice: function (mac) { | ||
| 76 | RCTModule.broadCastTypeDevice(mac) | ||
| 77 | }, | ||
| 78 | |||
| 79 | setDeviceLightUp: function (mac) { | ||
| 80 | RCTModule.setDeviceLightUp(mac) | ||
| 81 | }, | ||
| 82 | |||
| 83 | enterHS2SHeartRateMeasurementMode: function (mac) { | ||
| 84 | RCTModule.enterHS2SHeartRateMeasurementMode(mac) | ||
| 85 | }, | ||
| 86 | |||
| 87 | exitHS2SHeartRateMeasurementMode: function (mac) { | ||
| 88 | RCTModule.exitHS2SHeartRateMeasurementMode(mac) | ||
| 89 | }, | ||
| 90 | |||
| 91 | |||
| 92 | /** | ||
| 93 | * Disconnect the HS2S | ||
| 94 | * @param mac The mac address for blood pressure monitor | ||
| 95 | */ | ||
| 96 | disconnect: function (mac) { | ||
| 97 | RCTModule.disconnect(mac) | ||
| 98 | }, | ||
| 99 | |||
| 100 | /** | ||
| 101 | * Get all connected hs2s device | ||
| 102 | * | ||
| 103 | * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} | ||
| 104 | */ | ||
| 105 | getAllConnectedDevices: function () { | ||
| 106 | RCTModule.getAllConnectedDevices() | ||
| 107 | } | ||
| 108 | |||
| 109 | |||
| 110 | } | ||
