summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/doc/po1.md
diff options
context:
space:
mode:
authorhc <haocheng.xie@respiree.com>2026-04-13 15:17:52 +0800
committerhc <haocheng.xie@respiree.com>2026-04-13 15:17:52 +0800
commitd6d9a09d505d11148599a95a5be3e1351edbe0ac (patch)
treea5f5891983d1ff207e99f683a5e151519cef4980 /libs/ihealth-sdk/doc/po1.md
parente4fb9966e762852bf17f21c8406501d42fae0b61 (diff)
Local iHealth SDK, device detail screen, iOS event fixes
Diffstat (limited to 'libs/ihealth-sdk/doc/po1.md')
-rw-r--r--libs/ihealth-sdk/doc/po1.md54
1 files changed, 54 insertions, 0 deletions
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 @@
1# PO1 Workflow
2
3## Import PO1 Module
4
5```js
6import {
7 PO1Module,
8 PO1ProfileModule
9} from '@ihealth/ihealthlibrary-react-native';
10```
11
12## APIs
13
14### Add and remove listener
15
16```js
17// add
18notifyListener = DeviceEventEmitter.addListener(PO1Module.Event_Notify, (event) => {
19 console.log(event);
20});
21
22// remove
23notifyListener.remove();
24```
25
26### get battery
27
28```js
29PO1Module.getBattery(mac);
30
31// response
32// {battery: 32, type: "PO1", mac: "004D320C41BE", action: "action_get_battery"}
33notifyListener = DeviceEventEmitter.addListener(PO1Module.Event_Notify, (event) => {
34 if (event.action === PO1ProfileModule.ACTION_GET_BATTERY) {
35 console.log(event[PO1ProfileModule.BATTERY]);
36 }
37});
38```
39
40### online measurement
41
42```js
43// response
44// {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]}
45notifyListener = DeviceEventEmitter.addListener(PO1Module.Event_Notify, (event) => {
46 if (event.action === PO1ProfileModule.ACTION_BO_MEASUREMENT) {
47 console.log(event[PO1ProfileModule.PO1_BLOOD_OXYGEN]);
48 console.log(event[PO1ProfileModule.PO1_PULSE]);
49 console.log(event[PO1ProfileModule.PO1_PULSE_FORCE]);
50 console.log(event[PO1ProfileModule.PO1_PI]);
51 console.log(event[PO1ProfileModule.PO1_WAVE]);
52 }
53});
54``` \ No newline at end of file