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
16
#pragma once
17
18
#include <esp_task.h>
19
#include <queue>
20
#include <ulf/susiv2.hpp>
21
#include "
intf/http/message.hpp
"
22
23
namespace
mw::zimo::zusi
{
24
28
class
Service
{
29
public
:
30
Service
();
31
32
esp_err_t
socket
(
intf::http::Message
& msg);
33
34
private
:
35
[[noreturn]]
void
taskFunction
(
void
*);
36
void
loop
();
37
::ulf::susiv2::Response
transmit
(std::vector<uint8_t>
const
& payload)
const
;
38
void
close
();
39
40
::ulf::susiv2::Response
_resp
{};
41
std::queue<intf::http::Message>
_queue
{};
42
};
43
44
}
// namespace mw::zimo::zusi
mw::zimo::zusi::Service::loop
void loop()
Definition
service.cpp:63
mw::zimo::zusi::Service::socket
esp_err_t socket(intf::http::Message &msg)
Definition
service.cpp:34
mw::zimo::zusi::Service::close
void close()
Definition
service.cpp:124
mw::zimo::zusi::Service::_queue
std::queue< intf::http::Message > _queue
Definition
service.hpp:41
mw::zimo::zusi::Service::transmit
::ulf::susiv2::Response transmit(std::vector< uint8_t > const &payload) const
Definition
service.cpp:104
mw::zimo::zusi::Service::_resp
::ulf::susiv2::Response _resp
Definition
service.hpp:40
mw::zimo::zusi::Service::Service
Service()
Definition
service.cpp:28
mw::zimo::zusi::Service::taskFunction
void taskFunction(void *)
Definition
service.cpp:54
message.hpp
HTTP websocket message.
mw::zimo::zusi
Definition
config.hpp:696
intf::http::Message
Definition
message.hpp:29
src
mw
zimo
zusi
service.hpp
Firmware 0.9.0