#pragma once #include #ifdef __cplusplus extern "C" { #endif #define ERROR_CODE(errortype, suberrorcode) (errortype + suberrorcode) typedef enum { ksucc = 0, kfail = 1, kparam_out_of_range = 102, kcmd_not_support = 103, kdevice_is_busy = 104, kdevice_is_offline = 105, kovertime = 106, knoack = 107, kerrorack = 108, kdevice_offline = 109, ksubdevice_overtime = 111, kbuffer_not_enough = 112, kcmd_param_num_error = 114, kcheckcode_is_error = 115, killegal_operation = 116, kstep_motor_not_found_zero_point = 600, kstep_motor_not_go_zero = 601, kstep_motor_over_temperature = 602, kstep_motor_over_voltage = 603, kstep_motor_run_overtime = 604, kstep_motor_not_enable = 605, kstep_motor_ioindex_out_of_range = 606, kstep_motor_subic_reset = 607, kstep_motor_drv_err = 608, kstep_motor_uv_cp = 609, kstep_motor_not_found_point_edge = 610, } error_t; typedef struct { int index; const char* info; } ecode_table_item_t; const char* error2str(int32_t code); ecode_table_item_t* error_get_table(); int error_get_table_size(); #ifdef __cplusplus } #endif