smaller fixes and using new esphttpdutils component
This commit is contained in:
@ -7,12 +7,15 @@ set(sources
|
||||
)
|
||||
|
||||
set(dependencies
|
||||
esp_https_ota
|
||||
|
||||
expected
|
||||
fmt
|
||||
|
||||
cpputils
|
||||
espchrono
|
||||
espcpputils
|
||||
esp_https_ota
|
||||
expected
|
||||
fmt
|
||||
esphttpdutils
|
||||
)
|
||||
|
||||
idf_component_register(
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
// local includes
|
||||
#include "cleanuphelper.h"
|
||||
#include "espstrutils.h"
|
||||
#include "esphttpdutils.h"
|
||||
#include "tickchrono.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
@ -155,8 +155,8 @@ tl::expected<void, std::string> EspAsyncOta::trigger(std::string_view url, std::
|
||||
if (url.empty())
|
||||
return tl::make_unexpected("empty firmware url");
|
||||
|
||||
if (const auto result = espcpputils::urlverify(url); !result)
|
||||
return result;
|
||||
if (const auto result = esphttpdutils::urlverify(url); !result)
|
||||
return tl::make_unexpected(fmt::format("could not verify firmware url: {}", result.error()));
|
||||
|
||||
m_url = std::string{url};
|
||||
m_cert_pem = cert_pem;
|
||||
|
@ -14,20 +14,21 @@
|
||||
#include "taskutils.h"
|
||||
#include "wrappers/event_group.h"
|
||||
#include "espchrono.h"
|
||||
#include "cpptypesafeenum.h"
|
||||
|
||||
enum OtaCloudUpdateStatus
|
||||
{
|
||||
Idle,
|
||||
Updating,
|
||||
Failed,
|
||||
Succeeded,
|
||||
NotReady
|
||||
};
|
||||
#define OtaCloudUpdateStatusValues(x) \
|
||||
x(Idle) \
|
||||
x(Updating) \
|
||||
x(Failed) \
|
||||
x(Succeeded) \
|
||||
x(NotReady)
|
||||
DECLARE_TYPESAFE_ENUM(OtaCloudUpdateStatus, : uint8_t, OtaCloudUpdateStatusValues)
|
||||
IMPLEMENT_TYPESAFE_ENUM(OtaCloudUpdateStatus, : uint8_t, OtaCloudUpdateStatusValues)
|
||||
|
||||
class EspAsyncOta
|
||||
{
|
||||
public:
|
||||
EspAsyncOta(const char *taskName="asyncOtaTask", uint32_t stackSize=2048, espcpputils::CoreAffinity coreAffinity=espcpputils::CoreAffinity::Core1);
|
||||
EspAsyncOta(const char *taskName="asyncOtaTask", uint32_t stackSize=4096, espcpputils::CoreAffinity coreAffinity=espcpputils::CoreAffinity::Core1);
|
||||
~EspAsyncOta();
|
||||
|
||||
tl::expected<void, std::string> startTask();
|
||||
|
Reference in New Issue
Block a user