#ifndef CTN_H #define CTN_H #include "plt.h" struct ctn_t { int idx_in_ess; char szsn[150]; char szinfo[32]; char szprojId[128]; char szmodel[32]; int model; // int idx; /* idx of ctn model */ int adr; char sztime[32]; int cmd; unsigned short cmdpara[4]; // int time_zone; }; extern struct ctn_t ctn[CTN_NBR_MAX + 1]; int ctn_init(void); int ctn_send_cmd(int cmd); int ctn_set_aps(int val); char *ctn_get_sn(); char *ctn_get_info(); int ctn_get_idx_in_ess(); int ctn_get_ap(); int ctn_get_aps(); int ctn_get_last_aps(); int ctn_get_norm_cap(); int ctn_get_norm_pow(); int ctn_get_min_pow(); int ctn_get_state(); char *ctn_get_state_str(); int ctn_get_step(); int ctn_get_tick(); double ctn_get_tick_ave(); double ctn_get_tick_cur(); double ctn_get_tick_max(); char *ctn_get_state_str(); char *ctn_get_err_str(); int ctn_get_err(); int ctn_enable_bsytikchk(); int ctn_disable_bsytikchk(); int ctn_get_bsytikchk_en(); int ctn_get_bsytikchk_from_host(); int ctn_get_bsytikchk_timeout(); int ctn_enable_pcs_bsytiksnd(); int ctn_enable_bms_bsytiksnd(); int ctn_disable_pcs_bsytiksnd(); int ctn_set_socd(double val); int ctn_set_socc(double val); double ctn_get_soc(); double ctn_get_soh(); double ctn_get_socd(); double ctn_get_socc(); int ctn_get_cell_otp(); int ctn_get_cell_utp(); int ctn_get_chgable(); int ctn_get_dhgable(); char *ctn_get_model_str(); int ctn_cfg_save_socd(); int ctn_cfg_save_socc(); int ctn_get_tool_data(char *buf); int ctn_get_cmd(); unsigned short ctn_get_cmd_param1(); unsigned short ctn_get_cmd_param2(); unsigned short ctn_get_cmd_param3(); unsigned short ctn_get_cmd_param4(); int ctn_set_cmd(int cmd); int ctn_set_cmd_param1(unsigned short param); int ctn_set_cmd_param2(unsigned short param); int ctn_set_cmd_param3(unsigned short param); int ctn_set_cmd_param4(unsigned short param); int ctn_set_bsytikchk_from_host(unsigned char tick); char *ctn_get_projid(); char *ctn_get_dev_id(); int ctn_get_init_data(int ctn_idx, char *buf); int ctn_get_tbmqtt_data(char *buf); char *ctn_get_hostname(); #endif /* CTN_H */