Remove Configure() from ITelemetryPublisher
This commit is contained in:
parent
38f5edbe2b
commit
2d4d3c347d
4 changed files with 3 additions and 12 deletions
|
@ -9,7 +9,6 @@ namespace NucuCar.Domain.Telemetry
|
||||||
{
|
{
|
||||||
void Start();
|
void Start();
|
||||||
Task StartAsync();
|
Task StartAsync();
|
||||||
void Configure(Dictionary<string, object> config);
|
|
||||||
bool RegisterTelemeter(ITelemeter t);
|
bool RegisterTelemeter(ITelemeter t);
|
||||||
bool UnRegisterTelemeter(ITelemeter t);
|
bool UnRegisterTelemeter(ITelemeter t);
|
||||||
Task PublishAsync(CancellationToken cancellationToken);
|
Task PublishAsync(CancellationToken cancellationToken);
|
||||||
|
|
|
@ -22,8 +22,6 @@ namespace NucuCar.Domain.Telemetry
|
||||||
public abstract Task StartAsync();
|
public abstract Task StartAsync();
|
||||||
public abstract bool Publish(int timeout);
|
public abstract bool Publish(int timeout);
|
||||||
public abstract Task PublishAsync(CancellationToken cancellationToken);
|
public abstract Task PublishAsync(CancellationToken cancellationToken);
|
||||||
public abstract void Configure(Dictionary<string, object> config);
|
|
||||||
|
|
||||||
public bool RegisterTelemeter(ITelemeter t)
|
public bool RegisterTelemeter(ITelemeter t)
|
||||||
{
|
{
|
||||||
if (RegisteredTelemeters.Contains(t)) return false;
|
if (RegisteredTelemeters.Contains(t)) return false;
|
||||||
|
|
|
@ -29,10 +29,6 @@ namespace NucuCar.Domain.Telemetry
|
||||||
}
|
}
|
||||||
Logger.LogInformation("Started the AzureTelemetryPublisher!");
|
Logger.LogInformation("Started the AzureTelemetryPublisher!");
|
||||||
}
|
}
|
||||||
public override void Configure(Dictionary<string, object> config)
|
|
||||||
{
|
|
||||||
ConnectionString = config.GetValueOrDefault("AzureIotHubConnectionString").ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override async Task PublishAsync(CancellationToken cancellationToken)
|
public override async Task PublishAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,11 +34,9 @@ namespace NucuCar.Sensors.Telemetry
|
||||||
using var telemetryService = TelemetryPublisher.Instance;
|
using var telemetryService = TelemetryPublisher.Instance;
|
||||||
|
|
||||||
telemetryService.Logger = _logger;
|
telemetryService.Logger = _logger;
|
||||||
telemetryService.Configure(new Dictionary<string, object>()
|
telemetryService.ConnectionString = _azureIotHubConnectionString;
|
||||||
{
|
telemetryService.TelemetrySource = "NucuCar.Sensors";
|
||||||
["AzureIotHubConnectionString"] = _azureIotHubConnectionString
|
|
||||||
});
|
|
||||||
|
|
||||||
telemetryService.Start();
|
telemetryService.Start();
|
||||||
while (!stoppingToken.IsCancellationRequested)
|
while (!stoppingToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue