# 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=LogReplayNode__pb2.log_request.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.GetLogStatus = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/GetLogStatus',
                request_serializer=Common__pb2.empty.SerializeToString,
                response_deserializer=Common__pb2.generic_string.FromString,
                )
        self.StopLog = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/StopLog',
                request_serializer=LogReplayNode__pb2.log_request.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.AddLinDecodeRole = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/AddLinDecodeRole',
                request_serializer=Common__pb2.generic_string.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.AddCanDecodeRole = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/AddCanDecodeRole',
                request_serializer=Common__pb2.generic_string.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.ReplayNextN = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/ReplayNextN',
                request_serializer=LogReplayNode__pb2.decode_n.SerializeToString,
                response_deserializer=LogReplayNode__pb2.decode_result.FromString,
                )
        self.OpenReplayFile = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/OpenReplayFile',
                request_serializer=Common__pb2.file_path.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.CloseReplayFile = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/CloseReplayFile',
                request_serializer=Common__pb2.file_path.SerializeToString,
                response_deserializer=Common__pb2.result.FromString,
                )
        self.GetReplayFileInfo = channel.unary_unary(
                '/LogReplayNode.LogReplayNode/GetReplayFileInfo',
                request_serializer=Common__pb2.file_path.SerializeToString,
                response_deserializer=LogReplayNode__pb2.blf_file_info.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):
        """
        开始一个数据记录
        绝对路径
        log_request:
        - log_flag: 要启动记录的标志位
        - 0x01 << 0: CAN
        - 0x01 << 1: LIN
        result: 执行结果
        - 0: 启动记录成功
        - 1: 已经有一个记录任务在了
        - 2: 文件已经存在
        - 1000: raise
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLogStatus(self, request, context):
        """
        获取当前的 Log 状态
        """
        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 AddLinDecodeRole(self, request, context):
        """
        添加 LIN 的解析规则
        generic_string: {
        'channels': list[int],    通道
        'ldfs': list[str],    通道对应的 ldf  文件
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AddCanDecodeRole(self, request, context):
        """
        添加 CAN 的解析规则
        generic_string: {
        'can_db_file_path': str,    CAN Arxml 文件
        'channels': list[int],    CAN 通道
        'cluster_names': list[str],    CAN 通道对应的 CAN_Cluster 名字
        'channel_id_filters': list[int],    要使能解包的 id
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReplayNextN(self, request, context):
        """
        反序列化下面 n 个数据
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OpenReplayFile(self, request, context):
        """
        打开一个 blf 文件
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CloseReplayFile(self, request, context):
        """
        关闭当前的 blf 文件
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetReplayFileInfo(self, request, context):
        """
        获取 blf 文件的描述信息
        """
        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=LogReplayNode__pb2.log_request.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'GetLogStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLogStatus,
                    request_deserializer=Common__pb2.empty.FromString,
                    response_serializer=Common__pb2.generic_string.SerializeToString,
            ),
            'StopLog': grpc.unary_unary_rpc_method_handler(
                    servicer.StopLog,
                    request_deserializer=LogReplayNode__pb2.log_request.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'AddLinDecodeRole': grpc.unary_unary_rpc_method_handler(
                    servicer.AddLinDecodeRole,
                    request_deserializer=Common__pb2.generic_string.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'AddCanDecodeRole': grpc.unary_unary_rpc_method_handler(
                    servicer.AddCanDecodeRole,
                    request_deserializer=Common__pb2.generic_string.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'ReplayNextN': grpc.unary_unary_rpc_method_handler(
                    servicer.ReplayNextN,
                    request_deserializer=LogReplayNode__pb2.decode_n.FromString,
                    response_serializer=LogReplayNode__pb2.decode_result.SerializeToString,
            ),
            'OpenReplayFile': grpc.unary_unary_rpc_method_handler(
                    servicer.OpenReplayFile,
                    request_deserializer=Common__pb2.file_path.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'CloseReplayFile': grpc.unary_unary_rpc_method_handler(
                    servicer.CloseReplayFile,
                    request_deserializer=Common__pb2.file_path.FromString,
                    response_serializer=Common__pb2.result.SerializeToString,
            ),
            'GetReplayFileInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.GetReplayFileInfo,
                    request_deserializer=Common__pb2.file_path.FromString,
                    response_serializer=LogReplayNode__pb2.blf_file_info.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',
            LogReplayNode__pb2.log_request.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetLogStatus(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/GetLogStatus',
            Common__pb2.empty.SerializeToString,
            Common__pb2.generic_string.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',
            LogReplayNode__pb2.log_request.SerializeToString,
            Common__pb2.result.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',
            Common__pb2.generic_string.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',
            Common__pb2.generic_string.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ReplayNextN(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/ReplayNextN',
            LogReplayNode__pb2.decode_n.SerializeToString,
            LogReplayNode__pb2.decode_result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def OpenReplayFile(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/OpenReplayFile',
            Common__pb2.file_path.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CloseReplayFile(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/CloseReplayFile',
            Common__pb2.file_path.SerializeToString,
            Common__pb2.result.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetReplayFileInfo(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/GetReplayFileInfo',
            Common__pb2.file_path.SerializeToString,
            LogReplayNode__pb2.blf_file_info.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)
