Firmware
0.9.0
Toggle main menu visibility
Loading...
Searching...
No Matches
service.hpp
Go to the documentation of this file.
1
// Copyright (C) 2025 Vincent Hamp
2
//
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, either version 3 of the License, or
6
// (at your option) any later version.
7
//
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
21
22
#pragma once
23
24
#include <esp_err.h>
25
#include <esp_ota_ops.h>
26
#include <esp_partition.h>
27
#include <queue>
28
#include "
intf/http/message.hpp
"
29
30
namespace
mw::ota
{
31
32
class
Service
{
33
public
:
34
Service
();
35
36
esp_err_t
socket
(
intf::http::Message
& msg);
37
38
private
:
39
// This gets called by FreeRTOS
40
[[noreturn]]
void
taskFunction
(
void
*);
41
42
void
loop
();
43
uint8_t
write
(std::vector<uint8_t>
const
& payload);
44
void
end
();
45
void
close
();
46
47
std::queue<intf::http::Message>
_queue
{};
48
esp_partition_t
const
*
_partition
{};
49
esp_ota_handle_t
_handle
{};
50
uint8_t
_ack
{};
51
};
52
53
}
// namespace mw::ota
mw::ota::Service::_ack
uint8_t _ack
Definition
service.hpp:50
mw::ota::Service::loop
void loop()
Definition
service.cpp:68
mw::ota::Service::taskFunction
void taskFunction(void *)
Definition
service.cpp:59
mw::ota::Service::_partition
esp_partition_t const * _partition
Definition
service.hpp:48
mw::ota::Service::close
void close()
Definition
service.cpp:146
mw::ota::Service::end
void end()
Definition
service.cpp:135
mw::ota::Service::Service
Service()
Definition
service.cpp:34
mw::ota::Service::socket
esp_err_t socket(intf::http::Message &msg)
Definition
service.cpp:39
mw::ota::Service::_handle
esp_ota_handle_t _handle
Definition
service.hpp:49
mw::ota::Service::_queue
std::queue< intf::http::Message > _queue
Definition
service.hpp:47
mw::ota::Service::write
uint8_t write(std::vector< uint8_t > const &payload)
Definition
service.cpp:113
message.hpp
HTTP websocket message.
mw::ota
Definition
config.hpp:605
intf::http::Message
Definition
message.hpp:29
src
mw
ota
service.hpp
Firmware 0.9.0