interface_mqtt.h 743 B

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