#ifndef QTHING_H #define QTHING_H #include <string> #include <string> #include <functional> #include "driver/gpio.h" // types enum pull_resistor_t { none, pullup, pulldown }; typedef std::function<void(std::string)> message_callback_t; // network void enable_wlan(); // mqtt void publish_message(const std::string& topic, const std::string& message); void add_message_callback(const std::string& topic, message_callback_t callback); // common IO void enable_oled(); void add_digital_input(gpio_num_t gpio_num, pull_resistor_t pull_resistor, std::function<void()> on_falling_edge, std::function<void()> on_rising_edge); void add_digital_input(gpio_num_t gpio_num, pull_resistor_t pull_resistor, std::string topic); void add_button(gpio_num_t gpio, std::function<void()> on_press = NULL, std::function<void()> on_release = NULL); void add_button(gpio_num_t gpio, std::string topic, std::string message); void add_relay(const std::string& topic, gpio_num_t gpio_off, gpio_num_t gpio_on); #endif