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/po1.md | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 libs/ihealth-sdk/doc/po1.md (limited to 'libs/ihealth-sdk/doc/po1.md') diff --git a/libs/ihealth-sdk/doc/po1.md b/libs/ihealth-sdk/doc/po1.md new file mode 100644 index 0000000..27f7e2a --- /dev/null +++ b/libs/ihealth-sdk/doc/po1.md @@ -0,0 +1,54 @@ +# PO1 Workflow + +## Import PO1 Module + +```js +import { + PO1Module, + PO1ProfileModule +} from '@ihealth/ihealthlibrary-react-native'; +``` + +## APIs + +### Add and remove listener + +```js +// add +notifyListener = DeviceEventEmitter.addListener(PO1Module.Event_Notify, (event) => { + console.log(event); +}); + +// remove +notifyListener.remove(); +``` + +### get battery + +```js +PO1Module.getBattery(mac); + +// response +// {battery: 32, type: "PO1", mac: "004D320C41BE", action: "action_get_battery"} +notifyListener = DeviceEventEmitter.addListener(PO1Module.Event_Notify, (event) => { + if (event.action === PO1ProfileModule.ACTION_GET_BATTERY) { + console.log(event[PO1ProfileModule.BATTERY]); + } +}); +``` + +### online measurement + +```js +// response +// {type: "PO1", mac: "004D320C41BE", action: "action_bo_measurement", "po1_blood_oxygen":97,"po1_pulse":61,"po1_pulse_force":7.800000190734863,"po1_pi":3,"po1_wave":[42,69,95,95,78]} +notifyListener = DeviceEventEmitter.addListener(PO1Module.Event_Notify, (event) => { + if (event.action === PO1ProfileModule.ACTION_BO_MEASUREMENT) { + console.log(event[PO1ProfileModule.PO1_BLOOD_OXYGEN]); + console.log(event[PO1ProfileModule.PO1_PULSE]); + console.log(event[PO1ProfileModule.PO1_PULSE_FORCE]); + console.log(event[PO1ProfileModule.PO1_PI]); + console.log(event[PO1ProfileModule.PO1_WAVE]); + } +}); +``` \ No newline at end of file -- cgit