/*
 * Generated by erpcgen 1.14.0 on Tue Apr 28 12:16:31 2026.
 *
 * AUTOGENERATED - DO NOT EDIT
 */


#include <new>
#include "c_servo_service_server.h"
#include "servo_service_server.hpp"
#include "erpc_manually_constructed.hpp"

using namespace erpc;
using namespace std;
using namespace erpcShim;


class servo_service_server: public servo_service_interface
{
    public:
        virtual ~servo_service_server() {};


        bool setConstraints(const char * id, float max_velocity_rad, float max_acceleration_rad, float max_jerk_rad)
        {
            bool result;
            result = ::setConstraints(id, max_velocity_rad, max_acceleration_rad, max_jerk_rad);

            return result;
        }

        bool setPositionGain(const char * id, float position_gain)
        {
            bool result;
            result = ::setPositionGain(id, position_gain);

            return result;
        }

        bool setMode(RpcMotionMode mode)
        {
            bool result;
            result = ::setMode(mode);

            return result;
        }

        bool setUpdatePeriodMs(uint32_t ms)
        {
            bool result;
            result = ::setUpdatePeriodMs(ms);

            return result;
        }

        int32_t move(const list_ServoCmd_1_t * cmds)
        {
            int32_t result;
            result = ::move(cmds);

            return result;
        }

        int32_t moveJ(const list_float_1_t * angles_rad)
        {
            int32_t result;
            result = ::moveJ(angles_rad);

            return result;
        }
};

ERPC_MANUALLY_CONSTRUCTED_STATIC(servo_service_service, s_servo_service_service);
ERPC_MANUALLY_CONSTRUCTED_STATIC(servo_service_server, s_servo_service_server);

erpc_service_t create_servo_service_service(void)
{
    erpc_service_t service;

#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
    service = new (nothrow) servo_service_service(new (nothrow)servo_service_server());
#else
    if (s_servo_service_service.isUsed())
    {
        service = NULL;
    }
    else
    {
        s_servo_service_server.construct();
        s_servo_service_service.construct(s_servo_service_server.get());
        service = s_servo_service_service.get();
    }
#endif

    return service;
}

void destroy_servo_service_service(erpc_service_t service)
{
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
    if (service)
    {
        delete (servo_service_server *)(((servo_service_service *)service)->getHandler());
        delete (servo_service_service *)service;
    }
#else
    (void)service;
    erpc_assert(service == s_servo_service_service.get());
    s_servo_service_service.destroy();
    s_servo_service_server.destroy();
#endif
}

