#ifndef __RH811AD053F_H__ #define __RH811AD053F_H__ #include "plt.h" #define RH811AD053F_NBR_MAX 8 struct rh811ad053f_t{ char szinfo[32]; int idx; char szdev_id[SNOW_ID_BUF_SIZE]; //char szmodel[32]; //int model; //char szaddr[16]; //int chan_idx; //int adr; int cmd; struct comm_t comm; struct statemachine_t sm; double temp; double humi; }; extern struct rh811ad053f_t rh811ad053f[RH811AD053F_NBR_MAX + 1]; int rh811ad053f_init(); int rh811ad053f_get_state( int idx); char* rh811ad053f_get_state_str( int idx); int rh811ad053f_get_cmd( int idx); void rh811ad053f_reset_cmd( int idx); int rh811ad053f_send_sm_cmd( int idx, int val ); int rh811ad053f_get_addr( int idx ); double rh811ad053f_get_temp( int idx ); double rh811ad053f_get_humi( int idx ); int rh811ad053f_chk_stat_all( int stat); int rh811ad053f_send_sm_cmd_all( int val ); int rh811ad053f_get_comm_st(int idx); int rh811ad053f_get_chan_idx(int idx); int rh811ad053f_get_tick(int idx); char* rh811ad053f_get_comm_state_str(int idx); int rh811ad053f_get_nbr(); int rh811ad053f_get_tool_data(int idx,char* buf); int rh811ad053f_get_tbmqtt_data(int idx,char* buf); int rh811ad053f_get_cloud_data(int ctn_idx,int idx,char* buf); int rh811ad053f_get_bkds_data(int idx,char* buf); int rh811ad053f_get_init_data(int ctn_idx, int idx,char* buf); int rh811ad053f_get_modbus_data(int idx,unsigned short* data); #endif