Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions firmware/src/connectivity/mqtt/application/mqtt_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,37 @@ class MqttService {
*/
esp_err_t connect(StatusHandler onStatus, MessageHandler onMessage);

/**
* @brief Publishes a payload to a topic (pass-through to the client).
*
* @param topic Destination topic.
* @param payload Message payload (may be binary).
* @param qos MQTT QoS (0, 1 or 2).
* @param retain Whether the broker should retain the message.
* @return ESP_OK on success, or an ESP-IDF error code on failure.
*/
esp_err_t publish(const std::string &topic, const std::string &payload,
int qos, bool retain);

/**
* @brief Subscribes to a topic (pass-through to the client).
*
* @param topic Topic filter to subscribe to.
* @param qos Requested MQTT QoS.
* @return ESP_OK on success, or an ESP-IDF error code on failure.
*/
esp_err_t subscribe(const std::string &topic, int qos);

/**
* @brief Stops the client and disconnects from the broker.
*
* @return ESP_OK on success, or an ESP-IDF error code on failure.
*/
esp_err_t stop();

/**
* @brief Whether the client currently holds a broker connection.
*/
bool isConnected() const;

private:
Expand Down
3 changes: 3 additions & 0 deletions firmware/src/peripherals/flash_memory/flash_memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace flash_memory {
*/
class FlashMemory : public FlashService {
public:
/**
* @brief Builds the facade, wiring the owned NVS adapter into the service.
*/
FlashMemory();

/**
Expand Down
Loading