NucuCar/NucuCar.Sensors/EnvironmentSensor/Service.cs
2019-11-10 14:38:40 +02:00

27 lines
No EOL
738 B
C#

using System.Threading.Tasks;
using Grpc.Core;
using Microsoft.Extensions.Logging;
using NucuCarGrpcSensors;
namespace NucuCar.Sensors.EnvironmentSensor
{
public class Service : EnvironmentSensorGrpcService.EnvironmentSensorGrpcServiceBase
{
private readonly ILogger<Service> _logger;
private readonly Sensor _sensor;
public Service(ILogger<Service> logger)
{
_sensor = Sensor.Instance;
_logger = logger;
}
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
{
return Task.FromResult(new HelloReply
{
Message = "Hello " + request.Name
});
}
}
}