Add a script to generate required protobuf files

This commit is contained in:
Piv
2020-03-05 22:08:30 +10:30
parent 82a214c209
commit 18ec653962
7 changed files with 101 additions and 97 deletions

View File

@@ -1,7 +1,7 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import control.motorService_pb2 as motorService__pb2
from control import motorService_pb2 as control_dot_motorService__pb2
class CarControlStub(object):
@@ -16,13 +16,13 @@ class CarControlStub(object):
"""
self.SetThrottle = channel.unary_unary(
'/MotorControl.CarControl/SetThrottle',
request_serializer=motorService__pb2.ThrottleRequest.SerializeToString,
response_deserializer=motorService__pb2.ThrottleResponse.FromString,
request_serializer=control_dot_motorService__pb2.ThrottleRequest.SerializeToString,
response_deserializer=control_dot_motorService__pb2.ThrottleResponse.FromString,
)
self.SetSteering = channel.unary_unary(
'/MotorControl.CarControl/SetSteering',
request_serializer=motorService__pb2.SteeringRequest.SerializeToString,
response_deserializer=motorService__pb2.SteeringResponse.FromString,
request_serializer=control_dot_motorService__pb2.SteeringRequest.SerializeToString,
response_deserializer=control_dot_motorService__pb2.SteeringResponse.FromString,
)
@@ -49,13 +49,13 @@ def add_CarControlServicer_to_server(servicer, server):
rpc_method_handlers = {
'SetThrottle': grpc.unary_unary_rpc_method_handler(
servicer.SetThrottle,
request_deserializer=motorService__pb2.ThrottleRequest.FromString,
response_serializer=motorService__pb2.ThrottleResponse.SerializeToString,
request_deserializer=control_dot_motorService__pb2.ThrottleRequest.FromString,
response_serializer=control_dot_motorService__pb2.ThrottleResponse.SerializeToString,
),
'SetSteering': grpc.unary_unary_rpc_method_handler(
servicer.SetSteering,
request_deserializer=motorService__pb2.SteeringRequest.FromString,
response_serializer=motorService__pb2.SteeringResponse.SerializeToString,
request_deserializer=control_dot_motorService__pb2.SteeringRequest.FromString,
response_serializer=control_dot_motorService__pb2.SteeringResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(