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/po3.md | 87 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 libs/ihealth-sdk/doc/po3.md (limited to 'libs/ihealth-sdk/doc/po3.md') diff --git a/libs/ihealth-sdk/doc/po3.md b/libs/ihealth-sdk/doc/po3.md new file mode 100644 index 0000000..1a11df1 --- /dev/null +++ b/libs/ihealth-sdk/doc/po3.md @@ -0,0 +1,87 @@ +# PO3 Workflow + +## Import PO3 Module + +```js +import { + PO3Module, + POProfileModule +} from '@ihealth/ihealthlibrary-react-native'; +``` + +## APIs + +### Add and remove listener + +```js +// add +notifyListener = DeviceEventEmitter.addListener(PO3Module.Event_Notify, (event) => { + console.log(event); +}); + +// remove +notifyListener.remove(); +``` + +### get battery + +```js +PO3Module.getBattery(mac); + +// response +notifyListener = DeviceEventEmitter.addListener(PO3Module.Event_Notify, (event) => { + if (event.action === POProfileModule.ACTION_BATTERY_PO) { + console.log(event[POProfileModule.BATTERY_PO]); + } +}); +``` + +### start a measurement with app + +```js +PO3Module.startMeasure(mac); + +// response +notifyListener = DeviceEventEmitter.addListener(PO3Module.Event_Notify, (event) => { + if (event.action === POProfileModule.ACTION_LIVEDA_PO) { + console.log(event[POProfileModule.PULSE_WAVE_PO]); + console.log(event[POProfileModule.PI_PO]); + console.log(event[POProfileModule.PULSE_STRENGTH_PO]); + console.log(event[POProfileModule.BLOOD_OXYGEN_PO]); + console.log(event[POProfileModule.PULSE_RATE_PO]); + } else if(){ + // final result + console.log(event[POProfileModule.PULSE_WAVE_PO]); + console.log(event[POProfileModule]); + console.log(event[POProfileModule.PI_PO]); + console.log(event[POProfileModule.PULSE_STRENGTH_PO]); + console.log(event[POProfileModule.BLOOD_OXYGEN_PO]); + console.log(event[POProfileModule.PULSE_RATE_PO]); + } +}); +``` + +### get data stored in the po3 device + +```js +PO3Module.getHistoryData(mac); + +// response +notifyListener = DeviceEventEmitter.addListener(PO3Module.Event_Notify, (event) => { + if (event.action === POProfileModule.ACTION_NO_OFFLINEDATA_PO) { + console.log("There is no more data stored in the po3 device."); + } else if (event.action === POProfileModule.ACTION_OFFLINEDATA_PO) { + const dataArray = event[POProfileModule.OFFLINEDATA_PO]; + for (let i = 0; i < dataArray.length; i++) { + let offlineData = dataArray[i]; + console.log(offlineData[POProfileModule.MEASUREMENT_DATE_BP]); + console.log(offlineData[POProfileModule.HIGH_BLOOD_PRESSURE_BP]); + console.log(offlineData[POProfileModule.LOW_BLOOD_PRESSURE_BP]); + console.log(offlineData[POProfileModule.PULSE_BP]); + console.log(offlineData[POProfileModule.MEASUREMENT_AHR_BP]); + console.log(offlineData[POProfileModule.MEASUREMENT_HSD_BP]); + console.log(offlineData[POProfileModule.DATAID]); + } + } +}); +``` \ No newline at end of file -- cgit