/// <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> /// Handles "HeartRateSensorNotSupported" of the IHeartRateMonitorService object. /// Invokes "HeartRateSensorNotSupported" to other application's modules. /// </summary> /// <param name="sender">>Object firing the event.</param> /// <param name="e">Agruments passed to the event.</param> private void ServiceOnHeartRateSensorNotSupported(object sender, EventArgs e) { HeartRateSensorNotSupported?.Invoke(sender, e); }