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


#include "c_servo_service_client.h"
#include "servo_service_client.hpp"
#include "erpc_manually_constructed.hpp"

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


#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
servo_service_client *s_servo_service_client = nullptr;
#else
ERPC_MANUALLY_CONSTRUCTED_STATIC(servo_service_client, s_servo_service_client);
#endif

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

    return result;
}

bool setPositionGain(const char * id, float position_gain)
{
    bool result;
    result = s_servo_service_client->setPositionGain(id, position_gain);

    return result;
}

bool setMode(RpcMotionMode mode)
{
    bool result;
    result = s_servo_service_client->setMode(mode);

    return result;
}

bool setUpdatePeriodMs(uint32_t ms)
{
    bool result;
    result = s_servo_service_client->setUpdatePeriodMs(ms);

    return result;
}

int32_t move(const list_ServoCmd_1_t * cmds)
{
    int32_t result;
    result = s_servo_service_client->move(cmds);

    return result;
}

int32_t moveJ(const list_float_1_t * angles_rad)
{
    int32_t result;
    result = s_servo_service_client->moveJ(angles_rad);

    return result;
}

void initservo_service_client(erpc_client_t client)
{
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
    erpc_assert(s_servo_service_client == nullptr);
    s_servo_service_client = new servo_service_client(reinterpret_cast<ClientManager *>(client));
#else
    erpc_assert(!s_servo_service_client.isUsed());
    s_servo_service_client.construct(reinterpret_cast<ClientManager *>(client));
#endif
}

void deinitservo_service_client(void)
{
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
    if (s_servo_service_client != nullptr)
    {
        delete s_servo_service_client;
        s_servo_service_client = nullptr;
    }
#else
    s_servo_service_client.destroy();
#endif
}
