#
# Generated by erpcgen 1.14.0 on Tue Apr 28 12:25:26 2026.
#
# AUTOGENERATED - DO NOT EDIT
#

import erpc
from . import common, interface

# Client for servo_service
class servo_serviceClient(interface.Iservo_service):
    def __init__(self, manager):
        super(servo_serviceClient, self).__init__()
        self._clientManager = manager

    def setConstraints(self, id, max_velocity_rad, max_acceleration_rad, max_jerk_rad):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.SETCONSTRAINTS_ID,
                sequence=request.sequence))
        if id is None:
            raise ValueError("id is None")
        codec.write_string(id)
        if max_velocity_rad is None:
            raise ValueError("max_velocity_rad is None")
        codec.write_float(max_velocity_rad)
        if max_acceleration_rad is None:
            raise ValueError("max_acceleration_rad is None")
        codec.write_float(max_acceleration_rad)
        if max_jerk_rad is None:
            raise ValueError("max_jerk_rad is None")
        codec.write_float(max_jerk_rad)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_bool()
        return _result

    def setPositionGain(self, id, position_gain):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.SETPOSITIONGAIN_ID,
                sequence=request.sequence))
        if id is None:
            raise ValueError("id is None")
        codec.write_string(id)
        if position_gain is None:
            raise ValueError("position_gain is None")
        codec.write_float(position_gain)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_bool()
        return _result

    def setMode(self, mode):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.SETMODE_ID,
                sequence=request.sequence))
        if mode is None:
            raise ValueError("mode is None")
        codec.write_int32(mode)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_bool()
        return _result

    def setUpdatePeriodMs(self, ms):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.SETUPDATEPERIODMS_ID,
                sequence=request.sequence))
        if ms is None:
            raise ValueError("ms is None")
        codec.write_uint32(ms)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_bool()
        return _result

    def move(self, cmds):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.MOVE_ID,
                sequence=request.sequence))
        if cmds is None:
            raise ValueError("cmds is None")
        codec.start_write_list(len(cmds))
        for _i0 in cmds:
            _i0._write(codec)


        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_int32()
        return _result

    def moveJ(self, angles_rad):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.MOVEJ_ID,
                sequence=request.sequence))
        if angles_rad is None:
            raise ValueError("angles_rad is None")
        codec.start_write_list(len(angles_rad))
        for _i0 in angles_rad:
            codec.write_float(_i0)


        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_int32()
        return _result


