interface_mqtt.h 693 B

123456789101112131415161718192021
  1. #ifndef INTERFACE_MQTT_H
  2. #define INTERFACE_MQTT_H
  3. #include <string>
  4. #include <map>
  5. #include <functional>
  6. void MQTTInit(std::string _mqttURI, std::string _clientid, std::string _user, std::string _password, std::string _LWTContext, int _keepalive);
  7. void MQTTdestroy();
  8. //void MQTTInit(std::string _mqttURI, std::string _clientid, std::string _user = "", std::string _password = "");
  9. void MQTTPublish(std::string _key, std::string _content, int retained_flag = 0);
  10. bool MQTTisConnected();
  11. void MQTTregisterSubscribeFunction(std::string topic, std::function<bool(std::string, char*, int)> func);
  12. void MQTTdestroySubscribeFunction();
  13. void MQTTsubscribeFunctions();
  14. #endif //INTERFACE_MQTT_H