Sets ECG listener

Sets the ECG monitor and get the return value through ecgEveStm.

        (EgcBean event) {
             /// Do something with new state,for example:
          setState(() {
            switch (event.type) {
              case ECGType.ecgChangeInts:
                _ints = event.ints!;
              case ECGType.measureComplete:
                _date =!;
              case ECGType.cancel:

Callback Description(event):


callback valuecallback value typecallback value description
typeintGet the corresponding return value according to type, where type is the value corresponding to ECGType
intsint[]ECG information


typevaluevalue description
ecgChangeInts1measure ECG
measureComplete2ECG measurement complete
date3ECG measurement date
cancel4ECG measurement off
fail5ECG measurement failed

Measuring ECG

Start to measure the ECG, the ECG measurement time is 30 seconds, and the user needs to touch the left and right electrodes of the watch with both hands. The value is obtained by listening to the ecgEveStm data stream, and the value is saved in EgcBean.ints,type is ecgChangeInts.


Stop measuring ECG


Detect new ECG measurement methods

In the new measurement mode, the watch can save the last unsent measurement result; the old version does not.

bool newMeasurementVersion = await _blePlugin.isNewECGMeasurementVersion;

Gets the last ECG data

Gets the ECG data saved by the watch, monitor the data stream through ecgEveStm , and save the value in EgcBean.ints,type is ecgChangeInts.


Sets heart rate during ECG measurement

Using the measured data, the instantaneous heart rate is calculated through the ECG algorithm library and sent to the watch.

_blePlugin.sendECGHeartRate(int heartRate);
Last Updated: