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

import servo_pb2 as servo__pb2


class ServoServiceGrpcStub(object):
    """定义服务,用在rpc传输中
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.setServoRotateBySpeed = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/setServoRotateBySpeed',
                request_serializer=servo__pb2.ServoRotateBySpeedRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoRotateResponse.FromString,
                )
        self.setServoRotateByAngle = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/setServoRotateByAngle',
                request_serializer=servo__pb2.ServoRotateByAngleRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoRotateResponse.FromString,
                )
        self.setServoRotateByPWM = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/setServoRotateByPWM',
                request_serializer=servo__pb2.ServoRotateByPWMRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoRotateResponse.FromString,
                )
        self.stopServoRotate = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/stopServoRotate',
                request_serializer=servo__pb2.StopServoRotateRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoCommonResponse.FromString,
                )
        self.getServoAngle = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/getServoAngle',
                request_serializer=servo__pb2.ServoGetAngleRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoGetAngleResponse.FromString,
                )
        self.isServoRotating = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/isServoRotating',
                request_serializer=servo__pb2.ServoGetRotatingRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoGetRotatingResponse.FromString,
                )
        self.clearServoFault = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/clearServoFault',
                request_serializer=servo__pb2.ServoFaultClearRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoCommonResponse.FromString,
                )
        self.getServoFault = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/getServoFault',
                request_serializer=servo__pb2.ServoFaultRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoFaultResponse.FromString,
                )
        self.controlSingleClamp = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/controlSingleClamp',
                request_serializer=servo__pb2.ControlSingleClampRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoCommonResponse.FromString,
                )
        self.getClampStatus = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/getClampStatus',
                request_serializer=servo__pb2.GetClampStatusRequest.SerializeToString,
                response_deserializer=servo__pb2.GetClampStatusResponse.FromString,
                )
        self.getMotionInfo = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/getMotionInfo',
                request_serializer=servo__pb2.GetMotionInfoRequest.SerializeToString,
                response_deserializer=servo__pb2.GetMotionInfoResponse.FromString,
                )
        self.roboticArmRestory = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/roboticArmRestory',
                request_serializer=servo__pb2.RoboticArmRestoryRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoCommonResponse.FromString,
                )
        self.roboticArmMoveToTargetPostion = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/roboticArmMoveToTargetPostion',
                request_serializer=servo__pb2.RoboticArmMovePostionRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoCommonResponse.FromString,
                )
        self.roboticArmSetJointPosition = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/roboticArmSetJointPosition',
                request_serializer=servo__pb2.RoboticArmSetJointPositionRequest.SerializeToString,
                response_deserializer=servo__pb2.ServoCommonResponse.FromString,
                )
        self.roboticArmGetJoints = channel.unary_unary(
                '/ServoPackage.ServoServiceGrpc/roboticArmGetJoints',
                request_serializer=servo__pb2.RoboticArmGetJointsRequest.SerializeToString,
                response_deserializer=servo__pb2.RoboticArmGetJointsResponse.FromString,
                )


class ServoServiceGrpcServicer(object):
    """定义服务,用在rpc传输中
    """

    def setServoRotateBySpeed(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def setServoRotateByAngle(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def setServoRotateByPWM(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def stopServoRotate(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getServoAngle(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def isServoRotating(self, request, context):
        """获取转动状态，暂未实现
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def clearServoFault(self, request, context):
        """清除舵机异常
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getServoFault(self, request, context):
        """获取舵机异常信息
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def controlSingleClamp(self, request, context):
        """控制夹手
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getClampStatus(self, request, context):
        """获取夹手状态
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getMotionInfo(self, request, context):
        """获取运动信息
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def roboticArmMoveToTargetPostion(self, request, context):
        """机械臂移动到指定的位置
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def roboticArmSetJointPosition(self, request, context):
        """设置机械臂关节
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def roboticArmGetJoints(self, request, context):
        """获取机械臂关节
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ServoServiceGrpcServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'setServoRotateBySpeed': grpc.unary_unary_rpc_method_handler(
                    servicer.setServoRotateBySpeed,
                    request_deserializer=servo__pb2.ServoRotateBySpeedRequest.FromString,
                    response_serializer=servo__pb2.ServoRotateResponse.SerializeToString,
            ),
            'setServoRotateByAngle': grpc.unary_unary_rpc_method_handler(
                    servicer.setServoRotateByAngle,
                    request_deserializer=servo__pb2.ServoRotateByAngleRequest.FromString,
                    response_serializer=servo__pb2.ServoRotateResponse.SerializeToString,
            ),
            'setServoRotateByPWM': grpc.unary_unary_rpc_method_handler(
                    servicer.setServoRotateByPWM,
                    request_deserializer=servo__pb2.ServoRotateByPWMRequest.FromString,
                    response_serializer=servo__pb2.ServoRotateResponse.SerializeToString,
            ),
            'stopServoRotate': grpc.unary_unary_rpc_method_handler(
                    servicer.stopServoRotate,
                    request_deserializer=servo__pb2.StopServoRotateRequest.FromString,
                    response_serializer=servo__pb2.ServoCommonResponse.SerializeToString,
            ),
            'getServoAngle': grpc.unary_unary_rpc_method_handler(
                    servicer.getServoAngle,
                    request_deserializer=servo__pb2.ServoGetAngleRequest.FromString,
                    response_serializer=servo__pb2.ServoGetAngleResponse.SerializeToString,
            ),
            'isServoRotating': grpc.unary_unary_rpc_method_handler(
                    servicer.isServoRotating,
                    request_deserializer=servo__pb2.ServoGetRotatingRequest.FromString,
                    response_serializer=servo__pb2.ServoGetRotatingResponse.SerializeToString,
            ),
            'clearServoFault': grpc.unary_unary_rpc_method_handler(
                    servicer.clearServoFault,
                    request_deserializer=servo__pb2.ServoFaultClearRequest.FromString,
                    response_serializer=servo__pb2.ServoCommonResponse.SerializeToString,
            ),
            'getServoFault': grpc.unary_unary_rpc_method_handler(
                    servicer.getServoFault,
                    request_deserializer=servo__pb2.ServoFaultRequest.FromString,
                    response_serializer=servo__pb2.ServoFaultResponse.SerializeToString,
            ),
            'controlSingleClamp': grpc.unary_unary_rpc_method_handler(
                    servicer.controlSingleClamp,
                    request_deserializer=servo__pb2.ControlSingleClampRequest.FromString,
                    response_serializer=servo__pb2.ServoCommonResponse.SerializeToString,
            ),
            'getClampStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.getClampStatus,
                    request_deserializer=servo__pb2.GetClampStatusRequest.FromString,
                    response_serializer=servo__pb2.GetClampStatusResponse.SerializeToString,
            ),
            'getMotionInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.getMotionInfo,
                    request_deserializer=servo__pb2.GetMotionInfoRequest.FromString,
                    response_serializer=servo__pb2.GetMotionInfoResponse.SerializeToString,
            ),
            'roboticArmRestory': grpc.unary_unary_rpc_method_handler(
                    servicer.roboticArmRestory,
                    request_deserializer=servo__pb2.RoboticArmRestoryRequest.FromString,
                    response_serializer=servo__pb2.ServoCommonResponse.SerializeToString,
            ),
            'roboticArmMoveToTargetPostion': grpc.unary_unary_rpc_method_handler(
                    servicer.roboticArmMoveToTargetPostion,
                    request_deserializer=servo__pb2.RoboticArmMovePostionRequest.FromString,
                    response_serializer=servo__pb2.ServoCommonResponse.SerializeToString,
            ),
            'roboticArmSetJointPosition': grpc.unary_unary_rpc_method_handler(
                    servicer.roboticArmSetJointPosition,
                    request_deserializer=servo__pb2.RoboticArmSetJointPositionRequest.FromString,
                    response_serializer=servo__pb2.ServoCommonResponse.SerializeToString,
            ),
            'roboticArmGetJoints': grpc.unary_unary_rpc_method_handler(
                    servicer.roboticArmGetJoints,
                    request_deserializer=servo__pb2.RoboticArmGetJointsRequest.FromString,
                    response_serializer=servo__pb2.RoboticArmGetJointsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ServoPackage.ServoServiceGrpc', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ServoServiceGrpc(object):
    """定义服务,用在rpc传输中
    """

    @staticmethod
    def setServoRotateBySpeed(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, '/ServoPackage.ServoServiceGrpc/setServoRotateBySpeed',
            servo__pb2.ServoRotateBySpeedRequest.SerializeToString,
            servo__pb2.ServoRotateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def setServoRotateByAngle(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, '/ServoPackage.ServoServiceGrpc/setServoRotateByAngle',
            servo__pb2.ServoRotateByAngleRequest.SerializeToString,
            servo__pb2.ServoRotateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def setServoRotateByPWM(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, '/ServoPackage.ServoServiceGrpc/setServoRotateByPWM',
            servo__pb2.ServoRotateByPWMRequest.SerializeToString,
            servo__pb2.ServoRotateResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def stopServoRotate(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, '/ServoPackage.ServoServiceGrpc/stopServoRotate',
            servo__pb2.StopServoRotateRequest.SerializeToString,
            servo__pb2.ServoCommonResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getServoAngle(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, '/ServoPackage.ServoServiceGrpc/getServoAngle',
            servo__pb2.ServoGetAngleRequest.SerializeToString,
            servo__pb2.ServoGetAngleResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def isServoRotating(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, '/ServoPackage.ServoServiceGrpc/isServoRotating',
            servo__pb2.ServoGetRotatingRequest.SerializeToString,
            servo__pb2.ServoGetRotatingResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def clearServoFault(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, '/ServoPackage.ServoServiceGrpc/clearServoFault',
            servo__pb2.ServoFaultClearRequest.SerializeToString,
            servo__pb2.ServoCommonResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getServoFault(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, '/ServoPackage.ServoServiceGrpc/getServoFault',
            servo__pb2.ServoFaultRequest.SerializeToString,
            servo__pb2.ServoFaultResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def controlSingleClamp(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, '/ServoPackage.ServoServiceGrpc/controlSingleClamp',
            servo__pb2.ControlSingleClampRequest.SerializeToString,
            servo__pb2.ServoCommonResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getClampStatus(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, '/ServoPackage.ServoServiceGrpc/getClampStatus',
            servo__pb2.GetClampStatusRequest.SerializeToString,
            servo__pb2.GetClampStatusResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def getMotionInfo(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, '/ServoPackage.ServoServiceGrpc/getMotionInfo',
            servo__pb2.GetMotionInfoRequest.SerializeToString,
            servo__pb2.GetMotionInfoResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def roboticArmRestory(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, '/ServoPackage.ServoServiceGrpc/roboticArmRestory',
            servo__pb2.RoboticArmRestoryRequest.SerializeToString,
            servo__pb2.ServoCommonResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def roboticArmMoveToTargetPostion(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, '/ServoPackage.ServoServiceGrpc/roboticArmMoveToTargetPostion',
            servo__pb2.RoboticArmMovePostionRequest.SerializeToString,
            servo__pb2.ServoCommonResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def roboticArmSetJointPosition(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, '/ServoPackage.ServoServiceGrpc/roboticArmSetJointPosition',
            servo__pb2.RoboticArmSetJointPositionRequest.SerializeToString,
            servo__pb2.ServoCommonResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def roboticArmGetJoints(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, '/ServoPackage.ServoServiceGrpc/roboticArmGetJoints',
            servo__pb2.RoboticArmGetJointsRequest.SerializeToString,
            servo__pb2.RoboticArmGetJointsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
