summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/doc/ecg.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/ecg.md
parente4fb9966e762852bf17f21c8406501d42fae0b61 (diff)
Local iHealth SDK, device detail screen, iOS event fixes
Diffstat (limited to 'libs/ihealth-sdk/doc/ecg.md')
-rw-r--r--libs/ihealth-sdk/doc/ecg.md69
1 files changed, 69 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/doc/ecg.md b/libs/ihealth-sdk/doc/ecg.md
new file mode 100644
index 0000000..2dbba6a
--- /dev/null
+++ b/libs/ihealth-sdk/doc/ecg.md
@@ -0,0 +1,69 @@
1# ECG3 Workflow
2
3## import ECG3 module
4
5```js
6import {
7 ECGModule,
8 ECGProfileModule
9} from '@ihealth/ihealthlibrary-react-native';
10```
11
12## APIs
13
14### add and remove listener
15
16```js
17// add
18notifyListener = DeviceEventEmitter.addListener(ECGModule.Event_Notify, (event) => {
19 console.log(event);
20});
21
22// remove
23notifyListener.remove();
24```
25
26### get all connected devices
27
28```js
29ECGModule.getAllConnectedDevices();
30```
31
32### start a measurement
33
34```js
35ECGModule.startMeasure(mac);
36
37// response
38notifyListener = DeviceEventEmitter.addListener(ECGModule.Event_Notify, (event) => {
39 if (event.action === ECGModule.ACTION_ELECTRODE_STATUS) {
40 console.log(event[ECGProfileModule.ELECTRODE_STATUS]);
41 console.log(event[ECGProfileModule.ERROR_DESCRIPTION_ECG]);
42 }
43});
44```
45
46### cancel a measurement
47
48```js
49ECGModule.stopMeasure(mac);
50```
51
52### get battery
53
54```js
55ECGModule.getBattery(mac);
56
57// response
58notifyListener = DeviceEventEmitter.addListener(ECGModule.Event_Notify, (event) => {
59 if (event.action === ECGModule.ACTION_BATTERY_ECG) {
60 console.log(event[ECGProfileModule.BATTERY_ECG])
61 }
62});
63```
64
65### set current time to device
66
67```js
68ECGModule.sysTime(mac);
69```