Firmware  0.0.0
Loading...
Searching...
No Matches
server.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 <string>
25#include "utility.hpp"
26
27namespace http::ap {
28
29class Server {
30public:
31 explicit Server(QueueHandle_t ap_records_queue_handle);
32 ~Server();
33
34private:
35 void buildApRecordsStrings(QueueHandle_t ap_records_queue_handle);
36 void buildGetString();
37 void getConfig();
38 void setConfig() const;
39 esp_err_t wildcardGetHandler(httpd_req_t* req);
40 esp_err_t savePostHandler(httpd_req_t* req);
41
42 static constexpr auto unicode_lock_{"&#x1F512"};
43
44 std::string _ap_options_str;
45 std::string _ap_records_str;
46 std::string _get_str;
47 std::string _sta_mdns_str;
48 std::string _sta_ssid_str;
49 std::string _sta_pass_str;
50};
51
52} // namespace http::ap
Definition server.hpp:29
Server(QueueHandle_t ap_records_queue_handle)
Ctor.
Definition server.cpp:39
std::string _sta_mdns_str
Definition server.hpp:47
std::string _get_str
Definition server.hpp:46
std::string _sta_pass_str
Definition server.hpp:49
esp_err_t wildcardGetHandler(httpd_req_t *req)
Definition server.cpp:137
esp_err_t savePostHandler(httpd_req_t *req)
Definition server.cpp:145
void buildGetString()
Definition server.cpp:99
~Server()
Dtor.
Definition server.cpp:69
static constexpr auto unicode_lock_
Definition server.hpp:42
void getConfig()
Definition server.cpp:115
void buildApRecordsStrings(QueueHandle_t ap_records_queue_handle)
Definition server.cpp:75
std::string _ap_records_str
Definition server.hpp:45
void setConfig() const
Definition server.cpp:129
std::string _sta_ssid_str
Definition server.hpp:48
std::string _ap_options_str
Definition server.hpp:44
Definition init.cpp:26
Utility functions.