Esempio n. 1
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, BasicDaqBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_GetAvailbleDevices, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.GetAvailbleDevicesRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.GetAvailbleDevicesResponse>(serviceImpl.GetAvailbleDevices));
     serviceBinder.AddMethod(__Method_Initialize, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.InitializeRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.InitializeResponse>(serviceImpl.Initialize));
     serviceBinder.AddMethod(__Method_Shutdown, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.ShutdownRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.ShutdownResponse>(serviceImpl.Shutdown));
     serviceBinder.AddMethod(__Method_ReadDigital, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.ReadDigitalRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.ReadDigitalResponse>(serviceImpl.ReadDigital));
     serviceBinder.AddMethod(__Method_ReadAnalog, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.ReadAnalogRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.ReadAnalogResponse>(serviceImpl.ReadAnalog));
     serviceBinder.AddMethod(__Method_WriteDigital, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.WriteDigitalRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.WriteDigitalResponse>(serviceImpl.WriteDigital));
     serviceBinder.AddMethod(__Method_WriteAnalog, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.WriteAnalogRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.WriteAnalogResponse>(serviceImpl.WriteAnalog));
     serviceBinder.AddMethod(__Method_GetDeviceDetails, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.GetDeviceDetailsRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.GetDeviceDetailsResponse>(serviceImpl.GetDeviceDetails));
     serviceBinder.AddMethod(__Method_GetDigitalChannels, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.GetDigitalChannelsRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.GetDigitalChannelsResponse>(serviceImpl.GetDigitalChannels));
     serviceBinder.AddMethod(__Method_GetAnalogChannels, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.GetAnalogChannelsRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.GetAnalogChannelsResponse>(serviceImpl.GetAnalogChannels));
     serviceBinder.AddMethod(__Method_SetChannelMode, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.SetChannelModeRequest, global::Instrosetta.Interfaces.DataAquisition.BasicDaq.V1.SetChannelModeResponse>(serviceImpl.SetChannelMode));
 }
Esempio n. 2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(BasicDaqBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_GetAvailbleDevices, serviceImpl.GetAvailbleDevices)
            .AddMethod(__Method_Initialize, serviceImpl.Initialize)
            .AddMethod(__Method_Shutdown, serviceImpl.Shutdown)
            .AddMethod(__Method_ReadDigital, serviceImpl.ReadDigital)
            .AddMethod(__Method_ReadAnalog, serviceImpl.ReadAnalog)
            .AddMethod(__Method_WriteDigital, serviceImpl.WriteDigital)
            .AddMethod(__Method_WriteAnalog, serviceImpl.WriteAnalog)
            .AddMethod(__Method_GetDeviceDetails, serviceImpl.GetDeviceDetails)
            .AddMethod(__Method_GetDigitalChannels, serviceImpl.GetDigitalChannels)
            .AddMethod(__Method_GetAnalogChannels, serviceImpl.GetAnalogChannels)
            .AddMethod(__Method_SetChannelMode, serviceImpl.SetChannelMode).Build());
 }