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/ecg.md | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 libs/ihealth-sdk/doc/ecg.md (limited to 'libs/ihealth-sdk/doc/ecg.md') 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 @@ +# ECG3 Workflow + +## import ECG3 module + +```js +import { + ECGModule, + ECGProfileModule +} from '@ihealth/ihealthlibrary-react-native'; +``` + +## APIs + +### add and remove listener + +```js +// add +notifyListener = DeviceEventEmitter.addListener(ECGModule.Event_Notify, (event) => { + console.log(event); +}); + +// remove +notifyListener.remove(); +``` + +### get all connected devices + +```js +ECGModule.getAllConnectedDevices(); +``` + +### start a measurement + +```js +ECGModule.startMeasure(mac); + +// response +notifyListener = DeviceEventEmitter.addListener(ECGModule.Event_Notify, (event) => { + if (event.action === ECGModule.ACTION_ELECTRODE_STATUS) { + console.log(event[ECGProfileModule.ELECTRODE_STATUS]); + console.log(event[ECGProfileModule.ERROR_DESCRIPTION_ECG]); + } +}); +``` + +### cancel a measurement + +```js +ECGModule.stopMeasure(mac); +``` + +### get battery + +```js +ECGModule.getBattery(mac); + +// response +notifyListener = DeviceEventEmitter.addListener(ECGModule.Event_Notify, (event) => { + if (event.action === ECGModule.ACTION_BATTERY_ECG) { + console.log(event[ECGProfileModule.BATTERY_ECG]) + } +}); +``` + +### set current time to device + +```js +ECGModule.sysTime(mac); +``` -- cgit