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/doc/kn550.md | 114 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 libs/ihealth-sdk/doc/kn550.md (limited to 'libs/ihealth-sdk/doc/kn550.md') diff --git a/libs/ihealth-sdk/doc/kn550.md b/libs/ihealth-sdk/doc/kn550.md new file mode 100644 index 0000000..f6e8bad --- /dev/null +++ b/libs/ihealth-sdk/doc/kn550.md @@ -0,0 +1,114 @@ +# KN550 Workflow + +## import KN550 module + +```js +import { + BP550BTModule, + BPProfileModule +} from '@ihealth/ihealthlibrary-react-native'; +``` + +## APIs + +### add and remove listener + +```js +// add +notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { + console.log(event); +}); + +// remove +notifyListener.remove(); +``` + +### get battery + +```js +BP550BTModule.getBattery(mac); + +notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { + if (event.action === BPProfileModule.ACTION_BATTERY_BP) { + console.log(event[BPProfileModule.BATTERY_BP]); + } +}); +``` + +### get KN550 function + +```js +BP550BTModule.getFunctionInfo(mac); + +notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { + if (event.action === BPProfileModule.ACTION_FUNCTION_INFORMATION_BP) { + console.log(event[BPProfileModule.FUNCTION_IS_UPAIR_MEASURE]); + console.log(event[BPProfileModule.FUNCTION_IS_ARM_MEASURE]); + console.log(event[BPProfileModule.FUNCTION_HAVE_ANGLE_SENSOR]); + console.log(event[BPProfileModule.FUNCTION_HAVE_OFFLINE]); + console.log(event[BPProfileModule.FUNCTION_HAVE_HSD]); + console.log(event[BPProfileModule.FUNCTION_HAVE_ANGLE_SETTING]); + console.log(event[BPProfileModule.FUNCTION_IS_MULTI_UPLOAD]); + console.log(event[BPProfileModule.FUNCTION_HAVE_SELF_UPDATE]); + } +}); +``` + +### get quantity of data stored in the KN550 device + +```js +BP550BTModule.getOfflineNum(mac); + +notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { + if (e.action === BPProfileModule.ACTION_HISTORICAL_NUM_BP) { + console.log(event[BPProfileModule.HISTORICAL_NUM_BP]); + } +}); +``` + +### get data stored in the KN550 device + +```js +BP550BTModule.getOfflineData(mac); + +notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { + if (event.action === BPProfileModule.ACTION_HISTORICAL_DATA_BP) { + let dataArray = event[BPProfileModule.HISTORICAL_DATA_BP]; + if (dataArray == undefined) { + result = "There is not offline data in device" + }else { + for (let i = 0; i < dataArray.length; i++) { + let offlineData = dataArray[i]; + + console.log(offlineData[BPProfileModule.MEASUREMENT_DATE_BP]); + console.log(offlineData[BPProfileModule.HIGH_BLOOD_PRESSURE_BP]); + console.log(offlineData[BPProfileModule.LOW_BLOOD_PRESSURE_BP]); + console.log(offlineData[BPProfileModule.PULSE_BP]); + console.log(offlineData[BPProfileModule.MEASUREMENT_AHR_BP]); + console.log(offlineData[BPProfileModule.MEASUREMENT_HSD_BP]); + console.log(offlineData[BPProfileModule.DATAID]); + } + } + } +}); +``` + +### disconnect device + +```js +BP550BTModule.disconnect(mac); +``` + +### get device information + +```js +iHealthDeviceManagerModule.getDevicesIDPS(mac, (event) => { + console.info(event); +}) +``` + +### get all connected devices + +```js +BP550BTModule.getAllConnectedDevices(); +``` -- cgit