45 string_view p{__PRETTY_FUNCTION__};
46 return string_view(data(p) + 34, size(p) - 34 - 1);
47#elif defined(__GNUC__)
48 string_view p{__PRETTY_FUNCTION__};
49# if __cplusplus < 201402
50 return string_view(data(p) + 36, size(p) - 36 - 1);
52 return string_view(data(p) + 49, p.find(
';', 49) - 49);
54#elif defined(_MSC_VER)
55 string_view p{__FUNCSIG__};
56 return string_view(data(p) + 84, size(p) - 84 - 7);
60std::optional<dcc::Address::value_type>
uri2address(std::string_view uri);
65template<std::output_iterator<
char> OutputIt>
67 auto first{begin(uri)};
68 auto const last{cend(uri)};
69 while (first < last) {
71 if (c ==
'+') c =
' ';
73 std::from_chars(first, first + 2, c, 16);
88template<
typename... Ts>
101 httpd_ws_frame_t frame{
106 if (
auto const err{httpd_ws_send_frame_async(
108 LOGD(
"httpd_ws_send_frame_async failed %s", esp_err_to_name(err));
#define LOGD(...)
Definition log.h:46
httpd_handle_t handle
Handle to server instance.
Definition config.hpp:496
Definition message.hpp:29
httpd_ws_type_t type
Definition message.hpp:31
int sock_fd
Definition message.hpp:30
std::vector< uint8_t > payload
Definition message.hpp:32
std::optional< dcc::Address > uri2loco_address(std::string_view uri)
Definition utility.cpp:78
void esp_delayed_restart()
Definition utility.cpp:54
bool validate_json(std::string_view json)
Definition utility.cpp:60
auto httpd_sess_trigger_close(Ts &&... ts)
Definition utility.hpp:89
auto httpd_queue_work(intf::http::Message *msg)
Definition utility.hpp:94
uint32_t http_receive_timeout2ms()
Definition utility.cpp:88
OutputIt decode_uri(std::string_view uri, OutputIt out)
https://rosettacode.org/wiki/URL_decoding#C
Definition utility.hpp:66
esp_err_t ipc_call_blocking(BaseType_t core_id, esp_err_t(*f)())
Definition utility.cpp:94
consteval std::string_view type_name()
Definition utility.hpp:42
std::optional< dcc::Address::value_type > uri2address(std::string_view uri)
Definition utility.cpp:67