From d6d9a09d505d11148599a95a5be3e1351edbe0ac Mon Sep 17 00:00:00 2001 From: hc Date: Mon, 13 Apr 2026 15:17:52 +0800 Subject: Local iHealth SDK, device detail screen, iOS event fixes --- libs/ihealth-sdk/module/BP7SModule.js | 121 ++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100755 libs/ihealth-sdk/module/BP7SModule.js (limited to 'libs/ihealth-sdk/module/BP7SModule.js') diff --git a/libs/ihealth-sdk/module/BP7SModule.js b/libs/ihealth-sdk/module/BP7SModule.js new file mode 100755 index 0000000..e2be830 --- /dev/null +++ b/libs/ihealth-sdk/module/BP7SModule.js @@ -0,0 +1,121 @@ +/** + * Created by zhangxu on 16/11/20. + */ + +'use strict'; + + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.BP7SModule; + +/** + * @module BP7SModule + */ + +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Get the BP7S device's battery. + * @param {string} mac Device's mac address + */ + getBattery: function (mac) { + if (RCTModule != null) { + RCTModule.getBattery(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * get offline data number. + * @param {string} mac Device's mac address + */ + getOffLineNum:function (mac) { + if (RCTModule != null) { + RCTModule.getOffLineNum(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * get offline data number. + * @param {string} mac Device's mac address + */ + getOffLineData:function (mac) { + if (RCTModule != null) { + RCTModule.getOffLineData(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Set BP7S device unit. + * @param {string} mac Device's mac address + * @param {int} unit 0:mmHg,1:kPa + */ + setUnit:function (mac, unit){ + if (RCTModule != null) { + RCTModule.setUnit(mac,unit); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Set BP7S device angle. + * @param {string} mac Device's mac address + * @param {int} leftUpper the maximum measure angle of left hand, the maximum value must less than 90. + * @param {int} leftLows the minimum measure angle of left hand, the minimum value must more than 0, and less than leftUpper. + * @param {int} rightUpper the maximum measure angle of right hand, the maximum value must less than 90. + * @param {int} rightLow the minimum measure angle of right hand, the minimum value must more than 0, and less than rightUpper. + * + */ + angleSet:function (mac, leftUpper, leftLows, rightUpper, rightLow) { + if (RCTModule != null) { + RCTModule.angleSet(mac,leftUpper,leftLows,rightUpper,rightLow); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Get the BP7S device's functionInfo. + * @param {string} mac Device's mac address + */ + getFunctionInfo:function (mac) { + if (RCTModule != null) { + RCTModule.getFunctionInfo(mac); + }else { + sconsole.log('~~~~~ RCTModule is null') + } + }, + + /** + * Disconnect the BP7S + * + * @param {string} mac Device's mac address + */ + + disconnect: function (mac) { + + if (RCTModule != null) { + RCTModule.disconnect(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Get all connected BP7S device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +}; -- cgit