# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from . import Common_pb2 as Common__pb2
from . import LogReplayNode_pb2 as LogReplayNode__pb2


class LogReplayNodeStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.StartLog = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/StartLog',
                request_serializer=Common__pb2.file_path.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.GetLogInfo = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/GetLogInfo',
                request_serializer=Common__pb2.empty.SerializeToString,
                response_deserializer=LogReplayNode__pb2.log_info.FromString,
                )
        self.StopLog = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/StopLog',
                request_serializer=Common__pb2.file_path.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.DecodeLin = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/DecodeLin',
                request_serializer=LogReplayNode__pb2.lin_message.SerializeToString,
                response_deserializer=LogReplayNode__pb2.lin_message_decode.FromString,
                )
        self.DecodeCan = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/DecodeCan',
                request_serializer=LogReplayNode__pb2.can_message.SerializeToString,
                response_deserializer=LogReplayNode__pb2.can_message_decode.FromString,
                )
        self.AddLinDecodeRole = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/AddLinDecodeRole',
                request_serializer=LogReplayNode__pb2.lin_decode_role.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.AddCanDecodeRole = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/AddCanDecodeRole',
                request_serializer=LogReplayNode__pb2.can_decode_role.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.Reset = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/Reset',
                request_serializer=Common__pb2.empty.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )


class LogReplayNodeServicer(object):
    """Missing associated documentation comment in .proto file."""

    def StartLog(self, request, context):
        """
        开始一个数据记录
        绝对路径
        result: 执行结果
        - 0: 成功
        - 1: 失败，文件格式不支持
        - 2: 失败，文件已经存在
        - 3: 失败, 创建文件失败
        - 1000: raise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLogInfo(self, request, context):
        """
        结束一个数据记录
        result: 执行结果
        - 0: 成功
        - 1000: raise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StopLog(self, request, context):
        """
        停止一个数据记录任务
        result: 执行结果
        - 0: 结束成功
        - 1000: reise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DecodeLin(self, request, context):
        """
        解包一个 LIN 数据
        result: 执行结果
        -0: 解包成功
        -1000: raise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DecodeCan(self, request, context):
        """
        解包一个 CAN 数据
        result: 执行结果
        - 0: 解包成功
        - 1000: raise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddLinDecodeRole(self, request, context):
        """
        添加 LIN 的解析规则
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddCanDecodeRole(self, request, context):
        """
        添加 CAN 的解析规则
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Reset(self, request, context):
        """
        复位
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_LogReplayNodeServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'StartLog': grpc.unary_unary_rpc_method_handler(
                    servicer.StartLog,
                    request_deserializer=Common__pb2.file_path.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'GetLogInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLogInfo,
                    request_deserializer=Common__pb2.empty.FromString,
                    response_serializer=LogReplayNode__pb2.log_info.SerializeToString,
            ),
            'StopLog': grpc.unary_unary_rpc_method_handler(
                    servicer.StopLog,
                    request_deserializer=Common__pb2.file_path.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'DecodeLin': grpc.unary_unary_rpc_method_handler(
                    servicer.DecodeLin,
                    request_deserializer=LogReplayNode__pb2.lin_message.FromString,
                    response_serializer=LogReplayNode__pb2.lin_message_decode.SerializeToString,
            ),
            'DecodeCan': grpc.unary_unary_rpc_method_handler(
                    servicer.DecodeCan,
                    request_deserializer=LogReplayNode__pb2.can_message.FromString,
                    response_serializer=LogReplayNode__pb2.can_message_decode.SerializeToString,
            ),
            'AddLinDecodeRole': grpc.unary_unary_rpc_method_handler(
                    servicer.AddLinDecodeRole,
                    request_deserializer=LogReplayNode__pb2.lin_decode_role.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'AddCanDecodeRole': grpc.unary_unary_rpc_method_handler(
                    servicer.AddCanDecodeRole,
                    request_deserializer=LogReplayNode__pb2.can_decode_role.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'Reset': grpc.unary_unary_rpc_method_handler(
                    servicer.Reset,
                    request_deserializer=Common__pb2.empty.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'LogReplayNode.LogReplayNode', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class LogReplayNode(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def StartLog(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/LogReplayNode.LogReplayNode/StartLog',
            Common__pb2.file_path.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetLogInfo(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/LogReplayNode.LogReplayNode/GetLogInfo',
            Common__pb2.empty.SerializeToString,
            LogReplayNode__pb2.log_info.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StopLog(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/LogReplayNode.LogReplayNode/StopLog',
            Common__pb2.file_path.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DecodeLin(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/LogReplayNode.LogReplayNode/DecodeLin',
            LogReplayNode__pb2.lin_message.SerializeToString,
            LogReplayNode__pb2.lin_message_decode.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DecodeCan(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/LogReplayNode.LogReplayNode/DecodeCan',
            LogReplayNode__pb2.can_message.SerializeToString,
            LogReplayNode__pb2.can_message_decode.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddLinDecodeRole(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/LogReplayNode.LogReplayNode/AddLinDecodeRole',
            LogReplayNode__pb2.lin_decode_role.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AddCanDecodeRole(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/LogReplayNode.LogReplayNode/AddCanDecodeRole',
            LogReplayNode__pb2.can_decode_role.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Reset(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/LogReplayNode.LogReplayNode/Reset',
            Common__pb2.empty.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
