增加断网保存数据到FLASH,恢复联网重新补发,并加上标志位
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "mqtt_client.h"
|
||||
#include "esp_log.h"
|
||||
#include "OFFLINE_STORAGE.h"
|
||||
|
||||
void mqtt_app_start(void);
|
||||
int mqtt_publish_message(const char* topic, const char* data, int len, int qos, int retain);
|
||||
@@ -22,4 +23,27 @@ void mqtt_stop_device_status_task(void);
|
||||
*
|
||||
* @param report_interval_ms 新的上报间隔(毫秒)
|
||||
*/
|
||||
void mqtt_update_report_interval(uint32_t report_interval_ms);
|
||||
void mqtt_update_report_interval(uint32_t report_interval_ms);
|
||||
|
||||
/**
|
||||
* @brief 存储离线数据(网络离线时使用)
|
||||
*
|
||||
* @param data 数据内容
|
||||
* @param length 数据长度
|
||||
* @param data_type 数据类型
|
||||
* @return ESP_OK 成功
|
||||
* ESP_FAIL 失败
|
||||
*/
|
||||
esp_err_t mqtt_store_offline(const char *data, size_t length, offline_data_type_t data_type);
|
||||
|
||||
/**
|
||||
* @brief 启动离线数据补传任务
|
||||
*
|
||||
* @return pdTRUE 成功, pdFALSE 失败
|
||||
*/
|
||||
BaseType_t mqtt_start_offline_upload_task(void);
|
||||
|
||||
/**
|
||||
* @brief 停止离线数据补传任务
|
||||
*/
|
||||
void mqtt_stop_offline_upload_task(void);
|
||||
Reference in New Issue
Block a user