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/decup_ein.hpp>
21
#include "
intf/http/message.hpp
"
22
23
namespace
mw::zimo::decup
{
24
25
class
Service
:
public
::ulf::decup_ein::rx::Base {
26
public
:
27
Service
();
28
29
esp_err_t
zppSocket
(
intf::http::Message
& msg);
30
esp_err_t
zsuSocket
(
intf::http::Message
& msg);
31
32
private
:
33
esp_err_t
socket
(
intf::http::Message
& msg,
State
decup_state);
34
[[noreturn]]
void
taskFunction
(
void
*);
35
void
loop
();
36
37
uint8_t
transmit
(std::span<uint8_t const> bytes, uint32_t)
final
;
38
void
config
(uint8_t)
final
;
39
40
void
close
();
41
42
std::queue<intf::http::Message>
_queue
{};
43
std::optional<uint8_t>
_ack
{};
44
};
45
46
}
// namespace mw::zimo::decup
mw::zimo::decup::Service::Service
Service()
Definition
service.cpp:28
mw::zimo::decup::Service::loop
void loop()
Definition
service.cpp:73
mw::zimo::decup::Service::socket
esp_err_t socket(intf::http::Message &msg, State decup_state)
Definition
service.cpp:43
mw::zimo::decup::Service::_queue
std::queue< intf::http::Message > _queue
Definition
service.hpp:42
mw::zimo::decup::Service::zsuSocket
esp_err_t zsuSocket(intf::http::Message &msg)
Definition
service.cpp:38
mw::zimo::decup::Service::close
void close()
Definition
service.cpp:132
mw::zimo::decup::Service::transmit
uint8_t transmit(std::span< uint8_t const > bytes, uint32_t) final
Definition
service.cpp:115
mw::zimo::decup::Service::config
void config(uint8_t) final
Definition
service.cpp:129
mw::zimo::decup::Service::taskFunction
void taskFunction(void *)
Definition
service.cpp:63
mw::zimo::decup::Service::zppSocket
esp_err_t zppSocket(intf::http::Message &msg)
Definition
service.cpp:33
mw::zimo::decup::Service::_ack
std::optional< uint8_t > _ack
Definition
service.hpp:43
State
State
System state.
Definition
config.hpp:154
message.hpp
HTTP websocket message.
mw::zimo::decup
Definition
config.hpp:640
intf::http::Message
Definition
message.hpp:29
src
mw
zimo
decup
service.hpp
Firmware 0.9.0