interface_mqtt.h 1.0 KB

12345678910111213141516171819202122232425262728
  1. #ifdef ENABLE_MQTT
  2. #ifndef INTERFACE_MQTT_H
  3. #define INTERFACE_MQTT_H
  4. #include <string>
  5. #include <map>
  6. #include <functional>
  7. bool MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _user, std::string _password,
  8. std::string _maintopic, std::string _lwt, std::string _lwt_connected, std::string _lwt_disconnected,
  9. int _keepalive, int SetRetainFlag, void *callbackOnConnected);
  10. int MQTT_Init();
  11. void MQTTdestroy_client();
  12. bool MQTTPublish(std::string _key, std::string _content, int retained_flag = 1); // retained Flag as Standart
  13. bool getMQTTisEnabled();
  14. bool getMQTTisConnected();
  15. void MQTTregisterConnectFunction(std::string name, std::function<void()> func);
  16. void MQTTunregisterConnectFunction(std::string name);
  17. void MQTTregisterSubscribeFunction(std::string topic, std::function<bool(std::string, char*, int)> func);
  18. void MQTTdestroySubscribeFunction();
  19. void MQTTconnected();
  20. void MQTTdisable();
  21. #endif //INTERFACE_MQTT_H
  22. #endif //#ENABLE_MQTT