2019-12-17 19:40:20 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
2020-08-01 15:07:13 +00:00
|
|
|
namespace NucuCar.Sensors.Abstractions
|
2019-12-17 19:40:20 +00:00
|
|
|
{
|
2021-08-02 19:00:36 +00:00
|
|
|
// TODO: Revisit abstractions and check for bad design.
|
2019-12-17 19:54:38 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The GenericSensor is an abstract class, which provides a base for abstracting hardware sensors.
|
|
|
|
/// </summary>
|
2019-12-17 19:40:20 +00:00
|
|
|
public abstract class GenericSensor
|
|
|
|
{
|
|
|
|
protected ILogger Logger;
|
2019-12-29 11:58:32 +00:00
|
|
|
protected SensorStateEnum CurrentState;
|
2019-12-17 19:40:20 +00:00
|
|
|
|
2019-12-17 19:44:15 +00:00
|
|
|
public abstract void Initialize();
|
2019-12-17 19:40:20 +00:00
|
|
|
public abstract Task TakeMeasurementAsync();
|
2021-08-02 18:09:29 +00:00
|
|
|
public abstract SensorResponse GetMeasurement();
|
2019-12-17 19:40:20 +00:00
|
|
|
public abstract SensorStateEnum GetState();
|
|
|
|
}
|
|
|
|
}
|