interface_mqtt.h 767 B

12345678910111213141516171819202122
  1. #ifndef INTERFACE_MQTT_H
  2. #define INTERFACE_MQTT_H
  3. #include <string>
  4. #include <map>
  5. #include <functional>
  6. void MQTT_Configure(std::string _mqttURI, std::string _clientid, std::string _user, std::string _password, std::string _lwt, int _keepalive);
  7. bool MQTT_Init();
  8. void MQTTdestroy_client();
  9. bool MQTTPublish(std::string _key, std::string _content, int retained_flag = 1); // retained Flag as Standart
  10. bool MQTTisConnected();
  11. void MQTTregisterConnectFunction(std::string name, std::function<void()> func);
  12. void MQTTunregisterConnectFunction(std::string name);
  13. void MQTTregisterSubscribeFunction(std::string topic, std::function<bool(std::string, char*, int)> func);
  14. void MQTTdestroySubscribeFunction();
  15. void MQTTconnected();
  16. #endif //INTERFACE_MQTT_H