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/AM3SModule.js | 274 ++++++++++++ libs/ihealth-sdk/module/AM4Module.js | 321 ++++++++++++++ libs/ihealth-sdk/module/AM5Module.js | 150 +++++++ libs/ihealth-sdk/module/AM5ProfileModule.js | 68 +++ libs/ihealth-sdk/module/AMProfileModule.js | 463 +++++++++++++++++++++ libs/ihealth-sdk/module/BG1Module.js | 40 ++ libs/ihealth-sdk/module/BG1ProfileModule.js | 90 ++++ libs/ihealth-sdk/module/BG1SModule.js | 48 +++ libs/ihealth-sdk/module/BG1SProfileModule.js | 30 ++ libs/ihealth-sdk/module/BG5Module.js | 184 ++++++++ libs/ihealth-sdk/module/BG5SModule.js | 145 +++++++ libs/ihealth-sdk/module/BG5SProfileModule.js | 401 ++++++++++++++++++ libs/ihealth-sdk/module/BGProfileModule.js | 413 ++++++++++++++++++ libs/ihealth-sdk/module/BP3LModule.js | 75 ++++ libs/ihealth-sdk/module/BP550BTModule.js | 90 ++++ libs/ihealth-sdk/module/BP5Module.js | 125 ++++++ libs/ihealth-sdk/module/BP5SModule.js | 139 +++++++ libs/ihealth-sdk/module/BP7Module.js | 149 +++++++ libs/ihealth-sdk/module/BP7SModule.js | 121 ++++++ libs/ihealth-sdk/module/BPProfileModule.js | 69 +++ libs/ihealth-sdk/module/BTMModule.js | 88 ++++ libs/ihealth-sdk/module/BTMProfileModule.js | 33 ++ libs/ihealth-sdk/module/ECGModule.js | 60 +++ libs/ihealth-sdk/module/ECGProfileModule.js | 208 +++++++++ libs/ihealth-sdk/module/ECGUSBModule.js | 119 ++++++ libs/ihealth-sdk/module/HS2Module.js | 63 +++ libs/ihealth-sdk/module/HS2SModule.js | 110 +++++ libs/ihealth-sdk/module/HS2SProfileModule.js | 103 +++++ libs/ihealth-sdk/module/HS4SModule.js | 53 +++ libs/ihealth-sdk/module/HS6Module.js | 94 +++++ libs/ihealth-sdk/module/HS6ProfileModule.js | 50 +++ libs/ihealth-sdk/module/HSProfileModule.js | 42 ++ libs/ihealth-sdk/module/NT13BModule.js | 39 ++ libs/ihealth-sdk/module/NT13BProfileModule.js | 20 + libs/ihealth-sdk/module/PO1Module.js | 38 ++ libs/ihealth-sdk/module/PO1ProfileModule.js | 33 ++ libs/ihealth-sdk/module/PO3Module.js | 58 +++ libs/ihealth-sdk/module/POProfileModule.js | 34 ++ libs/ihealth-sdk/module/PT3SBTModule.js | 87 ++++ libs/ihealth-sdk/module/PT3SBTProfileModule.js | 31 ++ libs/ihealth-sdk/module/TS28BModule.js | 39 ++ libs/ihealth-sdk/module/TS28BProfileModule.js | 20 + .../module/iHealthDeviceManagerModule.js | 277 ++++++++++++ 43 files changed, 5094 insertions(+) create mode 100755 libs/ihealth-sdk/module/AM3SModule.js create mode 100755 libs/ihealth-sdk/module/AM4Module.js create mode 100755 libs/ihealth-sdk/module/AM5Module.js create mode 100755 libs/ihealth-sdk/module/AM5ProfileModule.js create mode 100755 libs/ihealth-sdk/module/AMProfileModule.js create mode 100755 libs/ihealth-sdk/module/BG1Module.js create mode 100755 libs/ihealth-sdk/module/BG1ProfileModule.js create mode 100644 libs/ihealth-sdk/module/BG1SModule.js create mode 100644 libs/ihealth-sdk/module/BG1SProfileModule.js create mode 100755 libs/ihealth-sdk/module/BG5Module.js create mode 100644 libs/ihealth-sdk/module/BG5SModule.js create mode 100644 libs/ihealth-sdk/module/BG5SProfileModule.js create mode 100755 libs/ihealth-sdk/module/BGProfileModule.js create mode 100755 libs/ihealth-sdk/module/BP3LModule.js create mode 100755 libs/ihealth-sdk/module/BP550BTModule.js create mode 100755 libs/ihealth-sdk/module/BP5Module.js create mode 100755 libs/ihealth-sdk/module/BP5SModule.js create mode 100755 libs/ihealth-sdk/module/BP7Module.js create mode 100755 libs/ihealth-sdk/module/BP7SModule.js create mode 100755 libs/ihealth-sdk/module/BPProfileModule.js create mode 100755 libs/ihealth-sdk/module/BTMModule.js create mode 100755 libs/ihealth-sdk/module/BTMProfileModule.js create mode 100755 libs/ihealth-sdk/module/ECGModule.js create mode 100755 libs/ihealth-sdk/module/ECGProfileModule.js create mode 100755 libs/ihealth-sdk/module/ECGUSBModule.js create mode 100755 libs/ihealth-sdk/module/HS2Module.js create mode 100755 libs/ihealth-sdk/module/HS2SModule.js create mode 100644 libs/ihealth-sdk/module/HS2SProfileModule.js create mode 100755 libs/ihealth-sdk/module/HS4SModule.js create mode 100755 libs/ihealth-sdk/module/HS6Module.js create mode 100755 libs/ihealth-sdk/module/HS6ProfileModule.js create mode 100755 libs/ihealth-sdk/module/HSProfileModule.js create mode 100644 libs/ihealth-sdk/module/NT13BModule.js create mode 100644 libs/ihealth-sdk/module/NT13BProfileModule.js create mode 100644 libs/ihealth-sdk/module/PO1Module.js create mode 100644 libs/ihealth-sdk/module/PO1ProfileModule.js create mode 100755 libs/ihealth-sdk/module/PO3Module.js create mode 100755 libs/ihealth-sdk/module/POProfileModule.js create mode 100644 libs/ihealth-sdk/module/PT3SBTModule.js create mode 100644 libs/ihealth-sdk/module/PT3SBTProfileModule.js create mode 100644 libs/ihealth-sdk/module/TS28BModule.js create mode 100644 libs/ihealth-sdk/module/TS28BProfileModule.js create mode 100644 libs/ihealth-sdk/module/iHealthDeviceManagerModule.js (limited to 'libs/ihealth-sdk/module') diff --git a/libs/ihealth-sdk/module/AM3SModule.js b/libs/ihealth-sdk/module/AM3SModule.js new file mode 100755 index 0000000..47b37df --- /dev/null +++ b/libs/ihealth-sdk/module/AM3SModule.js @@ -0,0 +1,274 @@ +/** + * Created by Jeepend on 22/11/2016. + */ +'use strict'; + + +var { + NativeModules, + DeviceEventEmitter +} = require('react-native'); + +var AMProfileModule = require('./AMProfileModule.js'); + +var RCTModule = NativeModules.AM3SModule +/** + * @module AM3SModule + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * AM3S IDPS information + * + * @argument mac + */ + getIdps: function (mac) { + RCTModule.getIdps(mac) + }, + + /** + * Reset AM3S device. + * @param {string} mac Device's mac address + */ + reset: function (mac) { + RCTModule.reset(mac) + }, + + /** + * Get user's ID + * @param {string} mac Device's mac address + */ + getUserId: function (mac) { + RCTModule.getUserId(mac) + }, + + /** + * Get alarms' count + * @param {string} mac Device's mac address + */ + getAlarmClockNum: function (mac) { + RCTModule.getAlarmClockNum(mac) + }, + + /** + * Get alarm information by id + * @param {string} mac Device's mac address + * @param {array} alarmIDArray Alarm id array to be query. + */ + getAlarmClockDetail: function (mac, alarmIDArray) { + RCTModule.getAlarmClockDetail(mac, alarmIDArray) + }, + + /** + * Set/Unset alarm + * @param {string} mac Device's mac address + * @param {number} id Alarm id + * @param {number} hour Alarm hour part [0, 23] + * @param {number} min Alarm minute part [0, 59] + * @param {boolean} isRepeat Indicates whether it will repeat: + * @param {array} weekArray The days in a week to repeat the alarm, week[0~6] indicates Sun~Sat. + * {0, 1, 1, 1, 1, 1, 0} means the alarm will repeat on Mon, Tue, Wed, Thu, Fri. + * @param {boolean} isOn true if want to set the alarm, false to unset it. + */ + setAlarmClock: function (mac, id, hour, min, isRepeat, weekArray, isOn) { + RCTModule.setAlarmClock(mac, id, hour, min, isRepeat, weekArray, isOn) + }, + + /** + * Delete alarm by id + * @param {string} mac Device's mac address + * @param {number} id Alarm id(should be 1, 2 or 3) + */ + deleteAlarmClock: function (mac, id) { + RCTModule.deleteAlarmClock(mac, id) + }, + + /** + * Get activity remind setting. + * @param {string} mac Device's mac address + */ + getActivityRemind: function (mac) { + RCTModule.getActivityRemind(mac) + }, + + /** + * Set/Unset activity remind + * @param {string} mac Device's mac address + * @param {number} hour Activity remind hour part [0, 23] + * @param {number} min Activity remind minute part [0, 59] + * @param {boolean} isOn true if want to set activity remind, false to unset it. + */ + setActivityRemind: function (mac, hour, min, isOn) { + RCTModule.setActivityRemind(mac, hour, min, isOn) + }, + + /** + * Get device state and battery information + * @param {string} mac Device's mac address + */ + queryAMState: function (mac) { + RCTModule.queryAMState(mac) + }, + + /** + * Set user ID + * @param {string} mac Device's mac address + * @param {number} id new user id
+ * Range: [1, 2147483647(0x7FFFFFFF)] + */ + setUserId: function (mac, id) { + if (id < 1 || id > 0x7FFFFFFF) { + let result = { + "mac": mac, + "type": "AM3S", + "action": AMProfileModule.ACTION_ERROR_AM, + } + result[AMProfileModule.ERROR_NUM_AM] = AMProfileModule.ERROR_ID_ILLEGAL_ARGUMENT + result[AMProfileModule.ERROR_DESCRIPTION_AM] = 'setUserId() parameter id should be in the range [1, 2147483647(0x7FFFFFFF)]' + DeviceEventEmitter.emit(RCTModule.Event_Notify, result) + return + } + RCTModule.setUserId(mac, id) + }, + + /** + * Get user information + * @param {string} mac Device's mac address + */ + getUserInfo: function (mac) { + RCTModule.getUserInfo(mac) + }, + + /** + * Set user's BMR + * @param {string} mac Device's mac address + * @param {number} bmr User's BMR [1, 32767(0x7FFF)] + */ + setUserBmr: function (mac, bmr) { + RCTModule.setUserBmr(mac, bmr) + }, + + /** + * Get the activity data. + * @param {string} mac Device's mac address + */ + syncActivityData: function (mac) { + RCTModule.syncActivityData(mac) + }, + + /** + * Get the sleep data. + * @param {string} mac Device's mac address + */ + syncSleepData: function (mac) { + RCTModule.syncSleepData(mac) + }, + + /** + * Get current time activity data + * @param {string} mac Device's mac address + */ + syncRealData: function (mac) { + RCTModule.syncRealData(mac) + }, + + /** + * Set the system time to AM device. + * @param {string} mac Device's mac address + */ + syncRealTime: function (mac) { + RCTModule.syncRealTime(mac) + }, + + /** + * Set hour mode + * @param {string} mac Device's mac address + * @param {number} hourMode The value should be one of following: + * + */ + setHourMode: function (mac, hourMode) { + RCTModule.setHourMode(mac, hourMode) + }, + + /** + * Get hour mode + * @param {string} mac Device's mac address + */ + getHourMode: function (mac) { + RCTModule.getHourMode(mac) + }, + + /** + * Disconnect device + * @param {string} mac Device's mac address + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Set user information + * @param {string} mac Device's mac address + * @param {number} age User's age [1, 255] + * @param {number} height User's height(int in cm) [1, 255] + * @param {number} weight User's weight(float) [1.0, 255.0] + * @param {number} gender User's gender + * @param {number} unit Distance's unit type(kilometre or miles) + * @param {number} target The goal of maximum steps [4, 65535(0xFFFF)] + * @param {number} activityLevel The level of activity strength + */ + setUserInfo: function (mac, age, height, weight, gender, unit, target, activityLevel) { + RCTModule.setUserInfo(mac, age, height, weight, gender, unit, target, activityLevel) + }, + + /** + * Get stage report data + * @param {string} mac Device's mac address + */ + syncStageReportData: function (mac) { + RCTModule.syncStageReportData(mac) + }, + + /** + * Send random number to device to prepare for binding, the number will be displayed on the device. + * @param {string} mac Device's mac address + */ + sendRandom: function (mac) { + RCTModule.sendRandom(mac) + }, + + /** + * Get AM picture's index + * @param {string} mac Device's mac address + */ + getPicture: function (mac) { + RCTModule.getPicture(mac) + }, + + /** + * Set picture for AM + * @param {string} mac Device's mac address + * @param {number} index The index of picture + */ + setPicture: function (mac, index) { + RCTModule.setPicture(mac, index) + }, + + /** + * Get all connected AM3S device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, +} diff --git a/libs/ihealth-sdk/module/AM4Module.js b/libs/ihealth-sdk/module/AM4Module.js new file mode 100755 index 0000000..7cb44ff --- /dev/null +++ b/libs/ihealth-sdk/module/AM4Module.js @@ -0,0 +1,321 @@ +'use strict'; + + +var { + NativeModules, + DeviceEventEmitter +} = require('react-native'); + +var AMProfileModule = require('./AMProfileModule.js'); + +var RCTModule = NativeModules.AM4Module + +/** + * @module AM4Module + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Get AM4 device's IDPS information. + * @param {string} mac Device's mac address + */ + getIdps: function (mac) { + RCTModule.getIdps(mac) + }, + + /** + * Reset AM4 device. + * @param {string} mac Device's mac address + */ + reset: function (mac) { + RCTModule.reset(mac) + }, + + /** + * Get user's ID + * @param {string} mac Device's mac address + */ + getUserId: function (mac) { + RCTModule.getUserId(mac) + }, + + /** + * Get alarms' count + * @param {string} mac Device's mac address + */ + getAlarmClockNum: function (mac) { + RCTModule.getAlarmClockNum(mac) + }, + + /** + * Get alarm information by id + * @param {string} mac Device's mac address + * @param {array} alarmIDArray Alarm id array to be query.
+ * + */ + getAlarmClockDetail: function (mac, alarmIDArray) { + RCTModule.getAlarmClockDetail(mac, alarmIDArray) + }, + + /** + * Set alarm + * @param {string} mac Device's mac address + * @param {number} id Alarm id
+ * Range: 1, 2 or 3 + * @param {number} hour Alarm hour part
+ * Range: [0, 23] + * @param {number} min Alarm minute part
+ * Range: [0, 59] + * @param {boolean} isRepeat Indicates whether it will repeat: + * + * @param {array} weekArray The days in a week to repeat the alarm, week[0~6] indicates Sun~Sat.
+ * And 1 indicates open, 0 indicates close.
+ * For example:
+ * {0, 1, 1, 1, 1, 1, 0} means the alarm will repeat on Mon, Tue, Wed, Thu, Fri. + * @param {boolean} isOn true if want to set the alarm, false to unset it. + */ + setAlarmClock: function (mac, id, hour, min, isRepeat, weekArray, isOn) { + RCTModule.setAlarmClock(mac, id, hour, min, isRepeat, weekArray, isOn) + }, + + /** + * Delete alarm by id + * @param {string} mac Device's mac address + * @param {number} id Alarm id(should be 1, 2 or 3) + */ + deleteAlarmClock: function (mac, id) { + RCTModule.deleteAlarmClock(mac, id) + }, + + /** + * Get activity remind setting. + * @param {string} mac Device's mac address + */ + getActivityRemind: function (mac) { + RCTModule.getActivityRemind(mac) + }, + + /** + * Set/Unset activity remind + * @param {string} mac Device's mac address + * @param {number} hour Activity remind hour part
+ * Range: [0, 23] + * @param {number} min Activity remind minute part
+ * Range:[0, 59] + * @param {boolean} isOn true if want to set activity remind, false to unset it. + */ + setActivityRemind: function (mac, hour, min, isOn) { + RCTModule.setActivityRemind(mac, hour, min, isOn) + }, + + /** + * Get device state and battery information + * @param {string} mac Device's mac address + */ + queryAMState: function (mac) { + RCTModule.queryAMState(mac) + }, + + /** + * Set user ID + * @param {string} mac Device's mac address + * @param {number} id new user id
+ * Range: [1, 2147483647(0x7FFFFFFF)] + */ + setUserId: function (mac, id) { + if (id < 1 || id > 0x7FFFFFFF) { + let result = { + "mac": mac, + "type": "AM4", + "action" : AMProfileModule.ACTION_ERROR_AM, + } + result[AMProfileModule.ERROR_NUM_AM] = AMProfileModule.ERROR_ID_ILLEGAL_ARGUMENT + result[AMProfileModule.ERROR_DESCRIPTION_AM] = 'setUserId() parameter id should be in the range [1, 2147483647(0x7FFFFFFF)]' + DeviceEventEmitter.emit(RCTModule.Event_Notify, result) + return + } + RCTModule.setUserId(mac, id) + }, + + /** + * Get user information + * @param {string} mac Device's mac address + */ + getUserInfo: function (mac) { + RCTModule.getUserInfo(mac) + }, + + /** + * Set user's BMR + * @param {string} mac Device's mac address + * @param {number} bmr User's BMR
+ * Range: [1, 32767(0x7FFF)] + */ + setUserBmr: function (mac, bmr) { + RCTModule.setUserBmr(mac, bmr) + }, + + /** + * Get the activity data. + * @param {string} mac Device's mac address + */ + syncActivityData: function (mac) { + RCTModule.syncActivityData(mac) + }, + + /** + * Get the sleep data. + * @param {string} mac Device's mac address + */ + syncSleepData: function (mac) { + RCTModule.syncSleepData(mac) + }, + + /** + * Get current time activity data. + * @param {string} mac Device's mac address + */ + syncRealData: function (mac) { + RCTModule.syncRealData(mac) + }, + + /** + * Set the system time to AM device. + * @param {string} mac Device's mac address + */ + syncRealTime: function (mac) { + RCTModule.syncRealTime(mac) + }, + + /** + * Set hour mode + * @param {string} mac Device's mac address + * @param {number} hourMode The value should be one of following: + * + */ + setHourMode: function (mac, hourMode) { + RCTModule.setHourMode(mac, hourMode) + }, + + /** + * Get hour mode + * @param {string} mac Device's mac address + */ + getHourMode: function (mac) { + RCTModule.getHourMode(mac) + }, + + /** + * Disconnect device + * @param {string} mac Device's mac address + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Set user information + * @param {string} mac Device's mac address + * @param {number} age User's age
+ * Range: [1, 255] + * @param {number} height User's height(int in cm)
+ * Range: [1, 255] + * @param {number} weight User's weight(float)
+ * Range: [1.0, 255.0] + * @param {number} gender User's gender
+ * Value: + * + * @param {number} unit Distance's unit type(kilometre or miles)
+ * Value: + * + * @param {number} target The goal of maximum steps
+ * Range: [4, 2147483647(0x7FFFFFFF)] + * @param {number} activityLevel The level of activity strength
+ * + * @param {number} min swim target time(in minutes)
+ * Range: [1, 1439(23 * 60 + 59)] + */ + setUserInfo: function (mac, age, height, weight, gender, unit, target, activityLevel, min) { + RCTModule.setUserInfo(mac, age, height, weight, gender, unit, target, activityLevel, min) + }, + + /** + * Get stage report data + * @param {string} mac Device's mac address + */ + syncStageReportData: function (mac) { + RCTModule.syncStageReportData(mac) + }, + + /** + * Send random number to device to prepare for binding, the number will be displayed on the device. + * @param {string} mac Device's mac address + */ + sendRandom: function (mac) { + RCTModule.sendRandom(mac) + }, + + /** + * Get swim parameters + * @param {string} mac Device's mac address + */ + checkSwimPara: function (mac) { + RCTModule.checkSwimPara(mac) + }, + + /** + * Set swim parameters + * @param {string} mac Device's mac address + * @param {boolean} isOpen Set true to open swim function, set false to close it. + * @param {number} poolLength the swimming pool's length.
+ * Range: [1, 255] + * @param {number} hours The cut out time's hour part
+ * Range: [0, 23] + * @param {number} minutes The cut out time's minute part
+ * Range[0, 59] + * @param {number} unit The pool length's unit type(metre or yard). + * + */ + setSwimPara: function (mac, isOpen, poolLength, hours, minutes, unit) { + RCTModule.setSwimPara(mac, isOpen, poolLength, hours, minutes, unit) + }, + + /** + * Get all connected AM4 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, +} diff --git a/libs/ihealth-sdk/module/AM5Module.js b/libs/ihealth-sdk/module/AM5Module.js new file mode 100755 index 0000000..ab9f0ae --- /dev/null +++ b/libs/ihealth-sdk/module/AM5Module.js @@ -0,0 +1,150 @@ +'use strict'; + + +var { + NativeModules, + DeviceEventEmitter +} = require('react-native'); + +var AM5ProfileModule = require('./AM5ProfileModule.js'); + +var RCTModule = NativeModules.AM5Module + +/** + * @module AM5Module + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Binding apps and devices. + * AM5 devices must be bound one-to-one. If you want to use other devices, you must unbind them first and then bind them to other devices. + * @param {string} mac Device's mac address + */ + bindDevice: function (mac) { + RCTModule.bindDevice(mac) + }, + + /** + * UnBind apps and devices. + * @param {string} mac Device's mac address + */ + unBindDevice: function (mac) { + RCTModule.unBindDevice(mac) + }, + + /** + * Get information of the device + * @param {string} mac Device's mac address + */ + getBasicInfo: function (mac) { + RCTModule.getBasicInfo(mac) + }, + +// /** +// * Set time of the device +// * @param year year +// * @param month month +// * @param day day +// * @param hour hour +// * @param minute minute +// * @param second second +// * @param week What day is today? Effective Value 1-7 +// */ +// setTime: function (mac, year, month, day, minute, second, week) { +// RCTModule.setTime(mac, year, month, day, minute, second, week) +// }, + + /** + * Set current time of the device + */ + setTime: function (mac) { + RCTModule.setTime(mac) + }, + + /** + * Get the live data of the device + * @param {string} mac Device's mac address + * @param year Year of birth + * @param month Month of birth + * @param day Day of birth + * @param weight weight + * @param height height + * @param gander gender male: 1, female: 2 + */ + setUserInfo: function (mac, year, month, day, weight, height, gander) { + RCTModule.setUserInfo(mac, year, month, day, weight, height, gander) + }, + + /** + * Set unit + * When you never set them, treat them as defaults + * @param {string} mac Device's mac address + * @param type 0: Distance unit unit: 0 default ; 1 KM ; 2 MI + * @param type 1: Wight unit unit: 0 default ; 1 KG ; 2 LB ; 3 ST + * @param type 2: Temperature unit unit: 0 default ; 1 °C ; 2 °F + * @param type 3: Distance at each step unit: distance (cm) (default 0cm) + * @param type 4: Language unit: 0 default ; 1 zh ; 2 en ; 3 fr ; 4 de ; 5 it ; 6 es ; 7 ja ; 8 po ; 9 cz + * @param type 5: Time Mode unit: 0 default ; 1 24 hour system ; 2 12 hour system + * @param type 6: Distance at each step of run unit: distance (cm) (default 0cm) + * @param type 7: GPS calibration switch unit: 0 default ; 1 open ; 2 close + */ + setUnit: function (mac, type, unit) { + RCTModule.setUnit(mac, type, unit) + }, + + /** + * Reboot the device + * @param {string} mac Device's mac address + */ + reboot: function (mac) { + RCTModule.reboot(mac) + }, + + /** + * Set Hand Wear Mode + * @param {string} mac Device's mac address + * @param mode 0 left-hand 1 right-hand + */ + setHandWearMode: function (mac, mode) { + RCTModule.setHandWearMode(mac, mode) + }, + + /** + * Get the live data of the device + * @param {string} mac Device's mac address + */ + getLiveData: function (mac) { + RCTModule.getLiveData(mac) + }, + + /** + * Sync health data from device + * @param {string} mac Device's mac address + */ + syncHealthData: function (mac) { + RCTModule.syncHealthData(mac) + }, + + /** + * Stop sync health data from device + * @param {string} mac Device's mac address + */ + stopSyncHealthData: function (mac) { + RCTModule.stopSyncHealthData(mac) + }, + + /** + * Get all connected AM4 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, + + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, +} diff --git a/libs/ihealth-sdk/module/AM5ProfileModule.js b/libs/ihealth-sdk/module/AM5ProfileModule.js new file mode 100755 index 0000000..00621ea --- /dev/null +++ b/libs/ihealth-sdk/module/AM5ProfileModule.js @@ -0,0 +1,68 @@ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.AM5ProfileModule + +/** + * @module AM5ProfileModule + */ +module.exports = { + + ACTION_ERROR: RCTModule.ACTION_ERROR, + ERROR_NUM: RCTModule.ERROR_NUM, + ERROR_DESCRIPTION: RCTModule.ERROR_DESCRIPTION, + + ACTION_USER_BIND: RCTModule.ACTION_ERROR, + ACTION_USER_UNBIND: RCTModule.ACTION_ERROR, + ACTION_FUNCTION_SUPPORT: RCTModule.ACTION_ERROR, + ACTION_BASIC_INFO: RCTModule.ACTION_ERROR, + ACTION_MAC_ADDRESS: RCTModule.ACTION_ERROR, + + MAC_ADDRESS: RCTModule.MAC_ADDRESS, + BASIC_BATTSTATUS: RCTModule.BASIC_BATTSTATUS, + BASIC_DEIVCEID: RCTModule.BASIC_DEIVCEID, + BASIC_ENERGE: RCTModule.BASIC_ENERGE, + BASIC_FIRMWAREVERSION: RCTModule.BASIC_FIRMWAREVERSION, + BASIC_MODE: RCTModule.BASIC_MODE, + BASIC_PAIRFLAG: RCTModule.BASIC_PAIRFLAG, + BASIC_REBOOT: RCTModule.BASIC_REBOOT, + + ACTION_LIVE_DATA: RCTModule.ACTION_LIVE_DATA, + ACTION_ACTIVITY_COUNT: RCTModule.ACTION_ACTIVITY_COUNT, + ACTION_SET_TIME: RCTModule.ACTION_SET_TIME, + ACTION_SET_ALARM: RCTModule.ACTION_SET_ALARM, + ACTION_SET_GOAL: RCTModule.ACTION_SET_GOAL, + ACTION_SET_LONG_SIT: RCTModule.ACTION_SET_LONG_SIT, + ACTION_SET_USER_INFO: RCTModule.ACTION_SET_USER_INFO, + ACTION_SET_UNIT: RCTModule.ACTION_SET_UNIT, + ACTION_SET_HAND_WEAR_MODE: RCTModule.ACTION_SET_HAND_WEAR_MODE, + ACTION_SET_UP_HAND_GESTURE: RCTModule.ACTION_SET_UP_HAND_GESTURE, + ACTION_SET_HEART_RATE_INTERVAL: RCTModule.ACTION_SET_HEART_RATE_INTERVAL, + ACTION_SET_HEART_RATE_MEASURE_MODE: RCTModule.ACTION_SET_HEART_RATE_MEASURE_MODE, + ACTION_SET_ONE_KEY_RESET: RCTModule.ACTION_SET_ONE_KEY_RESET, + ACTION_SET_NOT_DISTURB: RCTModule.ACTION_SET_NOT_DISTURB, + ACTION_SET_SPORT_MODE: RCTModule.ACTION_SET_SPORT_MODE, + + OPERATION_RESULT: RCTModule.OPERATION_RESULT, + OPERATION_ACTION: RCTModule.OPERATION_ACTION, + + ACTION_NOTICE_COMMING_CALL: RCTModule.ACTION_NOTICE_COMMING_CALL, + ACTION_NOTICE_COMMING_CALL_STOP: RCTModule.ACTION_NOTICE_COMMING_CALL_STOP, + ACTION_NOTICE_NEW_MESSAGE: RCTModule.ACTION_NOTICE_NEW_MESSAGE, + + ACTION_SYNC_ACTIVITY: RCTModule.ACTION_SYNC_ACTIVITY, + ACTION_SYNC_ACTIVITY_DATA: RCTModule.ACTION_SYNC_ACTIVITY_DATA, + ACTION_SYNC_CONFIG: RCTModule.ACTION_SYNC_CONFIG, + ACTION_SYNC_HEALTH_DATA: RCTModule.ACTION_SYNC_HEALTH_DATA, + ACTION_SYNC_HEALTH_DATA_SPORT: RCTModule.ACTION_SYNC_HEALTH_DATA_SPORT, + ACTION_SYNC_HEALTH_DATA_SLEEP: RCTModule.ACTION_SYNC_HEALTH_DATA_SLEEP, + ACTION_SYNC_HEALTH_DATA_HEART_RATE: RCTModule.ACTION_SYNC_HEALTH_DATA_HEART_RATE, + ACTION_SYNC_HEALTH_DATA_BLOOD_PRESSURE: RCTModule.ACTION_SYNC_HEALTH_DATA_BLOOD_PRESSURE, + + OPERATION_STATUS: RCTModule.OPERATION_STATUS, + PROGRESS: RCTModule.PROGRESS, + + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/AMProfileModule.js b/libs/ihealth-sdk/module/AMProfileModule.js new file mode 100755 index 0000000..facb98b --- /dev/null +++ b/libs/ihealth-sdk/module/AMProfileModule.js @@ -0,0 +1,463 @@ +/** + * Created by Jeepend on 15/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.AMProfileModule + +/** + * @module AMProfileModule + */ +module.exports = { + + ACTION_ERROR_AM: RCTModule.ACTION_ERROR_AM, + ACTION_RESET_AM: RCTModule.ACTION_RESET_AM, + ACTION_USERID_AM: RCTModule.ACTION_USERID_AM, + ACTION_SET_USERID_SUCCESS_AM: RCTModule.ACTION_SET_USERID_SUCCESS_AM, + ACTION_SYNC_TIME_SUCCESS_AM: RCTModule.ACTION_SYNC_TIME_SUCCESS_AM, + ACTION_SET_USERINFO_SUCCESS_AM: RCTModule.ACTION_SET_USERINFO_SUCCESS_AM, + ACTION_GET_USERINFO_AM: RCTModule.ACTION_GET_USERINFO_AM, + ACTION_GET_ALARMNUM_AM: RCTModule.ACTION_GET_ALARMNUM_AM, + ACTION_GET_ALARMINFO_AM: RCTModule.ACTION_GET_ALARMINFO_AM, + ACTION_SET_ALARMINFO_SUCCESS_AM: RCTModule.ACTION_SET_ALARMINFO_SUCCESS_AM, + ACTION_DELETE_ALARM_SUCCESS_AM: RCTModule.ACTION_DELETE_ALARM_SUCCESS_AM, + ACTION_GET_ACTIVITY_REMIND_AM: RCTModule.ACTION_GET_ACTIVITY_REMIND_AM, + ACTION_SET_ACTIVITYREMIND_SUCCESS_AM: RCTModule.ACTION_SET_ACTIVITYREMIND_SUCCESS_AM, + ACTION_SYNC_ACTIVITY_DATA_AM: RCTModule.ACTION_SYNC_ACTIVITY_DATA_AM, + ACTION_SYNC_SLEEP_DATA_AM: RCTModule.ACTION_SYNC_SLEEP_DATA_AM, + ACTION_SYNC_STAGE_DATA_AM: RCTModule.ACTION_SYNC_STAGE_DATA_AM, + ACTION_QUERY_STATE_AM: RCTModule.ACTION_QUERY_STATE_AM, + ACTION_SYNC_REAL_DATA_AM: RCTModule.ACTION_SYNC_REAL_DATA_AM, + ACTION_SET_BMR_SUCCESS_AM: RCTModule.ACTION_SET_BMR_SUCCESS_AM, + ACTION_GET_SWIMINFO_AM: RCTModule.ACTION_GET_SWIMINFO_AM, + ACTION_SET_SWIMINFO_AM: RCTModule.ACTION_SET_SWIMINFO_AM, + ACTION_GET_RANDOM_AM: RCTModule.ACTION_GET_RANDOM_AM, + ACTION_SET_HOUR_MODE_SUCCESS_AM: RCTModule.ACTION_SET_HOUR_MODE_SUCCESS_AM, + ACTION_GET_HOUR_MODE_AM: RCTModule.ACTION_GET_HOUR_MODE_AM, + ACTION_SET_DEVICE_MODE_AM: RCTModule.ACTION_SET_DEVICE_MODE_AM, + ACTION_CLOUD_BINDING_AM_SUCCESS: RCTModule.ACTION_CLOUD_BINDING_AM_SUCCESS, + ACTION_CLOUD_BINDING_AM_FAIL: RCTModule.ACTION_CLOUD_BINDING_AM_FAIL, + ACTION_CLOUD_UNBINDING_AM_SUCCESS: RCTModule.ACTION_CLOUD_UNBINDING_AM_SUCCESS, + ACTION_CLOUD_UNBINDING_AM_FAIL: RCTModule.ACTION_CLOUD_UNBINDING_AM_FAIL, + ACTION_CLOUD_SEARCH_AM: RCTModule.ACTION_CLOUD_SEARCH_AM, + ACTION_CLOUD_SEARCH_FAIL_AM: RCTModule.ACTION_CLOUD_SEARCH_FAIL_AM, + ACTION_SET_PICTURE_SUCCESS_AM: RCTModule.ACTION_SET_PICTURE_SUCCESS_AM, + ACTION_GET_PICTURE_AM: RCTModule.ACTION_GET_PICTURE_AM, + + // Keys + ERROR_NUM_AM: RCTModule.ERROR_NUM_AM, + ERROR_ID_ILLEGAL_ARGUMENT: RCTModule.ERROR_ID_ILLEGAL_ARGUMENT, + ERROR_ID_VERSION_NOT_SUPPORT: RCTModule.ERROR_ID_VERSION_NOT_SUPPORT, + ERROR_DESCRIPTION_AM: RCTModule.ERROR_DESCRIPTION_AM, + RESET_AM: RCTModule.RESET_AM, + USERID_AM: RCTModule.USERID_AM, + GET_USER_AGE_AM: RCTModule.GET_USER_AGE_AM, + GET_USER_STEP_AM: RCTModule.GET_USER_STEP_AM, + GET_USER_HEIGHT_AM: RCTModule.GET_USER_HEIGHT_AM, + GET_USER_SEX_AM: RCTModule.GET_USER_SEX_AM, + GET_USER_WEIGHT_AM: RCTModule.GET_USER_WEIGHT_AM, + GET_USER_UNIT_AM: RCTModule.GET_USER_UNIT_AM, + GET_USER_TARGET1_AM: RCTModule.GET_USER_TARGET1_AM, + GET_USER_TARGET2_AM: RCTModule.GET_USER_TARGET2_AM, + GET_USER_TARGET3_AM: RCTModule.GET_USER_TARGET3_AM, + GET_USER_SWIMTARGET_AM: RCTModule.GET_USER_SWIMTARGET_AM, + GET_ALARMNUM_AM: RCTModule.GET_ALARMNUM_AM, + GET_ALARMNUM_ID_AM: RCTModule.GET_ALARMNUM_ID_AM, + GET_ALARM_CLOCK_DETAIL: RCTModule.GET_ALARM_CLOCK_DETAIL, + GET_ALARM_ID_AM: RCTModule.GET_ALARM_ID_AM, + GET_ALARM_TIME_AM: RCTModule.GET_ALARM_TIME_AM, + GET_ALARM_ISREPEAT_AM: RCTModule.GET_ALARM_ISREPEAT_AM, + GET_ALARM_WEEK_AM: RCTModule.GET_ALARM_WEEK_AM, + GET_ALARM_WEEK_SUNDAY_AM: RCTModule.GET_ALARM_WEEK_SUNDAY_AM, + GET_ALARM_WEEK_MONDAY_AM: RCTModule.GET_ALARM_WEEK_MONDAY_AM, + GET_ALARM_WEEK_TUESDAY_AM: RCTModule.GET_ALARM_WEEK_TUESDAY_AM, + GET_ALARM_WEEK_WEDNESDAY_AM: RCTModule.GET_ALARM_WEEK_WEDNESDAY_AM, + GET_ALARM_WEEK_THURSDAY_AM: RCTModule.GET_ALARM_WEEK_THURSDAY_AM, + GET_ALARM_WEEK_FRIDAY_AM: RCTModule.GET_ALARM_WEEK_FRIDAY_AM, + GET_ALARM_WEEK_SATURDAY_AM: RCTModule.GET_ALARM_WEEK_SATURDAY_AM, + GET_ALARM_ISON_AM: RCTModule.GET_ALARM_ISON_AM, + GET_ACTIVITY_REMIND_TIME_AM: RCTModule.GET_ACTIVITY_REMIND_TIME_AM, + GET_ACTIVITY_REMIND_ISON_AM: RCTModule.GET_ACTIVITY_REMIND_ISON_AM, + /** + * The key of the whole activity data.("activity") + */ + SYNC_ACTIVITY_DATA_AM: RCTModule.SYNC_ACTIVITY_DATA_AM, + /** + * The key of the time for every 5 min activity data.("time")
+ * Value format:
+ * yyyy-MM-dd HH:mm:ss
+ * Example:
+ * 2016-07-18 09:00:00 + */ + SYNC_ACTIVITY_DATA_TIME_AM: RCTModule.SYNC_ACTIVITY_DATA_TIME_AM, + /** + * The key of the step number for every 5 min activity data.("step")
+ * Value range:
+ * 0-4294967295(0xFFFFFFFF) + */ + SYNC_ACTIVITY_DATA_STEP_AM: RCTModule.SYNC_ACTIVITY_DATA_STEP_AM, + /** + * The key of the step length for every 5 min activity data.("stepsize")
+ * Value range:
+ * 0-255(0xFF) + */ + SYNC_ACTIVITY_DATA_STEP_LENGTH_AM: RCTModule.SYNC_ACTIVITY_DATA_STEP_LENGTH_AM, + /** + * The key of the calorie for every 5 min activity data.("calorie")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_ACTIVITY_DATA_CALORIE_AM: RCTModule.SYNC_ACTIVITY_DATA_CALORIE_AM, + /** + * The key of the whole data for every 5 min activity data.("activity_each_data") + */ + SYNC_ACTIVITY_EACH_DATA_AM: RCTModule.SYNC_ACTIVITY_EACH_DATA_AM, + /** + * The key of the whole sleep data.("sleep") + */ + SYNC_SLEEP_DATA_AM: RCTModule.SYNC_SLEEP_DATA_AM, + /** + * The key of the each 5 minute's sleep time.("time")
+ * Value format:
+ * yyyy-MM-dd HH:mm:ss + */ + SYNC_SLEEP_DATA_TIME_AM: RCTModule.SYNC_SLEEP_DATA_TIME_AM, + /** + * The key of the each 5 minute's sleep level.("level")
+ * Value:
+ * + */ + SYNC_SLEEP_DATA_LEVEL_AM: RCTModule.SYNC_SLEEP_DATA_LEVEL_AM, + SYNC_SLEEP_EACH_DATA_AM: RCTModule.SYNC_SLEEP_EACH_DATA_AM, + /** + * The key of data array of the stage data.("stage_data") + */ + SYNC_STAGE_DATA_AM: RCTModule.SYNC_STAGE_DATA_AM, + SYNC_STAGE_DATA_TYPE_AM: RCTModule.SYNC_STAGE_DATA_TYPE_AM, + /** + * Type of work out.("stage_data_type_workout") + */ + SYNC_STAGE_DATA_TYPE_WORKOUT_AM: RCTModule.SYNC_STAGE_DATA_TYPE_WORKOUT_AM, + /** + * Type of sleep.("sleep") + */ + SYNC_STAGE_DATA_TYPE_SLEEP_AM: RCTModule.SYNC_STAGE_DATA_TYPE_SLEEP_AM, + /** + * Type of swim.("swim") + */ + SYNC_STAGE_DATA_TYPE_SWIM_AM: RCTModule.SYNC_STAGE_DATA_TYPE_SWIM_AM, + /** + * Type of page view summary.("page_view_summary") + */ + SYNC_STAGE_DATA_TYPE_PAGE_VIEW_SUMMARY: RCTModule.SYNC_STAGE_DATA_TYPE_PAGE_VIEW_SUMMARY, + /** + * The key of stage report stop time.("stoptime")
+ * Value format:
+ * yyyy-MM-dd HH:mm:ss + */ + SYNC_STAGE_DATA_STOP_TIME_AM: RCTModule.SYNC_STAGE_DATA_STOP_TIME_AM, + /** + * The key of stage report used time(in minutes).("usedtime")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_USED_TIME_AM: RCTModule.SYNC_STAGE_DATA_USED_TIME_AM, + /** + * The key of the step number of work out.("stage_data_workout_step")
+ * Value range:
+ * 0-4294967295(0xFFFFFFFF) + */ + SYNC_STAGE_DATA_WORKOUT_STEP_AM: RCTModule.SYNC_STAGE_DATA_WORKOUT_STEP_AM, + /** + * The key of the distance.("stage_data_distance")
+ * It's string type
+ * Value format&range:
+ * "123.456"("0.0"-"255.255"(0xFF.0xFF)) + */ + SYNC_STAGE_DATA_DISTANCE_AM: RCTModule.SYNC_STAGE_DATA_DISTANCE_AM, + /** + * The key of the calorie.("calorie")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_CALORIE_AM: RCTModule.SYNC_STAGE_DATA_CALORIE_AM, + /** + * The key of sleep efficiency.("sleepefficiency")
+ * Value range:
+ * 0.0-100.0 + */ + SYNC_STAGE_DATA_SLEEP_EFFICIENCY_AM: RCTModule.SYNC_STAGE_DATA_SLEEP_EFFICIENCY_AM, + /** + * The key of whether need to extend sleep 50 minutes or not.("is50min")
+ * Value:
+ * + */ + SYNC_STAGE_DATA_SLEEP_IS50MIN_AM: RCTModule.SYNC_STAGE_DATA_SLEEP_IS50MIN_AM, + /** + * The key of swim stroke.("swimming stroke")
+ * Value:
+ * + */ + SYNC_STAGE_DATA_SWIM_STROKE_AM: RCTModule.SYNC_STAGE_DATA_SWIM_STROKE_AM, + /** + * The key of swim arm pulling time.("number of strokes")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_SWIM_PULL_TIMES_AM: RCTModule.SYNC_STAGE_DATA_SWIM_PULL_TIMES_AM, + /** + * The key of swim round number.("number of turns")
+ * Value range:
+ * 0-255(0xFF) + */ + SYNC_STAGE_DATA_SWIM_TURNS_AM: RCTModule.SYNC_STAGE_DATA_SWIM_TURNS_AM, + /** + * The key of the swimming pool length.("stage_data_swimpool_length")
+ * Value range:
+ * 0-255(0xFF) + */ + SYNC_STAGE_DATA_SWIMPOOL_LENGTH_AM: RCTModule.SYNC_STAGE_DATA_SWIMPOOL_LENGTH_AM, + /** + * The key of the time of cut in swim and begin swim(in minutes).("stage_data_cutindif")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_SWIM_CUTINDIF_AM: RCTModule.SYNC_STAGE_DATA_SWIM_CUTINDIF_AM, + /** + * The key of the time of cut out swim and end swim(in minutes).("stage_data_cutoutdif")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_SWIM_CUTOUTDIF_AM: RCTModule.SYNC_STAGE_DATA_SWIM_CUTOUTDIF_AM, + /** + * The key of the swim process flag.("stage_data_processflag")
+ * Value:
+ * + */ + SYNC_STAGE_DATA_SWIM_PROCESSFLAG_AM: RCTModule.SYNC_STAGE_DATA_SWIM_PROCESSFLAG_AM, + /** + * The key of the date of page view summary.("stage_data_view_summary_date")
+ * Value format:
+ * yyyy-MM-dd + */ + SYNC_STAGE_DATA_VIEW_SUMMARY_DATE_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_DATE_AM, + /** + * The key of the count that user view the step page.("stage_data_view_summary_step")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_VIEW_SUMMARY_STEP_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_STEP_AM, + /** + * The key of the count that user view the distance page.("stage_data_view_summary_distance")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_VIEW_SUMMARY_DISTANCE_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_DISTANCE_AM, + /** + * The key of the count that user view the calorie page.("stage_data_view_summary_calorie")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_VIEW_SUMMARY_CALORIE_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_CALORIE_AM, + /** + * The key of the count that user view the activity target page.("stage_data_view_summary_target")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_VIEW_SUMMARY_TARGET_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_TARGET_AM, + /** + * The key of the count that user view the swim summary page.("stage_data_view_summary_swim")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_STAGE_DATA_VIEW_SUMMARY_SWIM_AM: RCTModule.SYNC_STAGE_DATA_VIEW_SUMMARY_SWIM_AM, + /** + * The key of state information.("query_state")
+ * Value:
+ * + */ + QUERY_STATE_AM: RCTModule.QUERY_STATE_AM, + /** + * The key of battery level.("battery")
+ * Value range:
+ * 0-10(10 indicates full) + */ + QUERY_BATTERY_AM: RCTModule.QUERY_BATTERY_AM, + /** + * The key of the real step count.("step")
+ * Value range:
+ * 0-4294967295(0xFFFFFFFF) + */ + SYNC_REAL_STEP_AM: RCTModule.SYNC_REAL_STEP_AM, + /** + * The key of the real calorie(not including BMR).("calorie")
+ * Value range:
+ * 0-65535(0xFFFF) + */ + SYNC_REAL_CALORIE_AM: RCTModule.SYNC_REAL_CALORIE_AM, + /** + * The key of the real summary calorie(including BMR).("totalcalories")
+ * Value range:
+ * 0-65535 + BMR(0xFFFF + BMR) + */ + SYNC_REAL_TOTALCALORIE_AM: RCTModule.SYNC_REAL_TOTALCALORIE_AM, + /** + * The key of swimming lane length.("get_swimlane_length")
+ * Value range:
+ * 0-255(0xFF) + */ + GET_SWIMLANE_LENGTH_AM: RCTModule.GET_SWIMLANE_LENGTH_AM, + /** + * The key of whether the swim function is open or not.("get_swim_switch_am")
+ * Value:
+ * + */ + GET_SWIM_SWITCH_AM: RCTModule.GET_SWIM_SWITCH_AM, + /** + * The key of the hour part of cut out swim function.("get_swim_cutout_hour_am")
+ * Value range:
+ * 0-255(0xFF) + */ + GET_SWIM_CUTOUT_HOUR_AM: RCTModule.GET_SWIM_CUTOUT_HOUR_AM, + /** + * The key of the minute part of cut out swim function.("get_swim_cutout_min_am")
+ * Value range:
+ * 0-255(0xFF) + */ + GET_SWIM_CUTOUT_MINUTE_AM: RCTModule.GET_SWIM_CUTOUT_MINUTE_AM, + /** + * The key of swim unit type.("get_swim_unit_am")
+ * Value:
+ * + */ + GET_SWIM_UNIT_AM: RCTModule.GET_SWIM_UNIT_AM, + /** + * The key of the random number sent to device.("random")
+ * The value will be a 6-long number decimal string.
+ * Value range:
+ * "000000"-"999999" + */ + GET_RANDOM_AM: RCTModule.GET_RANDOM_AM, + AM_SWITCH_OPEN: RCTModule.AM_SWITCH_OPEN, + AM_SWITCH_CLOSE: RCTModule.AM_SWITCH_CLOSE, + AM_SWITCH_REPEAT: RCTModule.AM_SWITCH_REPEAT, + AM_SEITCH_NOT_REPEAT: RCTModule.AM_SEITCH_NOT_REPEAT, + /** + * The value indicates male.(1) + */ + AM_SET_MALE: RCTModule.AM_SET_MALE, + /** + * The value indicates female.(0) + */ + AM_SET_FEMALE: RCTModule.AM_SET_FEMALE, + /** + * The value indicates metric unit type(kilometre/metre).(1) + */ + AM_SET_UNIT_METRIC: RCTModule.AM_SET_UNIT_METRIC, + /** + * The value indicates imperial standard unit type(miles/yard).(0) + */ + AM_SET_UNIT_IMPERIAL_STANDARD: RCTModule.AM_SET_UNIT_IMPERIAL_STANDARD, + /** + * The value indicates whole world 12 hour mode(0) + */ + AM_SET_12_HOUR_MODE: RCTModule.AM_SET_12_HOUR_MODE, + /** + * The value indicates whole world 24 hour mode(1) + */ + AM_SET_24_HOUR_MODE: RCTModule.AM_SET_24_HOUR_MODE, + /** + * The value indicates Europe world 12 hour mode(3) + */ + AM_SET_EUROPE_12_HOUR_MODE: RCTModule.AM_SET_EUROPE_12_HOUR_MODE, + /** + * The value indicates Europe world 24 hour mode(5) + */ + AM_SET_EUROPE_24_HOUR_MODE: RCTModule.AM_SET_EUROPE_24_HOUR_MODE, + /** + * The value indicates except Europe world 12 hour mode(2) + */ + AM_SET_EXCEPT_EUROPE_12_HOUR_MODE: RCTModule.AM_SET_EXCEPT_EUROPE_12_HOUR_MODE, + /** + * The value indicates except Europe world 24 hour mode(4) + */ + AM_SET_EXCEPT_EUROPE_24_HOUR_MODE: RCTModule.AM_SET_EXCEPT_EUROPE_24_HOUR_MODE, + /** + * The key of the time mdoe.
+ * Value:
+ * + */ + GET_HOUR_MODE_AM: RCTModule.GET_HOUR_MODE_AM, + /** + * Indicates device is sleep mode.(0) + */ + AM_DEVICE_MODE_SLEEP: RCTModule.AM_DEVICE_MODE_SLEEP, + /** + * Indicates device is activity mode.(1) + */ + AM_DEVICE_MODE_ACTIVITY: RCTModule.AM_DEVICE_MODE_ACTIVITY, + /** + * Indicates device is flight mode.(2) + */ + AM_DEVICE_MODE_FLIGHT: RCTModule.AM_DEVICE_MODE_FLIGHT, + /** + * Indicates device is driving mode.(3) + */ + AM_DEVICE_MODE_DRIVING: RCTModule.AM_DEVICE_MODE_DRIVING, + CLOUD_SEARCH_AM: RCTModule.CLOUD_SEARCH_AM, + /** + * The key of the MD5 hash of the data.("dataID") + */ + DATAID: RCTModule.DATAID, + /** + * The key of the picture index.("get_picture_am")
+ * Value:
+ * + */ + GET_PICTURE_AM: RCTModule.GET_PICTURE_AM, + + /** + * Indicates get all connected devices. + */ + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/BG1Module.js b/libs/ihealth-sdk/module/BG1Module.js new file mode 100755 index 0000000..ed55f2c --- /dev/null +++ b/libs/ihealth-sdk/module/BG1Module.js @@ -0,0 +1,40 @@ +'use strict'; + + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.BG1Module + +/** + * @module BG1Module + */ +module.exports = { + Event_Notify: RCTModule.Event_Notify, + + /** + * Send code to bg1 device + * @param {string} QRCode the result string of scanning strip bottle(ignore if use GDH strip) + * @param {int} stripType 1:GOD 2:GDH + * @param {int} measureType 1:Test with Blood 2:Test with control liquid (CTL) + */ + sendCode: function(QRCode, stripType, measureType) { + if (RCTModule != null) { + RCTModule.sendCode(QRCode, stripType, measureType); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Parse bottle info from QRCode, include strip expire time,strip number,bottle id + * @param {string} QRCode + */ + getBottleInfoFromQR: function(QRCode){ + if (RCTModule != null) { + RCTModule.getBottleInfoFromQR(QRCode); + }else { + console.log('~~~~~ RCTModule is null') + } + } + +} diff --git a/libs/ihealth-sdk/module/BG1ProfileModule.js b/libs/ihealth-sdk/module/BG1ProfileModule.js new file mode 100755 index 0000000..02f39dc --- /dev/null +++ b/libs/ihealth-sdk/module/BG1ProfileModule.js @@ -0,0 +1,90 @@ +'use strict'; + + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.BG1ProfileModule + +/** + * @module BG1ProfileModule + */ +module.exports = { + + /** + * Callback indicating the send code result of bg1 device. + */ + ACTION_BG1_SENDCODE_RESULT:RCTModule.ACTION_BG1_SENDCODE_RESULT, + + /** + * The send code result of bg1 device. + * value : 0 success; other error + */ + BG1_SENDCODE_RESULT:RCTModule.BG1_SENDCODE_RESULT, + + /** + * Callback indicating the error of Bg1 device. + */ + ACTION_BG1_MEASURE_ERROR:RCTModule.ACTION_BG1_MEASURE_ERROR, + + /** + * Flag Error number of Bg1 device. + */ + BG1_MEASURE_ERROR:RCTModule.BG1_MEASURE_ERROR, + + /** + * Callback indicating the strip in action. + */ + ACTION_BG1_MEASURE_STRIP_IN:RCTModule.ACTION_BG1_MEASURE_STRIP_IN, + + /** + * Callback indicating the get blood action. + */ + ACTION_BG1_MEASURE_GET_BLOOD:RCTModule.ACTION_BG1_MEASURE_GET_BLOOD, + + /** + * Callback indicating the measure result. + */ + ACTION_BG1_MEASURE_RESULT:RCTModule.ACTION_BG1_MEASURE_RESULT, + + /** + * The measure result + * Range : 20-600 mg/dL + */ + BG1_MEASURE_RESULT:RCTModule.BG1_MEASURE_RESULT, + + /** + * Callback indicating the strip out action. + */ + ACTION_BG1_MEASURE_STRIP_OUT:RCTModule.ACTION_BG1_MEASURE_STRIP_OUT, + + /** + * Callback indicating the Bg1 device get in standby mode. + */ + ACTION_BG1_MEASURE_STANDBY:RCTModule.ACTION_BG1_MEASURE_STANDBY, + + /** + * the data id + */ + DATA_ID:RCTModule.DATA_ID, + + /** + * Callback indicating the code analysis result. + */ + ACTION_CODE_ANALYSIS:RCTModule.ACTION_CODE_ANALYSIS, + + /** + * the strip number + */ + STRIP_NUM_BG:RCTModule.STRIP_NUM_BG, + + /** + * the expire time + */ + STRIP_EXPIRETIME_BG:RCTModule.STRIP_EXPIRETIME_BG, + + /** + * the bottle id + */ + BOTTLEID_BG:RCTModule.BOTTLEID_BG + +} diff --git a/libs/ihealth-sdk/module/BG1SModule.js b/libs/ihealth-sdk/module/BG1SModule.js new file mode 100644 index 0000000..e3b922b --- /dev/null +++ b/libs/ihealth-sdk/module/BG1SModule.js @@ -0,0 +1,48 @@ +'use strict'; + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.BG1SModule + + /** + * @module BG1SModule + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * listen getFunction + * @param {string} mac Device's mac address + */ + getFunction: function (mac) { + RCTModule.getFunction(mac) + }, + + + /** + * listen measurement + * @param {string} mac Device's mac address + */ + measure: function (mac, measureMode) { + RCTModule.measure(mac, measureMode) + }, + + /** + * Disconnect the BG1S + * @param mac The mac address for BG1S + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Get all connected BG1S device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +} + diff --git a/libs/ihealth-sdk/module/BG1SProfileModule.js b/libs/ihealth-sdk/module/BG1SProfileModule.js new file mode 100644 index 0000000..c950330 --- /dev/null +++ b/libs/ihealth-sdk/module/BG1SProfileModule.js @@ -0,0 +1,30 @@ +'use strict'; + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.BG1SProfileModule + +/** + * @module BG1SProfileModule + */ +module.exports = { + ACTION_GET_DEVICE_INFO: RCTModule.ACTION_GET_DEVICE_INFO, + INFO_BATTERY_BG1S: RCTModule.INFO_BATTERY_BG1S, + INFO_VERSION_CODE_BLOOD_BG1S: RCTModule.INFO_VERSION_CODE_BLOOD_BG1S, + INFO_VERSION_CODE_CTL_BG1S: RCTModule.INFO_VERSION_CODE_CTL_BG1S, + + ACTION_STRIP_INSERTION_STATUS: RCTModule.ACTION_STRIP_INSERTION_STATUS, + ACTION_GET_BLOOD: RCTModule.ACTION_GET_BLOOD, + + ACTION_SET_MEASURE_MODE: RCTModule.ACTION_SET_MEASURE_MODE, + + ACTION_MEASURE_RESULT: RCTModule.ACTION_SET_MEASURE_MODE, + MEASURE_MODE: RCTModule.MEASURE_MODE, + MEASURE_RESULT: RCTModule.MEASURE_RESULT, + + ACTION_ERROR_BG1S: RCTModule.ACTION_ERROR_BG1S, + ERROR_NUM_BG1S: RCTModule.ERROR_NUM_BG1S, + ERROR_DESCRIPTION_BG1S: RCTModule.ERROR_DESCRIPTION_BG1S, + + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/BG5Module.js b/libs/ihealth-sdk/module/BG5Module.js new file mode 100755 index 0000000..9e1f895 --- /dev/null +++ b/libs/ihealth-sdk/module/BG5Module.js @@ -0,0 +1,184 @@ +/** + * Created by gaoyuanlong on 16/11/17. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.BG5Module + +/** + * @module BG5Module + */ +module.exports = { + Event_Notify: RCTModule.Event_Notify, + + /** + * Keep BG5 connecting. + * @param {string} mac Device's mac address + */ + holdLink: function (mac){ + if (RCTModule != null) { + RCTModule.holdLink(mac); + } else { + console.log('~~~~~ BG5 holdLink RCTModule is null') + } + }, + + /** + * Get battery level of BG5 device. + * @param {string} mac Device's mac address + */ + getBattery: function (mac){ + if (RCTModule != null) { + RCTModule.getBattery(mac); + } else { + console.log('~~~~~ BG5 getBattery RCTModule is null') + } + }, + + /** + * Set time to BG5 device. + * @param {string} mac Device's mac address + */ + setTime: function (mac){ + if (RCTModule != null) { + RCTModule.setTime(mac); + } else { + console.log('~~~~~ BG5 setTime RCTModule is null') + } + }, + + /** + * Set unit to BG5 device. + * @param {string} mac Device's mac address + * @param {number} type 1:mmol/L 2:mg/dL + */ + setUnit: function (mac, type){ + if (RCTModule != null) { + RCTModule.setUnit(mac, type); + } else { + console.log('~~~~~ BG5 setUnit RCTModule is null') + } + }, + + /** + * Start measure with specific measure type. + * @param {string} mac Device's mac address + * @param {number} type Measure type, 1.Measure with blood measure, 2.Measure with control liquid + */ + startMeasure: function (mac, type){ + if (RCTModule != null) { + RCTModule.startMeasure(mac, type); + } else { + console.log('~~~~~ BG5 startMeasure RCTModule is null') + } + }, + + /** + * Get offline data of BG5 device. + * @param {string} mac Device's mac address + */ + getOfflineData: function (mac){ + if (RCTModule != null) { + RCTModule.getOfflineData(mac); + } else { + console.log('~~~~~ BG5 getOffineData RCTModule is null') + } + }, + + /** + * Delete the offline data in BG5 device. + * @param {string} mac Device's mac address + */ + deleteOfflineData: function (mac){ + if (RCTModule != null) { + RCTModule.deleteOfflineData(mac); + } else { + console.log('~~~~~ BG5 deleteOfflineData RCTModule is null') + } + }, + + /** + * Set bottle message to BG5 device. + * @param {string} mac Device's mac address + * @param {number} stripType GOD(value 1) or GDH(value 2) + * @param {number} measureType measure with blood(value 1) or measure with control liquid(value 2) + * @param {number} QRCode the QR code send to the deivce(GOD strip), GDH ignore + * @param {number} stripNum the left count of strip, range [1, 255] + * @param {string} overDate the expire time of the strip, format: yyyy-MM-dd, should be valid + */ + setBottleMessage: function (mac, stripType, measureType, QRCode, stripNum, overDate){ + if (RCTModule != null) { + RCTModule.setBottleMessageWithInfo(mac, stripType, measureType, QRCode, stripNum, overDate); + } else { + console.log('~~~~~ BG5 setBottleMessage RCTModule is null') + } + }, + + /** + * Get bottle message from BG5 device. + * @param {string} mac Device's mac address + */ + getBottleMessage: function (mac){ + if (RCTModule != null) { + RCTModule.getBottleMessage(mac); + } else { + console.log('~~~~~ BG5 getBottleMessage RCTModule is null') + } + }, + + /** + * Set bottleId to BG5 device. + * @param {string} mac Device's mac address + * @param {string} ID UserID set to device + */ + setBottleID: function (mac, ID){ + if (RCTModule != null) { + RCTModule.setBottleId(mac, ID); + } else { + console.log('~~~~~ BG5 setBottleID RCTModule is null') + } + }, + + /** + * Get bottleId from BG5 device. + * @param {string} mac Device's mac address + */ + getBottleID: function (mac){ + if (RCTModule != null) { + RCTModule.getBottleId(mac); + } else { + console.log('~~~~~ BG5 getBottleID RCTModule is null') + } + }, + + disConnect: function (mac){ + if (RCTModule != null) { + RCTModule.disConnect(mac); + } else { + console.log('~~~~~ BG5 getBottleID RCTModule is null') + } + }, + + /** + * Parse bottle info from QRCode, include strip expire time,strip number,bottle id + * @param {string} QRCode + */ + getBottleInfoFromQR: function(QRCode){ + if (RCTModule != null) { + RCTModule.getBottleInfoFromQR(QRCode); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + /** + * Get all connected BG5 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, +} diff --git a/libs/ihealth-sdk/module/BG5SModule.js b/libs/ihealth-sdk/module/BG5SModule.js new file mode 100644 index 0000000..28ee38d --- /dev/null +++ b/libs/ihealth-sdk/module/BG5SModule.js @@ -0,0 +1,145 @@ +/** + * @author chenxuewei + */ +'use strict'; + + +var { NativeModules, Platform } = require('react-native'); + +var RCTModule = NativeModules.BG5SModule; + +/** + * @module BG5SModule + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Get status information of BG5 device. + * @param {string} mac Device's mac address + */ + getStatusInfo: function (mac){ + + if (RCTModule != null) { + RCTModule.getStatusInfo(mac); + } else { + console.log('~~~~~ BG5S getStatusInfo RCTModule is null') + } + }, + + /** + * Set time to BG5 device. + * @param {string} mac Device's mac address + */ + setTime: function (mac, date, timezone){ + if (RCTModule != null) { + RCTModule.setTime(mac, date, timezone); + } else { + console.log('~~~~~ BG5S setTime RCTModule is null') + } + }, + + /** + * Set unit to BG5 device. + * @param {string} mac Device's mac address + * @param {number} type 1:mmol/L 2:mg/dL + */ + setUnit: function (mac, type){ + if (RCTModule != null) { + RCTModule.setUnit(mac, type); + } else { + console.log('~~~~~ BG5S setUnit RCTModule is null') + } + }, + + /** + * Delete the offline data in BG5 device. + * @param {string} mac Device's mac address + */ + deleteUsedStrip: function (mac){ + if (RCTModule != null) { + RCTModule.deleteUsedStrip(mac); + } else { + console.log('~~~~~ BG5S deleteUsedStrip RCTModule is null') + } + }, + + /** + * Delete the offline data in BG5 device. + * @param {string} mac Device's mac address + */ + deleteOfflineData: function (mac){ + if (RCTModule != null) { + RCTModule.deleteOfflineData(mac); + } else { + console.log('~~~~~ BG5S deleteOfflineData RCTModule is null') + } + }, + + /** + * Delete the offline data in BG5 device. + * @param {string} mac Device's mac address + */ + getOfflineData: function (mac){ + if (RCTModule != null) { + RCTModule.getOfflineData(mac); + } else { + console.log('~~~~~ BG5S getOfflineData RCTModule is null') + } + }, + + /** + * Start measure with specific measure type. + * @param {string} mac Device's mac address + * @param {number} type Measure type, 1.Measure with blood measure, 2.Measure with control liquid + */ + startMeasure: function (mac, type){ + if (RCTModule != null) { + RCTModule.startMeasure(mac, type); + } else { + console.log('~~~~~ BG5S startMeasure RCTModule is null') + } + }, + + /** + * Get offline data of BG5 device. + * @param {string} mac Device's mac address + */ + adjustOfflineData: function (mac, timeString, originData){ + if (RCTModule != null) { + RCTModule.adjustOfflineData(mac, timeString, originData); + } else { + console.log('~~~~~ BG5S adjustOfflineData RCTModule is null') + } + }, + + setOfflineModel: function (mac, enable) { + if (RCTModule != null) { + RCTModule.getAllConnectedDevices(mac, enable); + } else { + console.log('~~~~~ BG5S adjustOfflineData RCTModule is null') + } + }, + + disConnect: function (mac){ + if (RCTModule != null) { + if (Platform.OS === 'ios'){ + RCTModule.disConnect(mac); + } else { + RCTModule.disconnect(mac); + } + } else { + console.log('~~~~~ BG5S disConnect RCTModule is null') + } + }, + + /** + * Get all connected BG5S device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, +} diff --git a/libs/ihealth-sdk/module/BG5SProfileModule.js b/libs/ihealth-sdk/module/BG5SProfileModule.js new file mode 100644 index 0000000..9e09542 --- /dev/null +++ b/libs/ihealth-sdk/module/BG5SProfileModule.js @@ -0,0 +1,401 @@ +/** + * Created by gaoyuanlong on 16/11/16. + */ +'use strict'; + + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.BG5SProfileModule + +/** + * @module BG5SProfileModule + */ +module.exports = { + + /** + * The action value of event indicating the error of BG device.
+ */ + ACTION_ERROR_BG: RCTModule.ACTION_ERROR_BG, + + /** + * The action value of event indicating keep link success.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_KEEP_LINK BGProfileModule.ACTION_KEEP_LINK("action_keep_link")}
+ * Example:
+ * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_keep_link"}
+ */ + ACTION_GET_STATUS_INFO: RCTModule.ACTION_GET_STATUS_INFO, + + /** + * The action value of event indicating set time success.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_SET_TIME BGProfileModule.ACTION_SET_TIME("action_set_time")}
+ * Example:
+ * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_time"}
+ */ + ACTION_SET_TIME: RCTModule.ACTION_SET_TIME, + + /** + * The action value of event indicating set unit success.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_SET_UNIT BGProfileModule.ACTION_SET_UNIT("action_set_unit")}
+ * Example:
+ * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_unit"}
+ */ + ACTION_SET_UNIT: RCTModule.ACTION_SET_UNIT, + + /** + * The action value of event indicating the result of get battery command.
+ * The key and value will be as below: + * + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_GET_BATTERY BGProfileModule.ACTION_GET_BATTERY("action_battery_bg")}
{@link module:BGProfileModule.GET_BATTERY BGProfileModule.GET_BATTERY("battery")}The battery value.
+ * Example:
+ * {"mac":"8CDE52B5FAC2","battery":32,"type":"BG5","action":"action_battery_bg"}
+ */ + ACTION_GET_BATTERY: RCTModule.ACTION_GET_BATTERY, + + /** + * The action value of event indicating start measure success.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_START_MEASURE BGProfileModule.ACTION_START_MEASURE("action_start_measure")}
+ * Example:
+ * {mac":"8CDE52B5FAC2","type":"BG5","action":"action_start_measure"}
+ */ + ACTION_START_MEASURE: RCTModule.ACTION_START_MEASURE, + + /** + * The action value of event indicating the offline data count.
+ * The key and value will be as below: + * + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_GET_OFFLINEDATA_COUNT BGProfileModule.ACTION_GET_OFFLINEDATA_COUNT("action_historicalnum_bg")}
{@link module:BGProfileModule.GET_OFFLINEDATA_COUNT BGProfileModule.GET_OFFLINEDATA_COUNT("count")}The offline data count value.
+ * Example:
+ * {"count":2,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_historicalnum_bg"} + *
+ */ + ACTION_GET_OFFLINEDATA_COUNT: RCTModule.ACTION_GET_OFFLINEDATA_COUNT, + + /** + * The action value of event indicating the result of offline data.
+ * The key and value will be as below: + * + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_GET_OFFLINEDATA BGProfileModule.ACTION_GET_OFFLINEDATA("action_historicaldata_bg")}
{@link module:BGProfileModule.GET_OFFLINEDATA BGProfileModule.GET_OFFLINEDATA("his_data_bg")}Get offline data command result
+ * Example:
+ * {
+ * {"his_data_bg":{"history":[{"dataID":"1B92511DE36F54508415257160F9D0EA","value":39,"date":"2017-06-08 15:08:00"}, + * {"dataID":"862D10B79A8560505720B983D658E095","timeProofing":0,"value":38,"date":"2017-06-08 15:09:01"}]}, + * "mac":"8CDE52B5FAC2","type":"BG5","action":"action_historicaldata_bg"} + *
+ */ + ACTION_GET_OFFLINEDATA: RCTModule.ACTION_GET_OFFLINEDATA, + + /** + * The action value of event indicating delete offline data success.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_DELETE_OFFLINEDATA BGProfileModule.ACTION_DELETE_OFFLINEDATA("action_delete_historical_data")}
+ * Example:
+ * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_delete_historical_data"} + *
+ */ + ACTION_DELETE_OFFLINEDATA: RCTModule.ACTION_DELETE_OFFLINEDATA, + + /** + * The action value of event indicating the result of set bottle message command.
+ * The key and value will be as below: + * + * + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_SET_BOTTLEMESSAGE BGProfileModule.ACTION_SET_BOTTLEMESSAGE("action_set_bottle_message_success")}
{@link module:BGProfileModule.SET_BOTTLEMESSAGE BGProfileModule.SET_BOTTLEMESSAGE("set_bottle_message")}Set bottle message command result
{@link module:BGProfileModule.START_MODE BGProfileModule.START_MODE("start_mode")}The start mode of Bg5 device.
+ * Example:
+ * {"start_mode":2,"set_bottle_message":true,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_bottle_message_success"} + *
+ */ + ACTION_SET_BOTTLEMESSAGE: RCTModule.ACTION_SET_BOTTLEMESSAGE, + + /** + * The action value of event indicating the result of get bottle message command.
+ * The key and value will be as below: + * + * + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_GET_BOTTLEMESSAGE BGProfileModule.ACTION_GET_BOTTLEMESSAGE("action_get_codeinfo")}
{@link module:BGProfileModule.GET_EXPIRECTIME BGProfileModule.GET_EXPIRECTIME("expiretime")}The strip expire time of Bg5 device.
{@link module:BGProfileModule.GET_USENUM BGProfileModule.GET_USENUM("usenum")}The strip used num, from offline data by Bg5 device.
+ * Example:
+ * {"expiretime":"2099-12-16","usenum":0,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_get_codeinfo"} + *
+ */ + ACTION_GET_BOTTLEMESSAGE: RCTModule.ACTION_GET_BOTTLEMESSAGE, + + /** + * The action value of event indicating set bottleID success.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_SET_BOTTLEID BGProfileModule.ACTION_SET_BOTTLEID("action_setbottleid_success")}
+ * Example:
+ * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_setbottleid_success"} + *
+ */ + ACTION_SET_BOTTLEID: RCTModule.ACTION_SET_BOTTLEID, + + /** + * The action value of event indicating the result of get bottleID command.
+ * The key and value will be as below: + * + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_GET_BOTTLEID BGProfileModule.ACTION_GET_BOTTLEID("action_get_bottleid")}
{@link module:BGProfileModule.GET_BOTTLEID BGProfileModule.GET_BOTTLEID("bottleid")}The bottleId of Bg5 device.
+ * Example:
+ * {"bottleid":926305,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_get_bottleid"} + *
+ */ + ACTION_GET_BOTTLEID: RCTModule.ACTION_GET_BOTTLEID, + + + /** + * The action value of event indicating the result of strip was put in the devices.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_STRIP_IN BGProfileModule.ACTION_STRIP_IN("action_measure_strip_in")}
+ * Example:
+ * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_strip_in"}
+ */ + ACTION_STRIP_IN: RCTModule.ACTION_STRIP_IN, + + /** + * The action value of event indicating the result of strip out of the devices.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_STRIP_OUT BGProfileModule.ACTION_STRIP_OUT("action_measure_strip_out")}
+ * Example:
+ * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_strip_out"} + *
+ */ + ACTION_STRIP_OUT: RCTModule.ACTION_STRIP_OUT, + + /** + * The action value of event indicating the result of get the blood.
+ * The key and value will be as below: + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_GET_BLOOD BGProfileModule.ACTION_GET_BLOOD("action_measure_get_blood")}
+ * Example:
+ * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_get_blood"} + *
+ */ + ACTION_GET_BLOOD: RCTModule.ACTION_GET_BLOOD, + + /** + * The action value of event indicating the result of get measure value from devices.
+ * The key and value will be as below: + * + * + * + * + * + * + * + *
KeyValue
action{@link module:BGProfileModule.ACTION_ONLINE_RESULT_BG BGProfileModule.ACTION_ONLINE_RESULT_BG("action_value_bg")}
{@link module:BGProfileModule.ONLINE_RESULT_BG BGProfileModule.ONLINE_RESULT_BG("result")}The bg value measured by device
{@link module:BGProfileModule.DATA_ID BGProfileModule.DATA_ID("dataID")}The dataID measured by device
+ * Example:
+ * {"dataID":"E0A831AE7D2220A6417D4E050EA3FCA1","result":141,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_value_bg"} + *
+ */ + ACTION_ONLINE_RESULT_BG: RCTModule.ACTION_ONLINE_RESULT_BG, + + /** + * The error num means different error. + *

0:Battery is low.

+ *

1:Glucose test result is out of the measurement range.

+ *

2:Unknown interference detected, please repeat the test.

+ *

3:Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip..

+ *

4:Reading transmission error. Repeat the test with a new test strip. If the problem persists, contact iHealth customer service for assistance.

+ *

5:The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.

+ *

6:The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.

+ *

7:Test strip coding error.

+ *

8:Communication error, press"START" or rescan the code to repeat the test.

+ *

9:Strip removed in the middle of reading, repeat the test with a new strip.

+ *

10:Insert a new test strip and repeat the test.

+ *

11:Cannot write to SN or KEY.

+ *

12:Please set time.

+ *

13:0 test strips remaining.

+ *

14:Test strip expired.

+ *

15:Unplug the charging cable before testing.

+ *

18:Unplug the charging cable before read the history data + *

19:Charging line is inserted + *

20:Charging line pull out + *

21:The bluetooth module failure + *

100:The device is disconnected (Android doesn't support this code) + *

112:Device don't support to query energy.

+ *

400:Parameters out of range.

+ *

402:The order of call is wrong.

+ *

403:Parameter type is not matched in function call.

+ *

404:Function(disConnect) is not supported in iOS platform.(Only available in iOS platform)

+ *

405:QRCode format error

+ */ + ERROR_NUM_BG: RCTModule.ERROR_NUM_BG, + + /** + * The error discription. + */ + ERROR_DESCRIPTION_BG: RCTModule.ERROR_DESCRIPTION_BG, + + /** + * The battery value. + */ + GET_BATTERY: RCTModule.GET_BATTERY, + + /** + * The offline data count value. + */ + GET_OFFLINEDATA_COUNT: RCTModule.GET_OFFLINEDATA_COUNT, + + /** + * Get offline data value. + */ + GET_OFFLINEDATA: RCTModule.GET_OFFLINEDATA, + + /** + * Set bottle message result value. + */ + SET_BOTTLEMESSAGE: RCTModule.SET_BOTTLEMESSAGE, + + /** + * the start mode of Bg5 device. + *
  • + * value=1, start by insert strip, no need to call + *
  • + *
  • + * value=2, start by tap the button, need to call + *
  • + * + */ + START_MODE: RCTModule.START_MODE, + + /** + * The strip expire time of Bg5 device. + */ + GET_EXPIRECTIME: RCTModule.GET_EXPIRECTIME, + + /** + * The strip used num, from offline data by Bg5 device. + */ + GET_USENUM: RCTModule.GET_USENUM, + + + /** + * The bottleId of Bg5 device. + */ + GET_BOTTLEID: RCTModule.GET_BOTTLEID, + + /** + * The bg value measured by device + */ + ONLINE_RESULT_BG: RCTModule.ONLINE_RESULT_BG, + + /** + * The dataID measured by device + */ + DATA_ID: RCTModule.DATA_ID, + + /** + * Callback indicating the code analysis result. + * The key and value will be as below: + * + * + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_CODE_ANALYSIS BGProfileModule.ACTION_CODE_ANALYSIS("action_code_analysis")}
    {@link module:BGProfileModule.STRIP_NUM_BG BGProfileModule.STRIP_NUM_BG("strip_num")}The strip number of the QRCode
    {@link module:BGProfileModule.STRIP_EXPIRETIME_BG BGProfileModule.STRIP_EXPIRETIME_BG("expire_time")}The expire time of the QRCode
    {@link module:BGProfileModule.BOTTLEID_BG BGProfileModule.BOTTLEID_BG("bottle_id")}The bottle id of the QRCode
    + * Example:
    + * {"bottle_id":"926305","expire_time":"2017-03-01","strip_num":"25","action":"action_code_analysis"} + *
    + */ + ACTION_CODE_ANALYSIS:RCTModule.ACTION_CODE_ANALYSIS, + + /** + * the strip number + */ + STRIP_NUM_BG:RCTModule.STRIP_NUM_BG, + + /** + * the expire time + */ + STRIP_EXPIRETIME_BG:RCTModule.STRIP_EXPIRETIME_BG, + + /** + * the bottle id + */ + BOTTLEID_BG:RCTModule.BOTTLEID_BG, + + /** + * Indicates get all connected devices. + */ + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/BGProfileModule.js b/libs/ihealth-sdk/module/BGProfileModule.js new file mode 100755 index 0000000..03dacb5 --- /dev/null +++ b/libs/ihealth-sdk/module/BGProfileModule.js @@ -0,0 +1,413 @@ +/** + * Created by gaoyuanlong on 16/11/16. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.BGProfileModule + +/** + * @module BGProfileModule + */ +module.exports = { + + /** + * The action value of event indicating the error of BG device.
    + * The key and value will be as below: + * + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_ERROR_BG BGProfileModule.ACTION_ERROR_BG("action_measure_error")}
    {@link module:BGProfileModule.ERROR_NUM_BG BGProfileModule.ERROR_NUM_BG("error_num")} The error num
    {@link module:BGProfileModule.ERROR_DESCRIPTION_BG BGProfileModule.ERROR_DESCRIPTION_BG("description")}Detailed description of the error
    + * Example:
    + * {"description":"Strip removed in the middle of reading, repeat the test with a new strip.","error_num":9,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_error"} + *
    + */ + ACTION_ERROR_BG: RCTModule.ACTION_ERROR_BG, + + /** + * The action value of event indicating keep link success.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_KEEP_LINK BGProfileModule.ACTION_KEEP_LINK("action_keep_link")}
    + * Example:
    + * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_keep_link"}
    + */ + ACTION_KEEP_LINK: RCTModule.ACTION_KEEP_LINK, + + /** + * The action value of event indicating set time success.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_SET_TIME BGProfileModule.ACTION_SET_TIME("action_set_time")}
    + * Example:
    + * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_time"}
    + */ + ACTION_SET_TIME: RCTModule.ACTION_SET_TIME, + + /** + * The action value of event indicating set unit success.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_SET_UNIT BGProfileModule.ACTION_SET_UNIT("action_set_unit")}
    + * Example:
    + * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_unit"}
    + */ + ACTION_SET_UNIT: RCTModule.ACTION_SET_UNIT, + + /** + * The action value of event indicating the result of get battery command.
    + * The key and value will be as below: + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_GET_BATTERY BGProfileModule.ACTION_GET_BATTERY("action_battery_bg")}
    {@link module:BGProfileModule.GET_BATTERY BGProfileModule.GET_BATTERY("battery")}The battery value.
    + * Example:
    + * {"mac":"8CDE52B5FAC2","battery":32,"type":"BG5","action":"action_battery_bg"}
    + */ + ACTION_GET_BATTERY: RCTModule.ACTION_GET_BATTERY, + + /** + * The action value of event indicating start measure success.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_START_MEASURE BGProfileModule.ACTION_START_MEASURE("action_start_measure")}
    + * Example:
    + * {mac":"8CDE52B5FAC2","type":"BG5","action":"action_start_measure"}
    + */ + ACTION_START_MEASURE: RCTModule.ACTION_START_MEASURE, + + /** + * The action value of event indicating the offline data count.
    + * The key and value will be as below: + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_GET_OFFLINEDATA_COUNT BGProfileModule.ACTION_GET_OFFLINEDATA_COUNT("action_historicalnum_bg")}
    {@link module:BGProfileModule.GET_OFFLINEDATA_COUNT BGProfileModule.GET_OFFLINEDATA_COUNT("count")}The offline data count value.
    + * Example:
    + * {"count":2,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_historicalnum_bg"} + *
    + */ + ACTION_GET_OFFLINEDATA_COUNT: RCTModule.ACTION_GET_OFFLINEDATA_COUNT, + + /** + * The action value of event indicating the result of offline data.
    + * The key and value will be as below: + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_GET_OFFLINEDATA BGProfileModule.ACTION_GET_OFFLINEDATA("action_historicaldata_bg")}
    {@link module:BGProfileModule.GET_OFFLINEDATA BGProfileModule.GET_OFFLINEDATA("his_data_bg")}Get offline data command result
    + * Example:
    + * {
    + * {"his_data_bg":{"history":[{"dataID":"1B92511DE36F54508415257160F9D0EA","value":39,"date":"2017-06-08 15:08:00"}, + * {"dataID":"862D10B79A8560505720B983D658E095","timeProofing":0,"value":38,"date":"2017-06-08 15:09:01"}]}, + * "mac":"8CDE52B5FAC2","type":"BG5","action":"action_historicaldata_bg"} + *
    + */ + ACTION_GET_OFFLINEDATA: RCTModule.ACTION_GET_OFFLINEDATA, + + /** + * The action value of event indicating delete offline data success.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_DELETE_OFFLINEDATA BGProfileModule.ACTION_DELETE_OFFLINEDATA("action_delete_historical_data")}
    + * Example:
    + * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_delete_historical_data"} + *
    + */ + ACTION_DELETE_OFFLINEDATA: RCTModule.ACTION_DELETE_OFFLINEDATA, + + /** + * The action value of event indicating the result of set bottle message command.
    + * The key and value will be as below: + * + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_SET_BOTTLEMESSAGE BGProfileModule.ACTION_SET_BOTTLEMESSAGE("action_set_bottle_message_success")}
    {@link module:BGProfileModule.SET_BOTTLEMESSAGE BGProfileModule.SET_BOTTLEMESSAGE("set_bottle_message")}Set bottle message command result
    {@link module:BGProfileModule.START_MODE BGProfileModule.START_MODE("start_mode")}The start mode of Bg5 device.
    + * Example:
    + * {"start_mode":2,"set_bottle_message":true,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_set_bottle_message_success"} + *
    + */ + ACTION_SET_BOTTLEMESSAGE: RCTModule.ACTION_SET_BOTTLEMESSAGE, + + /** + * The action value of event indicating the result of get bottle message command.
    + * The key and value will be as below: + * + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_GET_BOTTLEMESSAGE BGProfileModule.ACTION_GET_BOTTLEMESSAGE("action_get_codeinfo")}
    {@link module:BGProfileModule.GET_EXPIRECTIME BGProfileModule.GET_EXPIRECTIME("expiretime")}The strip expire time of Bg5 device.
    {@link module:BGProfileModule.GET_USENUM BGProfileModule.GET_USENUM("usenum")}The strip used num, from offline data by Bg5 device.
    + * Example:
    + * {"expiretime":"2099-12-16","usenum":0,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_get_codeinfo"} + *
    + */ + ACTION_GET_BOTTLEMESSAGE: RCTModule.ACTION_GET_BOTTLEMESSAGE, + + /** + * The action value of event indicating set bottleID success.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_SET_BOTTLEID BGProfileModule.ACTION_SET_BOTTLEID("action_setbottleid_success")}
    + * Example:
    + * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_setbottleid_success"} + *
    + */ + ACTION_SET_BOTTLEID: RCTModule.ACTION_SET_BOTTLEID, + + /** + * The action value of event indicating the result of get bottleID command.
    + * The key and value will be as below: + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_GET_BOTTLEID BGProfileModule.ACTION_GET_BOTTLEID("action_get_bottleid")}
    {@link module:BGProfileModule.GET_BOTTLEID BGProfileModule.GET_BOTTLEID("bottleid")}The bottleId of Bg5 device.
    + * Example:
    + * {"bottleid":926305,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_get_bottleid"} + *
    + */ + ACTION_GET_BOTTLEID: RCTModule.ACTION_GET_BOTTLEID, + + + /** + * The action value of event indicating the result of strip was put in the devices.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_STRIP_IN BGProfileModule.ACTION_STRIP_IN("action_measure_strip_in")}
    + * Example:
    + * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_strip_in"}
    + */ + ACTION_STRIP_IN: RCTModule.ACTION_STRIP_IN, + + /** + * The action value of event indicating the result of strip out of the devices.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_STRIP_OUT BGProfileModule.ACTION_STRIP_OUT("action_measure_strip_out")}
    + * Example:
    + * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_strip_out"} + *
    + */ + ACTION_STRIP_OUT: RCTModule.ACTION_STRIP_OUT, + + /** + * The action value of event indicating the result of get the blood.
    + * The key and value will be as below: + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_GET_BLOOD BGProfileModule.ACTION_GET_BLOOD("action_measure_get_blood")}
    + * Example:
    + * {"mac":"8CDE52B5FAC2","type":"BG5","action":"action_measure_get_blood"} + *
    + */ + ACTION_GET_BLOOD: RCTModule.ACTION_GET_BLOOD, + + /** + * The action value of event indicating the result of get measure value from devices.
    + * The key and value will be as below: + * + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_ONLINE_RESULT_BG BGProfileModule.ACTION_ONLINE_RESULT_BG("action_value_bg")}
    {@link module:BGProfileModule.ONLINE_RESULT_BG BGProfileModule.ONLINE_RESULT_BG("result")}The bg value measured by device
    {@link module:BGProfileModule.DATA_ID BGProfileModule.DATA_ID("dataID")}The dataID measured by device
    + * Example:
    + * {"dataID":"E0A831AE7D2220A6417D4E050EA3FCA1","result":141,"mac":"8CDE52B5FAC2","type":"BG5","action":"action_value_bg"} + *
    + */ + ACTION_ONLINE_RESULT_BG: RCTModule.ACTION_ONLINE_RESULT_BG, + + /** + * The error num means different error. + *

    0:Battery is low.

    + *

    1:Glucose test result is out of the measurement range.

    + *

    2:Unknown interference detected, please repeat the test.

    + *

    3:Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip..

    + *

    4:Reading transmission error. Repeat the test with a new test strip. If the problem persists, contact iHealth customer service for assistance.

    + *

    5:The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.

    + *

    6:The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.

    + *

    7:Test strip coding error.

    + *

    8:Communication error, press"START" or rescan the code to repeat the test.

    + *

    9:Strip removed in the middle of reading, repeat the test with a new strip.

    + *

    10:Insert a new test strip and repeat the test.

    + *

    11:Cannot write to SN or KEY.

    + *

    12:Please set time.

    + *

    13:0 test strips remaining.

    + *

    14:Test strip expired.

    + *

    15:Unplug the charging cable before testing.

    + *

    18:Unplug the charging cable before read the history data + *

    19:Charging line is inserted + *

    20:Charging line pull out + *

    21:The bluetooth module failure + *

    100:The device is disconnected (Android doesn't support this code) + *

    112:Device don't support to query energy.

    + *

    400:Parameters out of range.

    + *

    402:The order of call is wrong.

    + *

    403:Parameter type is not matched in function call.

    + *

    404:Function(disConnect) is not supported in iOS platform.(Only available in iOS platform)

    + *

    405:QRCode format error

    + */ + ERROR_NUM_BG: RCTModule.ERROR_NUM_BG, + + /** + * The error discription. + */ + ERROR_DESCRIPTION_BG: RCTModule.ERROR_DESCRIPTION_BG, + + /** + * The battery value. + */ + GET_BATTERY: RCTModule.GET_BATTERY, + + /** + * The offline data count value. + */ + GET_OFFLINEDATA_COUNT: RCTModule.GET_OFFLINEDATA_COUNT, + + /** + * Get offline data value. + */ + GET_OFFLINEDATA: RCTModule.GET_OFFLINEDATA, + + /** + * Set bottle message result value. + */ + SET_BOTTLEMESSAGE: RCTModule.SET_BOTTLEMESSAGE, + + /** + * the start mode of Bg5 device. + *
  • + * value=1, start by insert strip, no need to call + *
  • + *
  • + * value=2, start by tap the button, need to call + *
  • + * + */ + START_MODE: RCTModule.START_MODE, + + /** + * The strip expire time of Bg5 device. + */ + GET_EXPIRECTIME: RCTModule.GET_EXPIRECTIME, + + /** + * The strip used num, from offline data by Bg5 device. + */ + GET_USENUM: RCTModule.GET_USENUM, + + + /** + * The bottleId of Bg5 device. + */ + GET_BOTTLEID: RCTModule.GET_BOTTLEID, + + /** + * The bg value measured by device + */ + ONLINE_RESULT_BG: RCTModule.ONLINE_RESULT_BG, + + /** + * The dataID measured by device + */ + DATA_ID: RCTModule.DATA_ID, + + /** + * Callback indicating the code analysis result. + * The key and value will be as below: + * + * + * + * + * + * + * + * + *
    KeyValue
    action{@link module:BGProfileModule.ACTION_CODE_ANALYSIS BGProfileModule.ACTION_CODE_ANALYSIS("action_code_analysis")}
    {@link module:BGProfileModule.STRIP_NUM_BG BGProfileModule.STRIP_NUM_BG("strip_num")}The strip number of the QRCode
    {@link module:BGProfileModule.STRIP_EXPIRETIME_BG BGProfileModule.STRIP_EXPIRETIME_BG("expire_time")}The expire time of the QRCode
    {@link module:BGProfileModule.BOTTLEID_BG BGProfileModule.BOTTLEID_BG("bottle_id")}The bottle id of the QRCode
    + * Example:
    + * {"bottle_id":"926305","expire_time":"2017-03-01","strip_num":"25","action":"action_code_analysis"} + *
    + */ + ACTION_CODE_ANALYSIS:RCTModule.ACTION_CODE_ANALYSIS, + + /** + * the strip number + */ + STRIP_NUM_BG:RCTModule.STRIP_NUM_BG, + + /** + * the expire time + */ + STRIP_EXPIRETIME_BG:RCTModule.STRIP_EXPIRETIME_BG, + + /** + * the bottle id + */ + BOTTLEID_BG:RCTModule.BOTTLEID_BG, + + /** + * Indicates get all connected devices. + */ + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/BP3LModule.js b/libs/ihealth-sdk/module/BP3LModule.js new file mode 100755 index 0000000..27bca9a --- /dev/null +++ b/libs/ihealth-sdk/module/BP3LModule.js @@ -0,0 +1,75 @@ +/** + * Created by zhangxu on 16/11/14. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.BP3LModule; + +/** + * @module BP3LModule + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Start measure blood pressure monitor + * @param {string} mac Device's mac address + */ + startMeasure: function (mac) { + if (RCTModule != null) { + RCTModule.startMeasure(mac); + } else { + console.log('~~~~~ RCTModule is null') + } + }, + + + /** + * Cancel the measuring process immediately if device is in measuring state. + * @param {string} mac Device's mac address + */ + stopMeasure: function (mac) { + if (RCTModule != null) { + RCTModule.stopMeasure(mac); + } else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Get the BP3L 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') + } + }, + + /** + * Disconnect the BP3L + * @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 AM3S device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +} diff --git a/libs/ihealth-sdk/module/BP550BTModule.js b/libs/ihealth-sdk/module/BP550BTModule.js new file mode 100755 index 0000000..126e245 --- /dev/null +++ b/libs/ihealth-sdk/module/BP550BTModule.js @@ -0,0 +1,90 @@ +/** + * Created by zhangxu on 16/11/20. + */ +'use strict'; + + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.BP550BTModule; + +/** + * @module BP550BTModule + */ + +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Get the BP550BT 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') + } + }, + + /** + * Get the KN-550BT device's functionInfo. + * @param {string} mac Device's mac address + */ + getFunctionInfo: function (mac) { + if (RCTModule != null) { + RCTModule.getFunctionInfo(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Disconnect the KN-550BT + * + * @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 BP550BT device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +} + diff --git a/libs/ihealth-sdk/module/BP5Module.js b/libs/ihealth-sdk/module/BP5Module.js new file mode 100755 index 0000000..1dbc7ff --- /dev/null +++ b/libs/ihealth-sdk/module/BP5Module.js @@ -0,0 +1,125 @@ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.BP5Module + +/** + * @module BP5Module + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Start measure blood pressure monitor + * @param {string} mac Device's mac address + */ + + startMeasure: function (mac) { + RCTModule.startMeasure(mac) + }, + + /** + * Cancel the measuring process immediately if device is in measuring state. + * @param {string} mac Device's mac address + */ + stopMeasure: function (mac) { + RCTModule.stopMeasure(mac) + }, + + /** + * Get the BP5 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') + } + }, + + /** + * Enable device can measure offline . + * @param {string} mac Device's mac address + */ + enbleOffline: function (mac) { + if (RCTModule != null) { + RCTModule.enbleOffline(mac); + } else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Enable device can't measure offline . + * @param {string} mac Device's mac address + */ + disableOffline: function (mac) { + if (RCTModule != null) { + RCTModule.disableOffline(mac); + } else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Enable device can't measure offline. + * @param {string} mac Device's mac address + */ + isEnableOffline: function (mac) { + if (RCTModule != null) { + RCTModule.isEnableOffline(mac); + } else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * get offline data number. (iOS not support) + * @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. + * @param {string} mac Device's mac address + */ + getOfflineData: function (mac) { + if (RCTModule != null) { + RCTModule.getOfflineData(mac); + } else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Disconnect the BP5 (iOS not support) + * + * @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 BP5 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +} diff --git a/libs/ihealth-sdk/module/BP5SModule.js b/libs/ihealth-sdk/module/BP5SModule.js new file mode 100755 index 0000000..9c115ea --- /dev/null +++ b/libs/ihealth-sdk/module/BP5SModule.js @@ -0,0 +1,139 @@ +/** + * Created by chenxuewei on 04/05/2019. + */ + +'use strict'; + + +var { NativeModules, Platform } = require('react-native'); + +var RCTModule = NativeModules.BP5SModule; + +/** + * @module BP5SModule + */ + +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + startMeasure: (mac) => { + if (RCTModule != null) { + RCTModule.startMeasure(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + stopMeasure: (mac) => { + if (RCTModule != null) { + RCTModule.stopMeasure(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + + }, + + deleteData: (mac) => { + if (RCTModule != null) { + RCTModule.deleteData(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + enbleOffline: (mac, mode) => { + if (RCTModule != null) { + RCTModule.enbleOffline(mac, mode); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + + /** + * Get the BP7S device's battery. + * @param {string} mac Device's mac address + */ + getBattery: (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: (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: (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: (mac, unit) => { + if (RCTModule != null) { + RCTModule.setUnit(mac, unit); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Get the BP7S device's functionInfo. + * @param {string} mac Device's mac address + */ + + getFunctionInfo: (mac) => { + if (RCTModule != null) { + RCTModule.getFunctionInfo(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + + /** + * Disconnect the BP5S + * + * @param {string} mac Device's mac address + */ + + disconnect: (mac) => { + if (RCTModule != null) { + RCTModule.disconnect(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Get all connected BP5S device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: () => { + RCTModule.getAllConnectedDevices() + } +}; diff --git a/libs/ihealth-sdk/module/BP7Module.js b/libs/ihealth-sdk/module/BP7Module.js new file mode 100755 index 0000000..bfd2852 --- /dev/null +++ b/libs/ihealth-sdk/module/BP7Module.js @@ -0,0 +1,149 @@ +'use strict'; + + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.BP7Module; + +/** + * @module BP7Module + */ + +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Get the BP7 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') + } + }, + + /** + * Start bp7 measurement. + * @param {string} mac Device's mac address + * @param {int} unit 0:mmHg,1:kPa + */ + startMeasure: function(mac){ + if (RCTModule != null) { + RCTModule.startMeasure(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Stop bp7 measurement. + * @param {string} mac Device's mac address + */ + stopMeasure: function (mac) { + if (RCTModule != null) { + RCTModule.stopMeasure(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Enable offline measurement mode. + * @param {string} mac Device's mac address + */ + enableOfflineMeasurement: function (mac) { + if (RCTModule != null) { + RCTModule.enableOfflineMeasurement(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Disable offline measurement mode. + * @param {string} mac Device's mac address + */ + disableOfflineMeasurement: function (mac) { + if (RCTModule != null) { + RCTModule.disableOfflineMeasurement(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * get the count of offline data. + * @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') + } + }, + + /** + * Check offline measurement mode. + * @param {string} mac Device's mac address + * @param {int} unit 0:mmHg,1:kPa + */ + isEnableOffline: function(mac, unit){ + if (RCTModule != null) { + RCTModule.isEnableOffline(mac, unit); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Set BP7 device unit. + * @param {string} mac Device's mac address + * @param {int} unit 0:mmHg,1:kPa + */ + conformAngle: function(mac){ + if (RCTModule != null) { + RCTModule.conformAngle(mac); + }else { + console.log('~~~~~ RCTModule is null') + } + }, + + /** + * Disconnect the BP7 + * + * @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 BP7 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +}; 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() + } +}; diff --git a/libs/ihealth-sdk/module/BPProfileModule.js b/libs/ihealth-sdk/module/BPProfileModule.js new file mode 100755 index 0000000..4cee41a --- /dev/null +++ b/libs/ihealth-sdk/module/BPProfileModule.js @@ -0,0 +1,69 @@ +/** + * Created by zhangxu on 16/11/16. + */ +'use strict'; + + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.BPProfileModule + +/** + * @module BPProfileModule + */ +module.exports = { + + ACTION_ERROR_BP:RCTModule.ACTION_ERROR_BP, + ERROR_NUM_BP:RCTModule.ERROR_NUM_BP, + ERROR_DESCRIPTION_BP:RCTModule.ERROR_DESCRIPTION_BP, + + ACTION_BATTERY_BP:RCTModule.ACTION_BATTERY_BP, + BATTERY_BP:RCTModule.BATTERY_BP, + + ACTION_ZOREING_BP:RCTModule.ACTION_ZOREING_BP, + ACTION_ZOREOVER_BP:RCTModule.ACTION_ZOREOVER_BP, + ACTION_ONLINE_PRESSURE_BP:RCTModule.ACTION_ONLINE_PRESSURE_BP, + BLOOD_PRESSURE_BP:RCTModule.BLOOD_PRESSURE_BP, + ACTION_ONLINE_PULSEWAVE_BP:RCTModule.ACTION_ONLINE_PULSEWAVE_BP, + FLAG_HEARTBEAT_BP:RCTModule.FLAG_HEARTBEAT_BP, + PULSEWAVE_BP:RCTModule.PULSEWAVE_BP, + ACTION_ONLINE_RESULT_BP:RCTModule.ACTION_ONLINE_RESULT_BP, + HIGH_BLOOD_PRESSURE_BP:RCTModule.HIGH_BLOOD_PRESSURE_BP, + LOW_BLOOD_PRESSURE_BP:RCTModule.LOW_BLOOD_PRESSURE_BP, + PULSE_BP:RCTModule.PULSE_BP, + MEASUREMENT_AHR_BP:RCTModule.MEASUREMENT_AHR_BP, + MEASUREMENT_HSD_BP:RCTModule.MEASUREMENT_HSD_BP, + DATAID:RCTModule.DATAID, + + ACTION_HISTORICAL_NUM_BP:RCTModule.ACTION_HISTORICAL_NUM_BP, + HISTORICAL_NUM_BP:RCTModule.HISTORICAL_NUM_BP, + + ACTION_HISTORICAL_DATA_BP:RCTModule.ACTION_HISTORICAL_DATA_BP, + HISTORICAL_DATA_BP:RCTModule.HISTORICAL_DATA_BP, + MEASUREMENT_DATE_BP:RCTModule.MEASUREMENT_DATE_BP, + MEASUREMENT_STRAT_ANGLE_BP:RCTModule.MEASUREMENT_STRAT_ANGLE_BP, + MEASUREMENT_ANGLE_CHANGE_BP:RCTModule.MEASUREMENT_ANGLE_CHANGE_BP, + MEASUREMENT_HAND_BP:RCTModule.MEASUREMENT_HAND_BP, + ACTION_HISTORICAL_OVER_BP:RCTModule.ACTION_HISTORICAL_OVER_BP, + + ACTION_FUNCTION_INFORMATION_BP:RCTModule.ACTION_FUNCTION_INFORMATION_BP, + FUNCTION_IS_UPAIR_MEASURE:RCTModule.FUNCTION_IS_UPAIR_MEASURE, + FUNCTION_IS_ARM_MEASURE:RCTModule.FUNCTION_IS_ARM_MEASURE, + FUNCTION_HAVE_ANGLE_SENSOR:RCTModule.FUNCTION_HAVE_ANGLE_SENSOR, + FUNCTION_HAVE_OFFLINE:RCTModule.FUNCTION_HAVE_OFFLINE, + FUNCTION_HAVE_HSD:RCTModule.FUNCTION_HAVE_HSD, + FUNCTION_HAVE_ANGLE_SETTING:RCTModule.FUNCTION_HAVE_ANGLE_SETTING, + FUNCTION_IS_MULTI_UPLOAD:RCTModule.FUNCTION_IS_MULTI_UPLOAD, + FUNCTION_HAVE_SELF_UPDATE:RCTModule.FUNCTION_HAVE_SELF_UPDATE, + + ACTION_SET_UNIT_SUCCESS_BP:RCTModule.ACTION_SET_UNIT_SUCCESS_BP, + ACTION_SET_ANGLE_SUCCESS_BP:RCTModule.ACTION_SET_ANGLE_SUCCESS_BP, + ACTION_ENABLE_OFFLINE_BP:RCTModule.ACTION_ENABLE_OFFLINE_BP, + ACTION_DISENABLE_OFFLINE_BP:RCTModule.ACTION_DISENABLE_OFFLINE_BP, + ACTION_IS_ENABLE_OFFLINE:RCTModule.ACTION_IS_ENABLE_OFFLINE, + + IS_ENABLE_OFFLINE:RCTModule.IS_ENABLE_OFFLINE, + + ACTION_INTERRUPTED_BP:RCTModule.ACTION_INTERRUPTED_BP, + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} 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() + } +} diff --git a/libs/ihealth-sdk/module/BTMProfileModule.js b/libs/ihealth-sdk/module/BTMProfileModule.js new file mode 100755 index 0000000..5d88dc6 --- /dev/null +++ b/libs/ihealth-sdk/module/BTMProfileModule.js @@ -0,0 +1,33 @@ +/** + * Created by lixuesong on 15/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.BTMProfileModule + +/** + * @module BTMProfileModule + */ +module.exports = { + + ACTION_BTM_BATTERY: RCTModule.ACTION_BTM_BATTERY, + ACTION_BTM_MEMORY: RCTModule.ACTION_BTM_MEMORY, + ACTION_BTM_MEASURE: RCTModule.ACTION_BTM_MEASURE, + ACTION_BTM_CALLBACK: RCTModule.ACTION_BTM_CALLBACK, + ACTION_ERROR_BTM: RCTModule.ACTION_ERROR_BTM, + + //Keys + BTM_BATTERY: RCTModule.BTM_BATTERY, + MEMORY_COUNT: RCTModule.MEMORY_COUNT, + BTM_TEMPERATURE_ARRAY: RCTModule.BTM_TEMPERATURE_ARRAY, + BTM_TEMPERATURE_TARGET: RCTModule.BTM_TEMPERATURE_TARGET, + BTM_TEMPERATURE: RCTModule.BTM_TEMPERATURE, + BTM_MEASURE_TIME: RCTModule.BTM_MEASURE_TIME, + ERROR_NUM_BTM: RCTModule.ERROR_NUM_BTM, + ERROR_DESCRIPTION_BTM: RCTModule.ERROR_DESCRIPTION_BTM, + + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/ECGModule.js b/libs/ihealth-sdk/module/ECGModule.js new file mode 100755 index 0000000..439dd99 --- /dev/null +++ b/libs/ihealth-sdk/module/ECGModule.js @@ -0,0 +1,60 @@ +/** + * + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.ECGModule; + +/** + * @module ECGModule + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * SyncTime. + */ + sysTime: function (mac) { + RCTModule.sysTime(mac) + }, + + /** + * startMeasure + */ + startMeasure: function (mac) { + RCTModule.startMeasure(mac) + }, + /** + * getBattery + * @param {string} serialNumber the mac address of scale + */ + getBattery: function (mac) { + RCTModule.getBattery(mac) + }, + /** + * stopMeasure + */ + stopMeasure: function (mac) { + RCTModule.stopMeasure(mac) + }, + /** + * Get all connected ECG device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, + /** + * Disconnect the ECG3 + * @param mac The mac address + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + } +} diff --git a/libs/ihealth-sdk/module/ECGProfileModule.js b/libs/ihealth-sdk/module/ECGProfileModule.js new file mode 100755 index 0000000..4377e9c --- /dev/null +++ b/libs/ihealth-sdk/module/ECGProfileModule.js @@ -0,0 +1,208 @@ +/** + * + */ +'use strict'; + + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.ECGProfileModule; + +/** + * @module ECGProfileModule + */ +module.exports = { + + /** + * The action value of event indicates the error of ECG device. + */ + ACTION_ERROR_ECG:RCTModule.ACTION_ERROR_ECG, + + /** + * The Key of error number of ECG device. + */ + ERROR_NUM_ECG:RCTModule.ERROR_NUM_ECG, + + /** + * The Key of error description of ECG device. + */ + ERROR_DESCRIPTION_ECG:RCTModule.ERROR_DESCRIPTION_ECG, + + /** + * The action value of event indicates the battery of ECG device. + */ + ACTION_BATTERY_ECG:RCTModule.ACTION_BATTERY_ECG, + + /** + * The Key of BATTERY_ECG for ECG device. + */ + BATTERY_ECG:RCTModule.BATTERY_ECG, + + /** + * sync time. + */ + ACTION_SYSTIME:RCTModule.ACTION_SYSTIME, + + /** + * Stop Measure. + */ + ACTION_STOPMEASURE_ECG:RCTModule.ACTION_STOPMEASURE_ECG, + + /** + * ACTION_MEASURE_WAVEData.
    + * + * examples:
    + * {"MEASURE_WAVEData":[-2.2548201084136963,-2.531399965286255,-2.8357763290405273,-3.1377346515655518,-3.4188733100891113,-3.680877685546875],"mac":"FC86F8390F66","type":"ECG3","action":"ACTION_MEASURE_WAVEData"}
    + */ + ACTION_MEASURE_WAVEData:RCTModule.ACTION_MEASURE_WAVEData, + + MEASURE_WAVEData:RCTModule.MEASURE_WAVEData, + /** + * ACTION_MEASURE_ECGPulse.
    + * Value range:

    + * examples:
    + * {"MEASURE_ECGPulse":0,"action":"ACTION_MEASURE_ECGPulse","mac":"FC86F8390F66","type":"ECG3"} + */ + ACTION_MEASURE_ECGPulse:RCTModule.ACTION_MEASURE_ECGPulse, + + MEASURE_ECGPulse:RCTModule.MEASURE_ECGPulse, + /** + * ACTION_STARTSYNCDATA_ECGUSB.
    + * Value range:

    + * true: sufficiently
    + * false: insufficiently + */ + ACTION_STARTSYNCDATA_ECGUSB:RCTModule.ACTION_STARTSYNCDATA_ECGUSB, + /** + * ACTION_SYNCDATAINFO_ECGUSB.
    + * Value range:

    + * true: sufficiently
    + * false: insufficiently + */ + ACTION_SYNCDATAINFO_ECGUSB:RCTModule.ACTION_SYNCDATAINFO_ECGUSB, + /** + * DATAINFO.
    + * Value range:

    + * true: sufficiently
    + * false: insufficiently + */ + DATAINFO:RCTModule.DATAINFO, + /** + * ACTION_SYNCDATAPROGRESS_ECGUSB.
    + * Value range:

    + * true: sufficiently
    + * false: insufficiently + */ + ACTION_SYNCDATAPROGRESS_ECGUSB:RCTModule.ACTION_SYNCDATAPROGRESS_ECGUSB, + /** + * PROGRESS.
    + * Value range:

    + * true: sufficiently
    + * false: insufficiently + */ + PROGRESS:RCTModule.PROGRESS, + /** + * ACTION_DELETEDATA_ECGUSB.
    + * Value range:

    + * true: sufficiently
    + * false: insufficiently + */ + ACTION_DELETEDATA_ECGUSB:RCTModule.ACTION_DELETEDATA_ECGUSB, + /** + * Indicates get all connected devices. + */ + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES, + /** + * ECGUSB error action. + */ + ACTION_ERROR_ECGUSB:RCTModule.ACTION_ERROR_ECGUSB, + /** + * ECGUSB error number. + * + * Value range:
    + * + *

    0:Query command timeout

    + *

    1:Received SD card info is wrong.

    + *

    2:Receive devce's error log: SD card error.

    + *

    3:There is not enough space for ECG's offline data.

    + *

    4:Receive wrong data.

    + *

    5:Receive wrong data.

    + *

    6:Receive data timeout.

    + *

    7:Save file error.

    + *

    8:Device is disconnected.

    + *

    9:Format fail.

    + *

    13:Format command timeout.

    + *

    500:Command timeout.

    + */ + ERROR_NUM_ECGUSB:RCTModule.ERROR_NUM_ECGUSB, + /** + * ECGUSB error description. + * + * Value range:
    + * + *

    0:Query command timeout

    + *

    1:Received SD card info is wrong.

    + *

    2:Receive devce's error log: SD card error.

    + *

    3:There is not enough space for ECG's offline data.

    + *

    4:Receive wrong data.

    + *

    5:Receive wrong data.

    + *

    6:Receive data timeout.

    + *

    7:Save file error.

    + *

    8:Device is disconnected.

    + *

    9:Format fail.

    + *

    10:Splicing files fail.

    + *

    11:get ECG data from cache fail.

    + *

    12:get filter files fail by filename.

    + *

    500:Command timeout.

    + */ + + ERROR_DESCRIPTION_ECGUSB:RCTModule.ERROR_DESCRIPTION_ECGUSB, + /** + * Splice action. + */ + ACTION_SPLICE:RCTModule.ACTION_SPLICE, + /** + * The key of splice result. + */ + SPLICE_DATA:RCTModule.SPLICE_DATA, + /** + * The key of splice error description. + */ + SPLICE_ERROR_DESCRIPTION:RCTModule.SPLICE_ERROR_DESCRIPTION, + /** + * Electrode status action. + */ + ACTION_ELECTRODE_STATUS:RCTModule.ACTION_ELECTRODE_STATUS, + /** + * Electrode status. In fact, 2 and 3 will not send. Receive ACTION_MEASURE_WAVEData again means Electrode loss recovery.
    + * + * Value range:
    + *

    1:Electrode Loss.

    + *

    2:Electrode Loss Recovery.

    + *

    3:Electrode Loss Timeout.

    + */ + ELECTRODE_STATUS:RCTModule.ELECTRODE_STATUS, + /** + * Get cache. + * If app crashes during syncData, there may be some data not return to your callback (ACTION_SYNCDATAINFO_ECGUSB). Then you can call this api to get the unreturned data. + */ + ACTION_GET_CACHE:RCTModule.ACTION_GET_CACHE, + /** + * The key of getCache result. + */ + GET_CACHE_DATA:RCTModule.GET_CACHE_DATA, + /** + * Filter. + * To analyze the SPLICE_DATA returned by synthesize api. + */ + ACTION_FILTER:RCTModule.ACTION_FILTER, + /** + * The key of filter result. + */ + FILTER_DATA:RCTModule.FILTER_DATA, + /** + * The key of filter error description. only for iOS + */ + FILTER_ERROR_DESCRIPTION:RCTModule.FILTER_ERROR_DESCRIPTION + +} diff --git a/libs/ihealth-sdk/module/ECGUSBModule.js b/libs/ihealth-sdk/module/ECGUSBModule.js new file mode 100755 index 0000000..29e3a17 --- /dev/null +++ b/libs/ihealth-sdk/module/ECGUSBModule.js @@ -0,0 +1,119 @@ +/** + * + */ +'use strict'; + +var { NativeModules, Platform } = require('react-native'); + +var RCTModule = NativeModules.ECGUSBModule + +/** + * @module ECGUSBModule + */ +module.exports = { + /** + * Notify event type for ECG + */ + Event_Notify: RCTModule.Event_Notify, + + /** + * SyncTime. + */ + syncData: function () { + RCTModule.syncData() + }, + + /** + * deleteData. + */ + deleteData: function () { + RCTModule.deleteData() + }, + + /** + * Get all connected ECG device + * + * e.g. {"devices":"A4D5783FB00C"} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, + + /** + * Get device idps info (only for android) + * + * e.g. {"firmwareversion":"1.2.6","serialnumber":"F26265594E00","modenumber":"ECG3 11070","hardwareversion":"3.1.0","manufacture":"iHealth","accessoryname":"ECG recorder","protocolstring":"com.jiuan.ECGV10"} + */ + getIdps: function () { + RCTModule.getIdps() + }, + + /** + * Splicing original files + * + * You can add a listener for ECGProfileModule.ACTION_SPLICE; + * + * success example: + * + * {"action":ECGProfileModule.ACTION_SPLICE,ECGProfileModule.SPLICE_DATA:{"DataFileName":"ECG_Total_Data_yyyyMMddHHmmss.dat","MarkFileName":"ECG_Total_Mark_yyyyMMddHHmmss.txt","StartTime":"yyyyMMddHHmmss","EndTime":"yyyyMMddHHmmss","FilePath":"xxx"},"type":"ECG3USB","mac":"F26265594E00"} + * + * fail example: + * + * {"action":ECGProfileModule.ACTION_SPLICE,ECGProfileModule.SPLICE_ERROR_DESCRIPTION:"fileNames's length is less than 1.","type":"ECG3USB","mac":""} + * + * + */ + spliceData: function (filesNames){ + RCTModule.spliceData(filesNames) + }, + + + /** + * Get cache + * + * You can add a listener for ECGProfileModule.ACTION_GET_CACHE; + * + * result example: + * + * {"action":ECGProfileModule.ACTION_GET_CACHE,ECGProfileModule.GET_CACHE_DATA:[see ECGProfileModule.DATAINFO],"type":"ECG3USB","mac":"F26265594E00"} + * + */ + getCache: function () { + RCTModule.getCache() + }, + + /** + * Delete cache files + * only android + * if you get the cache files of ECG, you should clear the cache files + */ + deleteCacheData: function (){ + if (Platform.OS === 'ios'){ + console.log('deleteCacheData is not available in iOS.') + } else { + RCTModule.deleteCacheData() + } + }, + + /** + * get ECG filter files by filename + * + * you can edit "ECG_Data_20180930123000" and "ECG_Mark_20180930123000" + * or can edit "ECG_Total_Data_20180930123000" and "ECG_Mark_Data_20180930123000" + * + * You can add a listener for ECGProfileModule.ACTION_FILTER; + * + * success example: + * + * {"action":ECGProfileModule.ACTION_FILTER,ECGProfileModule.FILTER_DATA:[{"SampleRate":249.999999,"FileName":"ECG_SDK_yyyyMMddHHmmss","StartTime":"yyyyMMddHHmmss","EndTime":"yyyyMMddHHmmss","FilePath":"xxx"}],"type":"ECG3USB","mac":"F26265594E00"} + * + * fail example: + * + * {"action":ECGProfileModule.ACTION_FILTER,ECGProfileModule.FILTER_ERROR_DESCRIPTION:"input parameter is invalid.","type":"ECG3USB","mac":"F26265594E00"} + * + * + */ + getFilterDataByFileName: function (dataFileName ,markFileName){ + RCTModule.getFilterDataByFileName(dataFileName,markFileName) + } +} diff --git a/libs/ihealth-sdk/module/HS2Module.js b/libs/ihealth-sdk/module/HS2Module.js new file mode 100755 index 0000000..5430b20 --- /dev/null +++ b/libs/ihealth-sdk/module/HS2Module.js @@ -0,0 +1,63 @@ +/** + * Created by lixuesong on 11/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.HS2Module + +/** + * @module hs2Module + */ +module.exports = { + /** + * Notify event type for hs2 + */ + Event_Notify: RCTModule.Event_Notify, + + /** + * Start real-time measurement. + * @param {string} mac Device's mac address + * @param {string} unit Device's unit + * @param {string} userId user id + */ + measureOnline: function (mac, unit, userId) { + RCTModule.measureOnline(mac, unit, userId) + }, + + /** + * Get the value of historical data in the hs2. + * @param {string} mac Device's mac address + */ + getOfflineData: function (mac) { + RCTModule.getOfflineData(mac) + }, + + /** + * Disconnect the HS2 + * @param mac The mac address for blood pressure monitor + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Get all connected hs2 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, + + /** + * Get all connected hs2 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getBattery: function (mac) { + RCTModule.getBattery(mac) + } +} 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 @@ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.HS2SModule + +/** + * @module hs2sModule + */ +module.exports = { + /** + * Notify event type for hs2s + */ + Event_Notify: RCTModule.Event_Notify, + + + getDeviceInfo: function (mac) { + RCTModule.getDeviceInfo(mac) + }, + /** + * Get hs2s device battary + * + */ + getBattery: function (mac) { + RCTModule.getBattery(mac) + }, + + setUnit: function (mac,unit) { + RCTModule.setUnit(mac,unit) + }, + getUserInfo: function (mac) { + RCTModule.getUserInfo(mac) + }, + updateUserInfo: function (mac,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark) { + RCTModule.updateUserInfo(mac,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark); + }, + + deleteUser: function (mac,userID) { + RCTModule.deleteUser(mac,userID); + }, + + getMemoryDataCount: function (mac,userID) { + RCTModule.getMemoryDataCount(mac,userID); + }, + + getMemoryData: function (mac,userID) { + RCTModule.getMemoryData(mac,userID); + }, + + deleteMemoryData: function (mac,userID) { + RCTModule.deleteMemoryData(mac,userID); + }, + + getAnonymousMemoryDataCount: function (mac) { + RCTModule.getAnonymousMemoryDataCount(mac); + }, + + getAnonymousMemoryData: function (mac) { + RCTModule.getAnonymousMemoryData(mac); + }, + + deleteAnonymousMemoryData: function (mac) { + RCTModule.deleteAnonymousMemoryData(mac) + }, + + measure: function (mac,userType,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark) { + RCTModule.measure(mac,userType,userID,createTS,weight,age,height,sex,impedanceMark,fitnessMark) + }, + + resetDevice: function (mac) { + RCTModule.resetDevice(mac) + }, + + broadCastTypeDevice: function (mac) { + RCTModule.broadCastTypeDevice(mac) + }, + + setDeviceLightUp: function (mac) { + RCTModule.setDeviceLightUp(mac) + }, + + enterHS2SHeartRateMeasurementMode: function (mac) { + RCTModule.enterHS2SHeartRateMeasurementMode(mac) + }, + + exitHS2SHeartRateMeasurementMode: function (mac) { + RCTModule.exitHS2SHeartRateMeasurementMode(mac) + }, + + + /** + * Disconnect the HS2S + * @param mac The mac address for blood pressure monitor + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Get all connected hs2s device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } + + +} diff --git a/libs/ihealth-sdk/module/HS2SProfileModule.js b/libs/ihealth-sdk/module/HS2SProfileModule.js new file mode 100644 index 0000000..7c0368b --- /dev/null +++ b/libs/ihealth-sdk/module/HS2SProfileModule.js @@ -0,0 +1,103 @@ +'use strict'; + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.HS2SProfileModule + +/** + * @module HS2SProfileModule + */ +module.exports = { + + ACTION_ERROR_HS: RCTModule.ACTION_ERROR_HS, + ERROR_NUM_HS: RCTModule.ERROR_NUM_HS, + ERROR_DESCRIPTION_HS: RCTModule.ERROR_DESCRIPTION_HS, + + ACTION_GET_DEVICE_INFO: RCTModule.ACTION_GET_DEVICE_INFO, + HS_USER_COUNT: RCTModule.HS_USER_COUNT, + HS_UNIT_CURRENT: RCTModule.HS_UNIT_CURRENT, + + ACTION_BATTERY_HS: RCTModule.ACTION_BATTERY_HS, + BATTERY_HS: RCTModule.BATTERY_HS, + + ACTION_SET_UNIT_SUCCESS: RCTModule.ACTION_SET_UNIT_SUCCESS, + + ACTION_GET_USER_INFO: RCTModule.ACTION_GET_USER_INFO, + USER_INFO_COUNT: RCTModule.USER_INFO_COUNT, + USER_INFO_ARRAY: RCTModule.USER_INFO_ARRAY, + USER_INFO_USER_ID: RCTModule.USER_INFO_USER_ID, + USER_INFO_CREATE_TIME: RCTModule.USER_INFO_CREATE_TIME, + USER_INFO_WEIGHT: RCTModule.USER_INFO_WEIGHT, + USER_INFO_GENDER: RCTModule.USER_INFO_GENDER, + USER_INFO_AGE: RCTModule.USER_INFO_AGE, + USER_INFO_HEIGHT: RCTModule.USER_INFO_HEIGHT, + USER_INFO_IMPEDANCE: RCTModule.USER_INFO_IMPEDANCE, + USER_INFO_BODYBUILDING: RCTModule.USER_INFO_BODYBUILDING, + + ACTION_CREATE_OR_UPDATE_USER_INFO: RCTModule.ACTION_CREATE_OR_UPDATE_USER_INFO, + OPERATION_STATUS: RCTModule.OPERATION_STATUS, + OPERATION_DESCRIBE: RCTModule.OPERATION_DESCRIBE, + + ACTION_DELETE_USER_INFO: RCTModule.ACTION_DELETE_USER_INFO, + + ACTION_SPECIFY_USERS: RCTModule.ACTION_SPECIFY_USERS, + + ACTION_MEASURE_FINISH_AT_CRITICAL: RCTModule.ACTION_MEASURE_FINISH_AT_CRITICAL, + + ACTION_HISTORY_DATA_NUM: RCTModule.ACTION_HISTORY_DATA_NUM, + HISTORY_DATA_USER_COUNT: RCTModule.HISTORY_DATA_USER_COUNT, + HISTORY_DATA_COUNT_ARRAY: RCTModule.HISTORY_DATA_COUNT_ARRAY, + HISTORY_DATA_COUNT: RCTModule.HISTORY_DATA_COUNT, + + ACTION_HISTORY_DATA: RCTModule.ACTION_HISTORY_DATA, + DATA_ID: RCTModule.DATA_ID, + DATA_WEIGHT: RCTModule.DATA_WEIGHT, + DATA_IMPEDANCE: RCTModule.DATA_IMPEDANCE, + DATA_USER_NUM: RCTModule.DATA_USER_NUM, + DATA_GENDER: RCTModule.DATA_GENDER, + DATA_AGE: RCTModule.DATA_AGE, + DATA_HEIGHT: RCTModule.DATA_HEIGHT, + DATA_MEASURE_TIME: RCTModule.DATA_MEASURE_TIME, + DATA_RIGHT_TIME: RCTModule.DATA_RIGHT_TIME, + DATA_BODYBUILDING: RCTModule.DATA_BODYBUILDING, + DATA_INSTRUCTION_TYPE: RCTModule.DATA_INSTRUCTION_TYPE, + DATA_BODY_FIT_PERCENTAGE: RCTModule.DATA_BODY_FIT_PERCENTAGE, + DATA_MUSCLE_MASS: RCTModule.DATA_MUSCLE_MASS, + DATA_BONE_SALT_CONTENT: RCTModule.DATA_BONE_SALT_CONTENT, + DATA_BODY_WATER_RATE: RCTModule.DATA_BODY_WATER_RATE, + DATA_PROTEIN_RATE: RCTModule.DATA_PROTEIN_RATE, + DATA_SKELETAL_MUSCLE_MASS: RCTModule.DATA_SKELETAL_MUSCLE_MASS, + DATA_BASAL_METABOLIC_RATE: RCTModule.DATA_BASAL_METABOLIC_RATE, + DATA_VISCERAL_FAT_GRADE: RCTModule.DATA_VISCERAL_FAT_GRADE, + DATA_PHYSICAL_AGE: RCTModule.DATA_PHYSICAL_AGE, + DATA_BODY_MASS_INDEX: RCTModule.DATA_BODY_MASS_INDEX, + + DATA_STANDARD_WEIGHT: RCTModule.DATA_STANDARD_WEIGHT, + DATA_WEIGHT_CONTROL: RCTModule.DATA_WEIGHT_CONTROL, + DATA_MUSCLE_CONTROL: RCTModule.DATA_MUSCLE_CONTROL, + DATA_FAT_CONTROL: RCTModule.DATA_FAT_CONTROL, + DATA_FAT_WEIGHT: RCTModule.DATA_FAT_WEIGHT, + DATA_DE_FAT_WEIGHT: RCTModule.DATA_DE_FAT_WEIGHT, + + ACTION_ONLINE_RESULT: RCTModule.ACTION_ONLINE_RESULT, + ACTION_DELETE_HISTORY_DATA: RCTModule.ACTION_DELETE_HISTORY_DATA, + + ACTION_ANONYMOUS_DATA_NUM: RCTModule.ACTION_ANONYMOUS_DATA_NUM, + ANONYMOUS_DATA_COUNT: RCTModule.ANONYMOUS_DATA_COUNT, + + ACTION_DELETE_ANONYMOUS_DATA: RCTModule.ACTION_DELETE_ANONYMOUS_DATA, + ACTION_ONLINE_REAL_TIME_WEIGHT: RCTModule.ACTION_ONLINE_REAL_TIME_WEIGHT, + ACTION_BODY_FAT_RESULT: RCTModule.ACTION_BODY_FAT_RESULT, + DATA_BODY_FAT_RESULT: RCTModule.DATA_BODY_FAT_RESULT, + + ACTION_HS2S_LightUp_DEVICE: RCTModule.ACTION_HS2S_LightUp_DEVICE, + HS2S_DEVICE_STATUS: RCTModule.HS2S_DEVICE_STATUS, + + ACTION_HS2S_MEASURE_HEARTRATE: RCTModule.ACTION_HS2S_MEASURE_HEARTRATE, + HS2S_MEASURE_HEARTRATE_RESULT: RCTModule.HS2S_MEASURE_HEARTRATE_RESULT, + ACTION_HS2S_EXIT_MEASURE_HEARTRATE_STATUS: RCTModule.ACTION_HS2S_EXIT_MEASURE_HEARTRATE_STATUS, + + ACTION_RESTORE_FACTORY_SETTINGS: RCTModule.ACTION_RESTORE_FACTORY_SETTINGS, + + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/HS4SModule.js b/libs/ihealth-sdk/module/HS4SModule.js new file mode 100755 index 0000000..5bba0c3 --- /dev/null +++ b/libs/ihealth-sdk/module/HS4SModule.js @@ -0,0 +1,53 @@ +/** + * Created by lixuesong on 11/11/2016. + */ +'use strict'; + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.HS4SModule + +/** + * @module HS4SModule + */ +module.exports = { + /** + * Notify event type for HS4S + */ + Event_Notify: RCTModule.Event_Notify, + + /** + * Start real-time measurement. + * @param {string} mac Device's mac address + * @param {string} unit Device's unit + * @param {string} userId user id + */ + measureOnline: function (mac, unit, userId) { + RCTModule.measureOnline(mac, unit, userId) + }, + + /** + * Get the value of historical data in the HS4S. + * @param {string} mac Device's mac address + */ + getOfflineData: function (mac) { + RCTModule.getOfflineData(mac) + }, + + /** + * Disconnect the HS4S + * @param mac The mac address for blood pressure monitor + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Get all connected HS4S device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + }, +} diff --git a/libs/ihealth-sdk/module/HS6Module.js b/libs/ihealth-sdk/module/HS6Module.js new file mode 100755 index 0000000..06356cd --- /dev/null +++ b/libs/ihealth-sdk/module/HS6Module.js @@ -0,0 +1,94 @@ +/** + * Created by lixuesong on 11/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.HS6Module + +/** + * @module HS6Module + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Initializes method. + * @param {string} userName the name of user + */ + init: function (userName) { + RCTModule.init(userName) + }, + + /** + * Set wifi to the scale. + * @param {string} ssid the name of net + * @param {string} password the password of the net + */ + setWifi: function (ssid, password) { + RCTModule.setWifi(ssid, password) + }, + + /** + * Bind the user and scale together,after bind success user's weight datas can be transmitted to the cloud. + * And this method is a time consuming operation that cannot be called in the main thread. + * @param {string} birthday format like yyyy-MM-dd HH:mm:ss + * @param {float} weight the unit is kg + * @param {int} height the unit is cm + * @param {int} isSporter is sporter; 2 is not ;3 unknown + * @param {int} gender 0 is male ;1 is female + * @param {string} serialNumber the mac address of the scale + */ + bindDeviceHS6: function (birthday, weight, height, isSporter, gender, serialNumber) { + RCTModule.bindDeviceHS6(birthday, weight, height, isSporter, gender, serialNumber) + }, + + /** + * Unbind the user and scale,and this method is a time consuming operation that cannot be called in the main thread. + * @param {string} serialNumber the mac address of scale + */ + unBindDeviceHS6: function (serialNumber) { + RCTModule.unBindDeviceHS6(serialNumber) + }, + + /** + * Get AccessToken of HS6 user,and this method is a time consuming operation that cannot be called + * in the main thread. + * After get AccessToken, you can call openApi(http://developer.ihealthlabs.com) to pull data form iHealth cloud. + * @param {string} clientId the identification of the SDK + * @param {string} clientSecret the identification of the SDK + * @param {string} username the identification of the user + * @param {string} clientPara a random string,return back without change + */ + getToken: function (clientId, clientSecret, username, clientPara) { + RCTModule.getToken(clientId, clientSecret, username, clientPara) + }, + + /** + * Set unit of HS6,and this method is a time consuming operation that cannot be called + * in the main thread. + * @param {string} username the identification of the user + * @param {int} unitType the unit type + *

    0 Kg + *

    1 lbs + *

    2 st + */ + setUnit: function (username, unitType) { + RCTModule.setUnit(username, unitType) + }, + + /** + * DownloadHS6 CloudData + * @param {string} clientId the identification of the SDK + * @param {string} clientSecret the identification of the SDK + * @param {string} username the identification of the user + * @param {long} ts time stamp of HS6 measure data. UTC time, unit in milliseconds. + * @param {long} pageSize the specific size of data in one download progress + */ + getCloudData: function (clientId, clientSecret, username, ts, pageSize) { + RCTModule.getCloudData(clientId, clientSecret, username, ts, pageSize) + }, +} diff --git a/libs/ihealth-sdk/module/HS6ProfileModule.js b/libs/ihealth-sdk/module/HS6ProfileModule.js new file mode 100755 index 0000000..d461b5c --- /dev/null +++ b/libs/ihealth-sdk/module/HS6ProfileModule.js @@ -0,0 +1,50 @@ +/** + * Created by lixuesong on 15/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.HS6ProfileModule + +/** + * @module HS6ProfileModule + */ +module.exports = { + + ACTION_HS6_SETWIFI: RCTModule.ACTION_HS6_SETWIFI, + ACTION_HS6_BIND: RCTModule.ACTION_HS6_BIND, + ACTION_HS6_UNBIND: RCTModule.ACTION_HS6_UNBIND, + ACTION_HS6_GET_TOKEN: RCTModule.ACTION_HS6_GET_TOKEN, + ACTION_HS6_SET_UNIT: RCTModule.ACTION_HS6_SET_UNIT, + + ACTION_HS6_GET_CLOUDDATA:RCTModule.ACTION_HS6_GET_CLOUDDATA, + HS6_CLOUDDATA:RCTModule.HS6_CLOUDDATA, + + ACTION_HS6_GET_CLOUDDATA_LASTTS:RCTModule.ACTION_HS6_GET_CLOUDDATA_LASTTS, + HS6_CLOUDDATA_LASTTS:RCTModule.HS6_CLOUDDATA_LASTTS, + + ACTION_HS6_GET_CLOUDDATA_LEFTNUM:RCTModule.ACTION_HS6_GET_CLOUDDATA_LEFTNUM, + HS6_CLOUDDATA_LEFTNUM:RCTModule.HS6_CLOUDDATA_LEFTNUM, + + ACTION_HS6_ERROR: RCTModule.ACTION_HS6_ERROR, + ACTION_HS6_GET_DATA: RCTModule.ACTION_HS6_GET_DATA, + + //Keys + SETWIFI_RESULT: RCTModule.SETWIFI_RESULT, + HS6_BIND_EXTRA: RCTModule.HS6_BIND_EXTRA, + BIND_HS6_RESULT: RCTModule.BIND_HS6_RESULT, + HS6_MODEL: RCTModule.HS6_MODEL, + HS6_POSITION: RCTModule.HS6_POSITION, + HS6_SETTED_WIFI: RCTModule.HS6_SETTED_WIFI, + HS6_UNBIND_RESULT: RCTModule.HS6_UNBIND_RESULT, + GET_TOKEN_RESULT: RCTModule.GET_TOKEN_RESULT, + SET_UNIT_RESULT: RCTModule.SET_UNIT_RESULT, + HS6_ERROR: RCTModule.HS6_ERROR, + + DATA_RESULT: RCTModule.DATA_RESULT, + DATA_DOWNLOAD_TS: RCTModule.DATA_DOWNLOAD_TS, + + DATA_LEFTNUMBER: RCTModule.DATA_LEFTNUMBER +} diff --git a/libs/ihealth-sdk/module/HSProfileModule.js b/libs/ihealth-sdk/module/HSProfileModule.js new file mode 100755 index 0000000..0c63c27 --- /dev/null +++ b/libs/ihealth-sdk/module/HSProfileModule.js @@ -0,0 +1,42 @@ +/** + * Created by lixuesong on 15/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.HSProfileModule + +/** + * @module HSProfileModule + */ +module.exports = { + + ACTION_LIVEDATA_HS: RCTModule.ACTION_LIVEDATA_HS, + ACTION_ONLINE_RESULT_HS: RCTModule.ACTION_ONLINE_RESULT_HS, + ACTION_HISTORICAL_DATA_HS: RCTModule.ACTION_HISTORICAL_DATA_HS, + ACTION_HISTORICAL_DATA_COMPLETE_HS: RCTModule.ACTION_HISTORICAL_DATA_COMPLETE_HS, + ACTION_NO_HISTORICALDATA: RCTModule.ACTION_NO_HISTORICALDATA, + ACTION_ERROR_HS: RCTModule.ACTION_ERROR_HS, + + //Keys + LIVEDATA_HS: RCTModule.LIVEDATA_HS, + DATAID: RCTModule.DATAID, + WEIGHT_HS: RCTModule.WEIGHT_HS, + FAT_HS: RCTModule.FAT_HS, + WATER_HS: RCTModule.WATER_HS, + MUSCLE_HS: RCTModule.MUSCLE_HS, + SKELETON_HS: RCTModule.SKELETON_HS, + FATELEVEL_HS: RCTModule.FATELEVEL_HS, + DCI_HS: RCTModule.DCI_HS, + HISTORDATA__HS: RCTModule.HISTORDATA__HS, + MEASUREMENT_DATE_HS: RCTModule.MEASUREMENT_DATE_HS, + + ERROR_NUM_HS: RCTModule.ERROR_NUM_HS, + ERROR_ID_ILLEGAL_ARGUMENT: RCTModule.ERROR_ID_ILLEGAL_ARGUMENT, + ERROR_ID_WIFI_DISABLED: RCTModule.ERROR_ID_WIFI_DISABLED, + ERROR_DESCRIPTION_HS: RCTModule.ERROR_DESCRIPTION_HS, + + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/NT13BModule.js b/libs/ihealth-sdk/module/NT13BModule.js new file mode 100644 index 0000000..81392fc --- /dev/null +++ b/libs/ihealth-sdk/module/NT13BModule.js @@ -0,0 +1,39 @@ +'use strict'; + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.NT13BModule + + /** + * @module NT13BModule + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * listen measurement + * @param {string} mac Device's mac address + */ + measure: function (mac) { + RCTModule.measure(mac) + }, + + /** + * Disconnect the nt13b + * @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() + } +} + diff --git a/libs/ihealth-sdk/module/NT13BProfileModule.js b/libs/ihealth-sdk/module/NT13BProfileModule.js new file mode 100644 index 0000000..93e6604 --- /dev/null +++ b/libs/ihealth-sdk/module/NT13BProfileModule.js @@ -0,0 +1,20 @@ +'use strict'; + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.NT13BProfileModule + +/** + * @module NT13BProfileModule + */ +module.exports = { + ACTION_MEASUREMENT_RESULT: RCTModule.ACTION_MEASUREMENT_RESULT, + UNIT_FLAG: RCTModule.UNIT_FLAG, + RESULT: RCTModule.RESULT, + TS_FLAG: RCTModule.TS_FLAG, + TS: RCTModule.TS, + THERMOMETER_TYPE_FLAG: RCTModule.THERMOMETER_TYPE_FLAG, + THERMOMETER_TYPE: RCTModule.THERMOMETER_TYPE, + + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/PO1Module.js b/libs/ihealth-sdk/module/PO1Module.js new file mode 100644 index 0000000..2b877bd --- /dev/null +++ b/libs/ihealth-sdk/module/PO1Module.js @@ -0,0 +1,38 @@ +'use strict'; + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.PO1Module + +/** + * @module PO1Module + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Get the PO1 battery status. + * @param {string} mac Device's mac address + */ + getBattery: function (mac) { + RCTModule.getBattery(mac) + }, + + /** + * Disconnect the PO1 + * @param mac The mac address + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Get all connected PO1 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +} diff --git a/libs/ihealth-sdk/module/PO1ProfileModule.js b/libs/ihealth-sdk/module/PO1ProfileModule.js new file mode 100644 index 0000000..329b72a --- /dev/null +++ b/libs/ihealth-sdk/module/PO1ProfileModule.js @@ -0,0 +1,33 @@ +/** + * Created by lixuesong on 15/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.PO1ProfileModule + +/** + * @module POProfileModule + */ +module.exports = { + + //Actions + ACTION_BO_MEASUREMENT: RCTModule.ACTION_BO_MEASUREMENT, + ACTION_GET_BATTERY: RCTModule.ACTION_GET_BATTERY, + ACTION_ERROR_PO1: RCTModule.ACTION_ERROR_PO1, + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES, + + //Keys + ERROR_ID: RCTModule.ERROR_ID, + ERROR_DESCRIPTION: RCTModule.ERROR_DESCRIPTION, + BATTERY: RCTModule.BATTERY, + STATUS: RCTModule.STATUS, + BLOOD_OXYGEN: RCTModule.BLOOD_OXYGEN, + PULSE: RCTModule.PULSE, + PULSE_FORCE: RCTModule.PULSE_FORCE, + PI: RCTModule.PI, + WAVE: RCTModule.WAVE, + +} diff --git a/libs/ihealth-sdk/module/PO3Module.js b/libs/ihealth-sdk/module/PO3Module.js new file mode 100755 index 0000000..2185bcf --- /dev/null +++ b/libs/ihealth-sdk/module/PO3Module.js @@ -0,0 +1,58 @@ +/** + * Created by lixuesong on 11/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.PO3Module + +/** + * @module PO3Module + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * Get the PO3 battery status. + * @param {string} mac Device's mac address + */ + getBattery: function (mac) { + RCTModule.getBattery(mac) + }, + + /** + * Start real-time measurement. + * @param {string} mac Device's mac address + */ + startMeasure: function (mac) { + RCTModule.startMeasure(mac) + }, + + /** + * Get the value of historical data in the PO3. + * @param {string} mac Device's mac address + */ + getHistoryData: function (mac) { + RCTModule.getHistoryData(mac) + }, + + /** + * Disconnect the PO3 + * @param mac The mac address + */ + disconnect: function (mac) { + RCTModule.disconnect(mac) + }, + + /** + * Get all connected PO3 device + * + * e.g. {"devices":["A4D5783FB00C","A4D5783FFE58"]} + */ + getAllConnectedDevices: function () { + RCTModule.getAllConnectedDevices() + } +} diff --git a/libs/ihealth-sdk/module/POProfileModule.js b/libs/ihealth-sdk/module/POProfileModule.js new file mode 100755 index 0000000..1e50159 --- /dev/null +++ b/libs/ihealth-sdk/module/POProfileModule.js @@ -0,0 +1,34 @@ +/** + * Created by lixuesong on 15/11/2016. + */ +'use strict'; + + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.POProfileModule + +/** + * @module POProfileModule + */ +module.exports = { + + ACTION_BATTERY_PO: RCTModule.ACTION_BATTERY_PO, + ACTION_LIVEDA_PO: RCTModule.ACTION_LIVEDA_PO, + ACTION_RESULTDATA_PO: RCTModule.ACTION_RESULTDATA_PO, + ACTION_OFFLINEDATA_PO: RCTModule.ACTION_OFFLINEDATA_PO, + ACTION_NO_OFFLINEDATA_PO: RCTModule.ACTION_NO_OFFLINEDATA_PO, + ACTION_ERROR_PO: RCTModule.ACTION_ERROR_PO, + + //Keys + BATTERY_PO: RCTModule.BATTERY_PO, + PULSE_WAVE_PO: RCTModule.PULSE_WAVE_PO, + PI_PO: RCTModule.PI_PO, + PULSE_STRENGTH_PO: RCTModule.PULSE_STRENGTH_PO, + BLOOD_OXYGEN_PO: RCTModule.BLOOD_OXYGEN_PO, + PULSE_RATE_PO: RCTModule.PULSE_RATE_PO, + DATAID: RCTModule.DATAID, + OFFLINEDATA_PO: RCTModule.OFFLINEDATA_PO, + MEASURE_DATE_PO: RCTModule.MEASURE_DATE_PO, + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} 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 @@ +'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() + } +} + diff --git a/libs/ihealth-sdk/module/PT3SBTProfileModule.js b/libs/ihealth-sdk/module/PT3SBTProfileModule.js new file mode 100644 index 0000000..ee1cdfe --- /dev/null +++ b/libs/ihealth-sdk/module/PT3SBTProfileModule.js @@ -0,0 +1,31 @@ +'use strict'; + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.PT3SBTProfileModule + +/** + * @module PT3SBTProfileModule + */ +module.exports = { + // actions + ACTION_SET_TIME: RCTModule.ACTION_SET_TIME, + ACTION_GET_BATTERY: RCTModule.ACTION_GET_BATTERY, + ACTION_SET_UNIT: RCTModule.ACTION_SET_UNIT, + ACTION_GET_UNIT: RCTModule.ACTION_GET_UNIT, + ACTION_GET_HISTORY_COUNT: RCTModule.ACTION_GET_HISTORY_COUNT, + ACTION_GET_HISTORY_DATA: RCTModule.ACTION_GET_HISTORY_DATA, + ACTION_DELETE_HISTORY_DATA: RCTModule.ACTION_DELETE_HISTORY_DATA, + ACTION_TEMPERATURE_MEASUREMENT: RCTModule.ACTION_TEMPERATURE_MEASUREMENT, + ACTION_PUB_UNIT: RCTModule.ACTION_PUB_UNIT, + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES, + + // keys + STATUS: RCTModule.STATUS, + BATTERY: RCTModule.BATTERY, + UNIT: RCTModule.UNIT, + TS: RCTModule.TS, + COUNT: RCTModule.COUNT, + TEMPERATURE: RCTModule.TEMPERATURE, + HISTORY: RCTModule.HISTORY +} diff --git a/libs/ihealth-sdk/module/TS28BModule.js b/libs/ihealth-sdk/module/TS28BModule.js new file mode 100644 index 0000000..bda03db --- /dev/null +++ b/libs/ihealth-sdk/module/TS28BModule.js @@ -0,0 +1,39 @@ +'use strict'; + +var {NativeModules} = require('react-native'); + +var RCTModule = NativeModules.TS28BModule + + /** + * @module TS28BModule + */ +module.exports = { + + Event_Notify: RCTModule.Event_Notify, + + /** + * listen measurement + * @param {string} mac Device's mac address + */ + measure: function (mac) { + RCTModule.measure(mac) + }, + + /** + * Disconnect the nt13b + * @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() + } +} + diff --git a/libs/ihealth-sdk/module/TS28BProfileModule.js b/libs/ihealth-sdk/module/TS28BProfileModule.js new file mode 100644 index 0000000..ff16184 --- /dev/null +++ b/libs/ihealth-sdk/module/TS28BProfileModule.js @@ -0,0 +1,20 @@ +'use strict'; + +var { NativeModules } = require('react-native'); + +var RCTModule = NativeModules.TS28BProfileModule + +/** + * @module TS28BProfileModule + */ +module.exports = { + ACTION_MEASUREMENT_RESULT: RCTModule.ACTION_MEASUREMENT_RESULT, + UNIT_FLAG: RCTModule.UNIT_FLAG, + RESULT: RCTModule.RESULT, + TS_FLAG: RCTModule.TS_FLAG, + TS: RCTModule.TS, + THERMOMETER_TYPE_FLAG: RCTModule.THERMOMETER_TYPE_FLAG, + THERMOMETER_TYPE: RCTModule.THERMOMETER_TYPE, + + ACTION_GET_ALL_CONNECTED_DEVICES: RCTModule.ACTION_GET_ALL_CONNECTED_DEVICES +} diff --git a/libs/ihealth-sdk/module/iHealthDeviceManagerModule.js b/libs/ihealth-sdk/module/iHealthDeviceManagerModule.js new file mode 100644 index 0000000..cee7b03 --- /dev/null +++ b/libs/ihealth-sdk/module/iHealthDeviceManagerModule.js @@ -0,0 +1,277 @@ +'use strict'; + + +var {NativeModules,Platform} = require('react-native'); + +var RCTModule = NativeModules.iHealthDeviceManagerModule + +/** + * @module iHealthDeviceManagerModule + */ +module.exports = { + //Device Type + AM3S: RCTModule.AM3S, + /** + * Device type number for AM4(4) 1 << 2 + */ + AM4: RCTModule.AM4, + /** + * Device type number for PO3(8) 1 << 3 + */ + PO3: RCTModule.PO3, + /** + * Device type number for BP5(33554432) 1 << 25 + */ + BP5: RCTModule.BP5, + BP5S: RCTModule.BP5S, + /** + * Device type number for BP3L(32) 1 << 5 + */ + BP3L: RCTModule.BP3L, + /** + * Device type number for BP7S(16777216) 1 << 24 + */ + BP7: RCTModule.BP7, + BP7S: RCTModule.BP7S, + /** + * Device type number for Bp550BT(128) 1 << 7 + */ + KN550: RCTModule.KN550, + /** + * Device type number for HS2(131072) 1 << 17 + */ + HS2: RCTModule.HS2, + /** + * Device type number for HS4S(268435456) 1 << 28 + */ + HS4S: RCTModule.HS4S, + HS6: 10086, + /** + * Device type number for BG1(110) + */ + BG1: RCTModule.BG1, + /** + * Device type number for BG5(4294967296) 1 << 32 + */ + BG5: RCTModule.BG5, + + BG5S: RCTModule.BG5S, + + ECG3: RCTModule.ECG3, + + ECG3USB: RCTModule.ECG3USB, + + BTM: RCTModule.BTM, + + TS28B: RCTModule.TS28B, + + NT13B: RCTModule.NT13B, + + HS2S: RCTModule.HS2S, + + BG1S: RCTModule.BG1S, + + /** + * Notify event type for scan device result.("event_scan_device") + */ + Event_Scan_Device: RCTModule.Event_Scan_Device, + /** + * Notify event type for scan action finish.("event_scan_finish") + */ + Event_Scan_Finish: RCTModule.Event_Scan_Finish, + /** + * Notify event type for connect device successfully.("event_device_connected") + */ + Event_Device_Connected: RCTModule.Event_Device_Connected, + /** + * Notify event type for connect device failed.("event_device_connect_failed") + */ + Event_Device_Connect_Failed: RCTModule.Event_Device_Connect_Failed, + /** + * Notify event type for device disconnect.("event_device_disconnect") + */ + Event_Device_Disconnect: RCTModule.Event_Device_Disconnect, + /** + * Notify event type for authenticate result.("event_authenticate_result") + */ + Event_Authenticate_Result: RCTModule.Event_Authenticate_Result, + + + /** + * Authentication the configure information. + * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Authenticate_Result) before call the api. + * @param {string} userName User's user name you use when you sign up + * @param {string} clientID User's client id. + * @param {string} clientSecret User's client secret. + * @return {callback} Callback with a json object. Eg.{"authen":2} + *

  • The measurement via SDK will be operated in the case of 1-3, and there is 10-day tryout if SDK Verification failed in case of SDK cannot connect Internet or Userid/clientID/clientSecret verification failed or SDK has not been authorized or User has not been authorized. + * SDK is fully functional during tryout period, but will be terminated without verification through Internet after 10 days.The interface needs to be re-called after analyzing the return parameters. SDK application requires Internet connection. + * If you encounter user status 4 with full internet access, please send Userid/clientID/clientSecret to this email sdk@ihealthlabs.com.cn to get help. + *

    + * The result value and description will be as below: + * + * + * + * + * + * + * + * + * + * + * + * + *
    ValueDescription
    1New-user registration succeeded.
    2User login succeeded.
    3The user is iHealth user as well, measurement via SDK has been activated, and the data from the measurement belongs to the user.
    4Testing without Internet connection succeeded.
    5Userid/clientID/clientSecret verification failed.
    6SDK has not been authorized.
    7User has not been authorized.
    8Internet error, verification failed.
    + */ + authenConfigureInfo: function (userName, clientID, clientSecret) { + RCTModule.authenConfigureInfo(userName, clientID, clientSecret) + }, + /** + * Authencation the appSecret + * @param {string} appSecret + * @return {callback} Callback with a boolen object. true:authencation success false:authencation failed .
    + */ + + authenAppSecret: function (appSecret, callback) { + RCTModule.authenAppSecret(appSecret, callback) + }, + + /** + * Start discovery iHealth device with type + * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Scan_Device) before call the api. + * + * @param {number} type The type to be discovered.
    + * e.g. startDiscovery(iHealthDeviceManagerModule.AM4) will discover AM4 devices.
    + */ + startDiscovery: function (type) { + RCTModule.startDiscovery(type) + }, + + + /** + * Stop discovery iHealth device + * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Scan_Finish) before call the api. + */ + stopDiscovery: function () { + RCTModule.stopDiscovery() + }, + + /** + * Connect iHealth device + * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Device_Connected or iHealthDeviceManagerModel.Event_Device_Connect_Failed) before call the api. + * @param {string} mac The mac address of device to be connected.
    + * e.g. "004D3208D5D4" + * @param {string} type Device type string. + * @return {callback} Callback with events {@link module:iHealthDeviceManagerModule.Event_Device_Connected Event_Device_Connected} + * or {@link module:iHealthDeviceManagerModule.Event_Device_Connect_Failed Event_Device_Connect_Failed}. + * And the mesage is format as {"errorid":0,"type":"BP5","mac":"8CDE52B62521"} + *

    The key and value in the message will be as below: + * + * + * + * + * + * + * + *
    Keyvalue
    erroridThis value is to reflect the state of the system when the connection fails. Normally, it's 0. + Please note, this field is different from the ErrorId of the DeviceProfileModule.
    typeThe device type. Eg.BP5
    macThe mac address.
    + */ + connectDevice: function (mac, type) { + RCTModule.connectDevice(mac, type) + }, + + /** + * Connect BTM device + * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Device_Connected or iHealthDeviceManagerModel.Event_Device_Connect_Failed) before call the api. + * @param {string} mac The mac address of device to be connected.
    + * e.g. "004D3208D5D4" + * @param {string} type Device type string. + * @return {callback} Callback with events {@link module:iHealthDeviceManagerModule.Event_Device_Connected Event_Device_Connected} + * or {@link module:iHealthDeviceManagerModule.Event_Device_Connect_Failed Event_Device_Connect_Failed}. + * And the mesage is format as {"errorid":0,"type":"BP5","mac":"8CDE52B62521"} + *

    The key and value in the message will be as below: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    Keyvalue
    erroridThis value is to reflect the state of the system when the connection fails. Normally, it's 0. + Please note, this field is different from the ErrorId of the DeviceProfileModule.
    usernamethe identification of the user, could be the form of email address or mobile phone
    maca valid FDIR-V3 mac.
    typeTYPE_FDIR_V3
    unitTemperature unit.1: c 2: f
    measureTargetMeasuring target.1: body 2: object
    functionTargetOffline target.1: offline 2: online
    hourStandby time hours. eg. 24
    minuteStandby time minutes. eg.60
    secondStandby time seconds. eg.60
    + */ + connectTherm: function (username, mac, type, unit, measureTarget, functionTarget, hour, minute, second) { + RCTModule.connectTherm(username, mac, type, unit, measureTarget, functionTarget, hour, minute, second) + }, + + + /** + * Get information for iHealth device + * + * @param {string} mac The mac address of device.
    + * e.g. "004D3208D5D4" + * @return {callback} Callback with a map object.
    + * e.g. {"protocolstring":"com.jiuan.AMV12","accessoryname":"AM4","firmwareversion":"138","hardwareversion":"100","manufacture":"iHealth","serialnumber":"004D32079148","modenumber":"AM4 11070"} + */ + getDevicesIDPS: function (mac, callback) { + RCTModule.getDevicesIDPS(mac, callback) + }, + + /** + * [Only for android] Disconnect an iHealth device that has been connected or in connecting status. + * Attentation: Please register to receive event(iHealthDeviceManagerModel.Event_Device_Disconnect or iHealthDeviceManagerModel.Event_Device_Connect_Failed) before call the api. + * @param {string} mac The mac address of device to be connected or in connecting.
    + * e.g. "004D3208D5D4" + * @param {string} type Device type string. + * @return {callback} Callback with events {@link module:iHealthDeviceManagerModule.Event_Device_Disconnect Event_Device_Disconnect} + * or {@link module:iHealthDeviceManagerModule.Event_Device_Connect_Failed Event_Device_Connect_Failed}. + * And the mesage is format as {"errorid":0,"type":"BP5","mac":"8CDE52B62521"} + *

    The key and value in the message will be as below: + * + * + * + * + * + * + * + *
    Keyvalue
    erroridThis value is to reflect the state of the system when the connection fails. Normally, it's 0. + Please note, this field is different from the ErrorId of the DeviceProfileModule.
    typeThe device type. Eg.BP5
    macThe mac address.
    + */ + disconnectDevice: function (mac, type) { + RCTModule.disconnectDevice(mac, type) + }, + + /** + * If you want to use the iHealth Device, you must first call authentication method before connect a device. + * To get a license, please refer to [iHealth Developer](https://dev.ihealthlabs.com). + * @param license The license file name is like 'com_example_android.pem'. Download the license file from the website, integrate to your native project. + * For android: should save the license file to the /assets/ folder. + * @return {callback} Callback with a map object.
    + * e.g. {"access": true} + */ + sdkAuthWithLicense: function (license) { + RCTModule.sdkAuthWithLicense(license) + }, + + /** + * get the phone is support OTG or not + * @return true or false + */ + + isSupportOTG: function (callback){ + if (Platform.OS === 'ios'){ + callback(true); + } else { + RCTModule.isSupportOTG(callback); + } + + }, + +} -- cgit