/// <summary> /// Initializes HeartRateMonitorService class. /// Invokes HeartRateSensorNotSupported event if heart rate sensor is not supported. /// </summary> public void Init() { try { _hrm = new HRM { Interval = 1000 }; _hrm.DataUpdated += OnDataUpdated; } catch (Exception) { HeartRateSensorNotSupported?.Invoke(this, new EventArgs()); } }
/// <summary> /// Initializes HeartRateMonitorService class. /// Invokes NotSupported event if heart rate sensor is not supported. /// </summary> public void Init() { try { _hrm = new HRM { Interval = 1000, PausePolicy = SensorPausePolicy.None }; _hrm.DataUpdated += OnDataUpdated; } catch (Exception) { NotSupported?.Invoke(this, EventArgs.Empty); } }