summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/doc/bp5s.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/bp5s.md
parente4fb9966e762852bf17f21c8406501d42fae0b61 (diff)
Local iHealth SDK, device detail screen, iOS event fixes
Diffstat (limited to 'libs/ihealth-sdk/doc/bp5s.md')
-rw-r--r--libs/ihealth-sdk/doc/bp5s.md153
1 files changed, 153 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/doc/bp5s.md b/libs/ihealth-sdk/doc/bp5s.md
new file mode 100644
index 0000000..f6aa39d
--- /dev/null
+++ b/libs/ihealth-sdk/doc/bp5s.md
@@ -0,0 +1,153 @@
1# BP5S Workflow
2
3## Import BP5S Module
4
5```js
6import {
7 BP5SModule,
8 BPProfileModule
9} from '@ihealth/ihealthlibrary-react-native';
10```
11
12## APIs
13
14### add and remove listener
15
16```js
17// add
18notifyListener = DeviceEventEmitter.addListener(BP5SModule.Event_Notify, (event) => {
19 console.log(event);
20});
21
22// remove
23notifyListener.remove();
24```
25
26### start a measurement
27
28The API is asyn function. It will return message until finish measurement.
29
30```js
31BP5SModule.startMeasure(mac);
32
33notifyListener = DeviceEventEmitter.addListener(BP5SModule.Event_Notify, (event) => {
34 if (event.action === BPProfileModule.ACTION_ZOREING_BP) {
35 console.log("zero adjustment");
36
37 } else if (event.action === BPProfileModule.ACTION_ZOREOVER_BP) {
38 console.log("zero adjustment is done");
39
40 } else if (event.action === BPProfileModule.ACTION_ONLINE_PRESSURE_BP) {
41 console.log(event[BPProfileModule.BLOOD_PRESSURE_BP]);
42
43 } else if (event.action === BPProfileModule.ACTION_ONLINE_PULSEWAVE_BP) {
44 console.log(event[BPProfileModule.BLOOD_PRESSURE_BP]);
45 console.log(event[BPProfileModule.FLAG_HEARTBEAT_BP]);
46 console.log(event[BPProfileModule.PULSEWAVE_BP]);
47
48 } else if (event.action === BPProfileModule.ACTION_ONLINE_RESULT_BP) {
49 console.log(event[BPProfileModule.HIGH_BLOOD_PRESSURE_BP]);
50 console.log(event[BPProfileModule.LOW_BLOOD_PRESSURE_BP]);
51 console.log(event[BPProfileModule.PULSE_BP]);
52 console.log(event[BPProfileModule.MEASUREMENT_AHR_BP]);
53 console.log(event[BPProfileModule.DATAID]);
54
55 } else if (event.action === BPProfileModule.ACTION_ERROR_BP) {
56 console.log(event[BPProfileModule.ERROR_NUM_BP]);
57 console.log(event[BPProfileModule.ERROR_DESCRIPTION_BP]);
58 }
59});
60```
61
62### cancel current measurement
63
64```js
65BP5SModule.stopMeasure(mac);
66```
67
68### get battery
69
70```js
71BP5SModule.getBattery(mac);
72
73notifyListener = DeviceEventEmitter.addListener(BP5SModule.Event_Notify, (event) => {
74 if (event.action === BPProfileModule.ACTION_BATTERY_BP) {
75 console.log(event[BPProfileModule.BATTERY_BP]);
76 }
77});
78```
79
80### enable offline mode
81
82```js
83BP5SModule.enbleOffline(mac);
84```
85
86### disable offline mode
87
88```js
89BP5SModule.disableOffline(mac);
90```
91
92### is enable offline mode
93
94```js
95BP5SModule.isEnableOffline(mac);
96
97notifyListener = DeviceEventEmitter.addListener(BP5SModule.Event_Notify, (event) => {
98 if (e.action === BPProfileModule.ACTION_IS_ENABLE_OFFLINE) {
99 console.log(event[BPProfileModule.IS_ENABLE_OFFLINE]);
100 }
101});
102```
103
104### get quantity of data stored in the bp5 device
105
106```js
107BP5SModule.getOfflineNum(mac);
108
109notifyListener = DeviceEventEmitter.addListener(BP5SModule.Event_Notify, (event) => {
110 if (e.action === BPProfileModule.ACTION_HISTORICAL_NUM_BP) {
111 console.log(event[BPProfileModule.HISTORICAL_NUM_BP]);
112 }
113});
114```
115
116### get data stored in the bp5 device
117
118```js
119BP5SModule.getOfflineData(mac);
120
121notifyListener = DeviceEventEmitter.addListener(BP5SModule.Event_Notify, (event) => {
122 if (e.action === BPProfileModule.ACTION_HISTORICAL_DATA_BP) {
123 let dataArray = event[BPProfileModule.HISTORICAL_DATA_BP];
124 if (dataArray == undefined) {
125 result = "There is not offline data in device"
126 }else {
127 for (let i = 0; i < dataArray.length; i++) {
128 let offlineData = dataArray[i];
129
130 console.log(offlineData[BPProfileModule.MEASUREMENT_DATE_BP]);
131 console.log(offlineData[BPProfileModule.HIGH_BLOOD_PRESSURE_BP]);
132 console.log(offlineData[BPProfileModule.LOW_BLOOD_PRESSURE_BP]);
133 console.log(offlineData[BPProfileModule.PULSE_BP]);
134 console.log(offlineData[BPProfileModule.MEASUREMENT_AHR_BP]);
135 console.log(offlineData[BPProfileModule.MEASUREMENT_HSD_BP]);
136 console.log(offlineData[BPProfileModule.DATAID]);
137 }
138 }
139 }
140});
141```
142
143### disconnect device
144
145```js
146BP5SModule.disConnect(mac);
147```
148
149### get all connected devices
150
151```js
152BP5SModule.getAllConnectedDevices();
153``` \ No newline at end of file