diff options
| author | hc <haocheng.xie@respiree.com> | 2026-04-13 15:17:52 +0800 |
|---|---|---|
| committer | hc <haocheng.xie@respiree.com> | 2026-04-13 15:17:52 +0800 |
| commit | d6d9a09d505d11148599a95a5be3e1351edbe0ac (patch) | |
| tree | a5f5891983d1ff207e99f683a5e151519cef4980 /libs/ihealth-sdk/doc/kn550.md | |
| parent | e4fb9966e762852bf17f21c8406501d42fae0b61 (diff) | |
Local iHealth SDK, device detail screen, iOS event fixes
Diffstat (limited to 'libs/ihealth-sdk/doc/kn550.md')
| -rw-r--r-- | libs/ihealth-sdk/doc/kn550.md | 114 |
1 files changed, 114 insertions, 0 deletions
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 @@ | |||
| 1 | # KN550 Workflow | ||
| 2 | |||
| 3 | ## import KN550 module | ||
| 4 | |||
| 5 | ```js | ||
| 6 | import { | ||
| 7 | BP550BTModule, | ||
| 8 | BPProfileModule | ||
| 9 | } from '@ihealth/ihealthlibrary-react-native'; | ||
| 10 | ``` | ||
| 11 | |||
| 12 | ## APIs | ||
| 13 | |||
| 14 | ### add and remove listener | ||
| 15 | |||
| 16 | ```js | ||
| 17 | // add | ||
| 18 | notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { | ||
| 19 | console.log(event); | ||
| 20 | }); | ||
| 21 | |||
| 22 | // remove | ||
| 23 | notifyListener.remove(); | ||
| 24 | ``` | ||
| 25 | |||
| 26 | ### get battery | ||
| 27 | |||
| 28 | ```js | ||
| 29 | BP550BTModule.getBattery(mac); | ||
| 30 | |||
| 31 | notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { | ||
| 32 | if (event.action === BPProfileModule.ACTION_BATTERY_BP) { | ||
| 33 | console.log(event[BPProfileModule.BATTERY_BP]); | ||
| 34 | } | ||
| 35 | }); | ||
| 36 | ``` | ||
| 37 | |||
| 38 | ### get KN550 function | ||
| 39 | |||
| 40 | ```js | ||
| 41 | BP550BTModule.getFunctionInfo(mac); | ||
| 42 | |||
| 43 | notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { | ||
| 44 | if (event.action === BPProfileModule.ACTION_FUNCTION_INFORMATION_BP) { | ||
| 45 | console.log(event[BPProfileModule.FUNCTION_IS_UPAIR_MEASURE]); | ||
| 46 | console.log(event[BPProfileModule.FUNCTION_IS_ARM_MEASURE]); | ||
| 47 | console.log(event[BPProfileModule.FUNCTION_HAVE_ANGLE_SENSOR]); | ||
| 48 | console.log(event[BPProfileModule.FUNCTION_HAVE_OFFLINE]); | ||
| 49 | console.log(event[BPProfileModule.FUNCTION_HAVE_HSD]); | ||
| 50 | console.log(event[BPProfileModule.FUNCTION_HAVE_ANGLE_SETTING]); | ||
| 51 | console.log(event[BPProfileModule.FUNCTION_IS_MULTI_UPLOAD]); | ||
| 52 | console.log(event[BPProfileModule.FUNCTION_HAVE_SELF_UPDATE]); | ||
| 53 | } | ||
| 54 | }); | ||
| 55 | ``` | ||
| 56 | |||
| 57 | ### get quantity of data stored in the KN550 device | ||
| 58 | |||
| 59 | ```js | ||
| 60 | BP550BTModule.getOfflineNum(mac); | ||
| 61 | |||
| 62 | notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { | ||
| 63 | if (e.action === BPProfileModule.ACTION_HISTORICAL_NUM_BP) { | ||
| 64 | console.log(event[BPProfileModule.HISTORICAL_NUM_BP]); | ||
| 65 | } | ||
| 66 | }); | ||
| 67 | ``` | ||
| 68 | |||
| 69 | ### get data stored in the KN550 device | ||
| 70 | |||
| 71 | ```js | ||
| 72 | BP550BTModule.getOfflineData(mac); | ||
| 73 | |||
| 74 | notifyListener = DeviceEventEmitter.addListener(BP550BTModule.Event_Notify, (event) => { | ||
| 75 | if (event.action === BPProfileModule.ACTION_HISTORICAL_DATA_BP) { | ||
| 76 | let dataArray = event[BPProfileModule.HISTORICAL_DATA_BP]; | ||
| 77 | if (dataArray == undefined) { | ||
| 78 | result = "There is not offline data in device" | ||
| 79 | }else { | ||
| 80 | for (let i = 0; i < dataArray.length; i++) { | ||
| 81 | let offlineData = dataArray[i]; | ||
| 82 | |||
| 83 | console.log(offlineData[BPProfileModule.MEASUREMENT_DATE_BP]); | ||
| 84 | console.log(offlineData[BPProfileModule.HIGH_BLOOD_PRESSURE_BP]); | ||
| 85 | console.log(offlineData[BPProfileModule.LOW_BLOOD_PRESSURE_BP]); | ||
| 86 | console.log(offlineData[BPProfileModule.PULSE_BP]); | ||
| 87 | console.log(offlineData[BPProfileModule.MEASUREMENT_AHR_BP]); | ||
| 88 | console.log(offlineData[BPProfileModule.MEASUREMENT_HSD_BP]); | ||
| 89 | console.log(offlineData[BPProfileModule.DATAID]); | ||
| 90 | } | ||
| 91 | } | ||
| 92 | } | ||
| 93 | }); | ||
| 94 | ``` | ||
| 95 | |||
| 96 | ### disconnect device | ||
| 97 | |||
| 98 | ```js | ||
| 99 | BP550BTModule.disconnect(mac); | ||
| 100 | ``` | ||
| 101 | |||
| 102 | ### get device information | ||
| 103 | |||
| 104 | ```js | ||
| 105 | iHealthDeviceManagerModule.getDevicesIDPS(mac, (event) => { | ||
| 106 | console.info(event); | ||
| 107 | }) | ||
| 108 | ``` | ||
| 109 | |||
| 110 | ### get all connected devices | ||
| 111 | |||
| 112 | ```js | ||
| 113 | BP550BTModule.getAllConnectedDevices(); | ||
| 114 | ``` | ||
