OTA task
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <string.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "fw_command.h"
|
||||
#include "ota.h"
|
||||
|
||||
static const char* TAG = "WS";
|
||||
|
||||
@@ -57,6 +58,8 @@ static void ws_event_handler(void* handler_args,
|
||||
ESP_LOGI(TAG, "URL: %s", cmd.url);
|
||||
ESP_LOGI(TAG, "SHA256: %s", cmd.sha256);
|
||||
|
||||
ota_task_start(&cmd);
|
||||
|
||||
// пока просто лог, без OTA
|
||||
}
|
||||
|
||||
@@ -73,7 +76,7 @@ void ws_init(const char* uri)
|
||||
config.network_timeout_ms = 5000;
|
||||
|
||||
client = esp_websocket_client_init(&config);
|
||||
esp_websocket_register_events(client, WEBSOCKET_EVENT_ANY, ws_event_handler, NULL);
|
||||
esp_websocket_register_events(client, WEBSOCKET_EVENT_ANY, ws_event_handler, nullptr);
|
||||
}
|
||||
|
||||
void ws_start()
|
||||
@@ -108,3 +111,8 @@ void ws_go()
|
||||
ws_init(uri);
|
||||
ws_start();
|
||||
}
|
||||
|
||||
void ws_disconnect()
|
||||
{
|
||||
esp_websocket_client_stop(client);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user