2020-10-24 13:06:04 +00:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2021-04-24 18:44:54 +00:00
|
|
|
|
using Microsoft.Extensions.Options;
|
2020-10-24 13:06:04 +00:00
|
|
|
|
using NucuCar.Sensors.Abstractions;
|
|
|
|
|
|
|
|
|
|
namespace NucuCar.Sensors.Modules.Heartbeat
|
|
|
|
|
{
|
2021-04-24 18:44:54 +00:00
|
|
|
|
public class HeartbeatWorker : SensorWorker
|
2020-10-24 13:06:04 +00:00
|
|
|
|
{
|
2021-04-24 18:44:54 +00:00
|
|
|
|
public HeartbeatWorker(ILogger<HeartbeatWorker> logger, Telemetry.Telemetry telemetry,
|
|
|
|
|
ISensor<HeartbeatSensor> sensor, IOptions<HeartbeatConfig> options)
|
|
|
|
|
{
|
|
|
|
|
Logger = logger;
|
|
|
|
|
MeasurementInterval = options.Value.MeasurementInterval;
|
|
|
|
|
TelemetryPublisher = telemetry.Publisher;
|
|
|
|
|
Sensor = sensor.Object;
|
|
|
|
|
}
|
2020-10-24 13:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|