rs311.h 1000 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef RS311_H
  2. #define RS311_H
  3. #define RS311_NBR_MAX 1
  4. #include "plt.h"
  5. struct rs311_t
  6. {
  7. char szinfo[32];
  8. int idx;
  9. char szdev_id[SNOW_ID_BUF_SIZE];
  10. struct comm_t comm;
  11. struct statemachine_t sm;
  12. int cmd;
  13. int spurt_flag;
  14. };
  15. extern struct rs311_t rs311[RS311_NBR_MAX + 1];
  16. int rs311_init(void);
  17. int rs311_get_state(int idx);
  18. int rs311_send_sm_cmd(int idx, int cmd);
  19. int rs311_get_addr(int idx);
  20. int rs311_chk_state_all(int stat);
  21. int rs311_send_sm_cmd_all(int cmd);
  22. int rs311_get_cmd(int idx);
  23. void rs311_reset_cmd(int idx);
  24. int rs311_get_comm_st(int idx);
  25. int rs311_get_chan_idx(int idx);
  26. char *rs311_get_comm_st_str(int idx);
  27. int rs311_get_tick(int idx);
  28. int rs311_get_nbr();
  29. int rs311_get_tool_data(int idx, char *buf);
  30. int rs311_get_tbmqtt_data(int idx, char *buf);
  31. int rs311_get_cloud_data(int ctn_idx, int idx, char *buf);
  32. int rs311_get_init_data(int ctn_idx, int idx, char *buf);
  33. int rs311_get_modbus_data(int idx, unsigned short* data);
  34. #endif /* RS311_H */