ctn.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef CTN_H
  2. #define CTN_H
  3. #include "plt.h"
  4. struct ctn_t
  5. {
  6. int idx_in_ess;
  7. char szsn[150];
  8. char szinfo[32];
  9. char szprojId[128];
  10. char szmodel[32];
  11. int model;
  12. // int idx; /* idx of ctn model */
  13. int adr;
  14. char sztime[32];
  15. int cmd;
  16. unsigned short cmdpara[4];
  17. // int time_zone;
  18. };
  19. extern struct ctn_t ctn[CTN_NBR_MAX + 1];
  20. int ctn_init(void);
  21. int ctn_send_cmd(int cmd);
  22. int ctn_set_aps(int val);
  23. char *ctn_get_sn();
  24. char *ctn_get_info();
  25. int ctn_get_idx_in_ess();
  26. int ctn_get_ap();
  27. int ctn_get_aps();
  28. int ctn_get_last_aps();
  29. int ctn_get_norm_cap();
  30. int ctn_get_norm_pow();
  31. int ctn_get_min_pow();
  32. int ctn_get_state();
  33. char *ctn_get_state_str();
  34. int ctn_get_step();
  35. int ctn_get_tick();
  36. double ctn_get_tick_ave();
  37. double ctn_get_tick_cur();
  38. double ctn_get_tick_max();
  39. char *ctn_get_state_str();
  40. char *ctn_get_err_str();
  41. int ctn_get_err();
  42. int ctn_enable_bsytikchk();
  43. int ctn_disable_bsytikchk();
  44. int ctn_get_bsytikchk_en();
  45. int ctn_get_bsytikchk_from_host();
  46. int ctn_get_bsytikchk_timeout();
  47. int ctn_enable_pcs_bsytiksnd();
  48. int ctn_enable_bms_bsytiksnd();
  49. int ctn_disable_pcs_bsytiksnd();
  50. int ctn_set_socd(double val);
  51. int ctn_set_socc(double val);
  52. double ctn_get_soc();
  53. double ctn_get_soh();
  54. double ctn_get_socd();
  55. double ctn_get_socc();
  56. int ctn_get_cell_otp();
  57. int ctn_get_cell_utp();
  58. int ctn_get_chgable();
  59. int ctn_get_dhgable();
  60. char *ctn_get_model_str();
  61. int ctn_cfg_save_socd();
  62. int ctn_cfg_save_socc();
  63. int ctn_get_tool_data(char *buf);
  64. int ctn_get_cmd();
  65. unsigned short ctn_get_cmd_param1();
  66. unsigned short ctn_get_cmd_param2();
  67. unsigned short ctn_get_cmd_param3();
  68. unsigned short ctn_get_cmd_param4();
  69. int ctn_set_cmd(int cmd);
  70. int ctn_set_cmd_param1(unsigned short param);
  71. int ctn_set_cmd_param2(unsigned short param);
  72. int ctn_set_cmd_param3(unsigned short param);
  73. int ctn_set_cmd_param4(unsigned short param);
  74. int ctn_set_bsytikchk_from_host(unsigned char tick);
  75. char *ctn_get_projid();
  76. char *ctn_get_dev_id();
  77. int ctn_get_init_data(int ctn_idx, char *buf);
  78. int ctn_get_tbmqtt_data(char *buf);
  79. char *ctn_get_hostname();
  80. #endif /* CTN_H */