cd1f3300.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef __CD1F3300_H__
  2. #define __CD1F3300_H__
  3. #include "plt.h"
  4. #define CD1F3300_NBR_MAX 8
  5. struct cd1f3300_t{
  6. char szinfo[32];
  7. int idx;
  8. char szdev_id[SNOW_ID_BUF_SIZE];
  9. //char szmodel[32];
  10. //int model;
  11. //char szaddr[16];
  12. //int chan_idx;
  13. //int adr;
  14. int cmd;
  15. struct comm_t comm;
  16. struct statemachine_t sm;
  17. int co_density;
  18. int state;
  19. int threshold;
  20. char state_str[30];
  21. };
  22. extern struct cd1f3300_t cd1f3300[CD1F3300_NBR_MAX + 1];
  23. int cd1f3300_init();
  24. int cd1f3300_get_state( int idx);
  25. char* cd1f3300_get_state_str( int idx);
  26. int cd1f3300_get_cmd( int idx);
  27. void cd1f3300_reset_cmd( int idx);
  28. int cd1f3300_send_sm_cmd( int idx, int val );
  29. int cd1f3300_get_addr( int idx );
  30. int cd1f3300_get_co_density(int idx);
  31. int cd1f3300_get_co_threshold(int idx);
  32. int cd1f3300_chk_stat_all( int stat);
  33. int cd1f3300_send_sm_cmd_all( int val );
  34. int cd1f3300_get_comm_st(int idx);
  35. int cd1f3300_get_chan_idx(int idx);
  36. int cd1f3300_get_tick(int idx);
  37. char* cd1f3300_get_comm_state_str(int idx);
  38. int cd1f3300_get_nbr();
  39. int cd1f3300_get_tool_data(int idx,char* buf);
  40. int cd1f3300_get_tbmqtt_data(int idx,char* buf);
  41. int cd1f3300_get_cloud_data(int ctn_idx,int idx,char* buf);
  42. int cd1f3300_get_bkds_data(int idx,char* buf);
  43. int cd1f3300_get_init_data(int ctn_idx, int idx, char *buf);
  44. int cd1f3300_get_modbus_data(int idx,unsigned short* data);
  45. #endif