#ifndef RS311_H #define RS311_H #define RS311_NBR_MAX 1 #include "plt.h" struct rs311_t { char szinfo[32]; int idx; char szdev_id[SNOW_ID_BUF_SIZE]; struct comm_t comm; struct statemachine_t sm; int cmd; int spurt_flag; }; extern struct rs311_t rs311[RS311_NBR_MAX + 1]; int rs311_init(void); int rs311_get_state(int idx); int rs311_send_sm_cmd(int idx, int cmd); int rs311_get_addr(int idx); int rs311_chk_state_all(int stat); int rs311_send_sm_cmd_all(int cmd); int rs311_get_cmd(int idx); void rs311_reset_cmd(int idx); int rs311_get_comm_st(int idx); int rs311_get_chan_idx(int idx); char *rs311_get_comm_st_str(int idx); int rs311_get_tick(int idx); int rs311_get_nbr(); int rs311_get_tool_data(int idx, char *buf); int rs311_get_tbmqtt_data(int idx, char *buf); int rs311_get_cloud_data(int ctn_idx, int idx, char *buf); int rs311_get_init_data(int ctn_idx, int idx, char *buf); int rs311_get_modbus_data(int idx, unsigned short* data); #endif /* RS311_H */