Sat, 01 Apr 2023 21:06:59 +0200
Added task_out to drive the relays and led lights. Added NVS namespace to store the state of the outputs. Respond to subscribed MQTT topics to set new output values.
/** * @file task_mqtt.h * @brief The FreeRTOS task to maintain MQTT connections. */ #ifndef _TASK_MQTT_H #define _TASK_MQTT_H /** * @brief Request a MQTT connection * @param state Request of disconnect a connection. */ void connect_mqtt(bool state); /** * @brief Check if MQTT is connected * @return Returns true if MQTT is connected */ bool ready_mqtt(void); /** * @brief Wait for disconnect with timeout. * @param time Timeout in milliseconds. */ void wait_mqtt(int time); /** * @brief Publish */ void publish(void); /** * @brief The FreeRTOS task to run MQTT connections. * @param pvParameters Parameters for the task. */ void task_mqtt(void *pvParameters); #endif