Files
picar/MotorControl/motorService_pb2_grpc.py
2019-08-11 20:31:16 +09:30

81 lines
3.0 KiB
Python

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import motorService_pb2 as motorService__pb2
class CarControlStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.SetThrottle = channel.unary_unary(
'/MotorControl.CarControl/SetThrottle',
request_serializer=motorService__pb2.ThrottleRequest.SerializeToString,
response_deserializer=motorService__pb2.ThrottleResponse.FromString,
)
self.SetSteering = channel.unary_unary(
'/MotorControl.CarControl/SetSteering',
request_serializer=motorService__pb2.SteeringRequest.SerializeToString,
response_deserializer=motorService__pb2.SteeringResponse.FromString,
)
self.Heartbeat = channel.stream_unary(
'/MotorControl.CarControl/Heartbeat',
request_serializer=motorService__pb2.HeartbeatCheck.SerializeToString,
response_deserializer=motorService__pb2.HeartbeatCheckResponse.FromString,
)
class CarControlServicer(object):
# missing associated documentation comment in .proto file
pass
def SetThrottle(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetSteering(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Heartbeat(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
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,
),
'SetSteering': grpc.unary_unary_rpc_method_handler(
servicer.SetSteering,
request_deserializer=motorService__pb2.SteeringRequest.FromString,
response_serializer=motorService__pb2.SteeringResponse.SerializeToString,
),
'Heartbeat': grpc.stream_unary_rpc_method_handler(
servicer.Heartbeat,
request_deserializer=motorService__pb2.HeartbeatCheck.FromString,
response_serializer=motorService__pb2.HeartbeatCheckResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'MotorControl.CarControl', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))