rh811ad053f.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef __RH811AD053F_H__
  2. #define __RH811AD053F_H__
  3. #include "plt.h"
  4. #define RH811AD053F_NBR_MAX 8
  5. struct rh811ad053f_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. double temp;
  18. double humi;
  19. };
  20. extern struct rh811ad053f_t rh811ad053f[RH811AD053F_NBR_MAX + 1];
  21. int rh811ad053f_init();
  22. int rh811ad053f_get_state( int idx);
  23. char* rh811ad053f_get_state_str( int idx);
  24. int rh811ad053f_get_cmd( int idx);
  25. void rh811ad053f_reset_cmd( int idx);
  26. int rh811ad053f_send_sm_cmd( int idx, int val );
  27. int rh811ad053f_get_addr( int idx );
  28. double rh811ad053f_get_temp( int idx );
  29. double rh811ad053f_get_humi( int idx );
  30. int rh811ad053f_chk_stat_all( int stat);
  31. int rh811ad053f_send_sm_cmd_all( int val );
  32. int rh811ad053f_get_comm_st(int idx);
  33. int rh811ad053f_get_chan_idx(int idx);
  34. int rh811ad053f_get_tick(int idx);
  35. char* rh811ad053f_get_comm_state_str(int idx);
  36. int rh811ad053f_get_nbr();
  37. int rh811ad053f_get_tool_data(int idx,char* buf);
  38. int rh811ad053f_get_tbmqtt_data(int idx,char* buf);
  39. int rh811ad053f_get_cloud_data(int ctn_idx,int idx,char* buf);
  40. int rh811ad053f_get_bkds_data(int idx,char* buf);
  41. int rh811ad053f_get_init_data(int ctn_idx, int idx,char* buf);
  42. int rh811ad053f_get_modbus_data(int idx,unsigned short* data);
  43. #endif