2021-10-03 20:37:53 +00:00
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using NucuCar.Telemetry.Publishers;
|
2019-11-14 14:45:32 +00:00
|
|
|
|
2020-08-01 15:07:13 +00:00
|
|
|
namespace NucuCar.Telemetry.Abstractions
|
2019-11-14 14:45:32 +00:00
|
|
|
{
|
2019-11-24 13:12:12 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Interface that specifies that the component implementing it is willing to provide telemetry data and can be
|
2021-10-03 20:37:53 +00:00
|
|
|
/// registered to a publisher such as <see cref="BasePublisher"/>.
|
2019-11-24 13:12:12 +00:00
|
|
|
/// </summary>
|
2019-11-17 16:27:58 +00:00
|
|
|
public interface ITelemeter
|
2019-11-14 14:45:32 +00:00
|
|
|
{
|
2019-11-24 13:12:12 +00:00
|
|
|
/// <summary>
|
|
|
|
/// This function should return an identifier that identifies the component providing the telemetry data.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>An identifier for the telemetry source.</returns>
|
2019-11-15 15:53:20 +00:00
|
|
|
string GetIdentifier();
|
2019-11-24 13:12:12 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// This function should return a dictionary containing the telemetry data.
|
2020-01-26 10:52:09 +00:00
|
|
|
/// When implementing this function you should return null if the telemetry is disabled.
|
|
|
|
/// See: <see cref="IsTelemetryEnabled"/>
|
2019-11-24 13:12:12 +00:00
|
|
|
/// </summary>
|
2021-10-03 20:37:53 +00:00
|
|
|
/// <returns>The telemetry data as a Newtonsoft JObject.</returns>
|
|
|
|
JObject GetTelemetryJson();
|
2020-01-26 10:52:09 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// This function should return whether the sensor has telemetry enabled or not.
|
|
|
|
/// A value of true indicates that the sensor has enabled telemetry, and a value of false indicates
|
|
|
|
/// that telemetry is not enabled.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>A boolean indicating if the sensor has enabled telemetry.</returns>
|
|
|
|
bool IsTelemetryEnabled();
|
2019-11-14 14:45:32 +00:00
|
|
|
}
|
|
|
|
}
|