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/BTMModule.js | 88 ++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100755 libs/ihealth-sdk/module/BTMModule.js (limited to 'libs/ihealth-sdk/module/BTMModule.js') diff --git a/libs/ihealth-sdk/module/BTMModule.js b/libs/ihealth-sdk/module/BTMModule.js new file mode 100755 index 0000000..d7601d5 --- /dev/null +++ b/libs/ihealth-sdk/module/BTMModule.js @@ -0,0 +1,88 @@ +/** + * Created by lixuesong on 11/11/2016. + */ +'use strict'; + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.BTMModule + + /** + * @module BTMModule + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Get the BTM battery status. + * @param {string} mac Device's mac address + */ + getBattery: function (mac) { + RCTModule.getBattery(mac) + }, + + /** + * Get the value of historical data in the BTM. + * @param {string} mac Device's mac address + */ + getMemoryData: function (mac) { + RCTModule.getMemoryData(mac) + }, + + /** + * Set the standby time + * @param {string} mac Device's mac address + * @param {number} hour Standby time hours [0, 23] + * @param {number} minute Standby time minute [0, 59] + * @param {number} second Standby time second [0, 59] + */ + setStandbyTime: function (mac, hour, minute, second) { + RCTModule.setStandbyTime(mac, hour, minute, second) + }, + + /** + * Set the temperature unit + * @param {string} mac Device's mac address + * @param {number} unit temperature unit
+ * The unit of: BtmControl.TEMPERATURE_UNIT_C or BtmControl.TEMPERATURE_UNIT_F + */ + setTemperatureUnit: function (mac, unit) { + RCTModule.setTemperatureUnit(mac, unit) + }, + + /** + * Set the measuring target + * @param {string} mac Device's mac address + * @param {number} measuring target + */ + setMeasuringTarget: function (mac, target) { + RCTModule.setMeasuringTarget(mac, target) + }, + + /** + * Set the offline target + * @param {string} mac Device's mac address + * @param {number} measuring target + */ + setOfflineTarget: function (mac, target) { + RCTModule.setOfflineTarget(mac, target) + }, + + /** + * Disconnect the BTM + * @param mac The mac address for BTM + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Get all connected BTM device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +} -- cgit