#ifndef MqttHelper_h #define MqttHelper_h #include #include #include #include class MqttHelper { private: const char *id = "HBL1"; const char *psw = "bpa.1qaz@WSX"; const char *mqttServer = "10.2.1.21"; const int mqttPort = 1883; //服务器TCP协议的端口号 const char *mqttUser = "emqx_u_block"; //登录服务器所需的用户名 const char *mqttPsw = "emqx_p_admin8765490789"; //密码 const char *HeartbeatTopic = "UP/ENERGY_POWER/BUSINESS/0"; // const char *id = "pert"; // const char *psw = "12345678"; // const char *mqttServer = "111.9.47.105"; // const int mqttPort = 18883; //服务器TCP协议的端口号 // const char *mqttUser = "admin"; //登录服务器所需的用户名 // const char *mqttPsw = "admin8765490789"; //密码 // const char *HeartbeatTopic = "UP/ENERGY_POWER/BUSINESS/0"; String clientId; public: MqttHelper(/* args */); ~MqttHelper(); void Init(); void Loop(); void publish(String message); void ReConnect(); }; extern MqttHelper _mqttHelper; #endif