SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
base_command_handler.h
Go to the documentation of this file.
1#ifndef SENSESP_NET_WEB_BASE_COMMAND_HANDLER_H_
2#define SENSESP_NET_WEB_BASE_COMMAND_HANDLER_H_
3
4#include <esp_http_server.h>
5#include <vector>
6
7#include "ArduinoJson.h"
9#include "sensesp_base_app.h"
10
11namespace sensesp {
12
14 public:
15 RouteDefinition(String name, String path, String component_name)
16 : name_(name), path_(path), component_name_(component_name) {};
17
18 String get_name() { return name_; }
19 String get_path() { return path_; }
21
22 JsonDocument as_json() {
23 JsonDocument doc;
24 doc["name"] = name_;
25 doc["path"] = path_;
26 doc["componentName"] = component_name_;
27
28 return doc;
29 }
30
31 protected:
32 String name_;
33 String path_;
35};
36
37void add_base_app_http_command_handlers(std::shared_ptr<HTTPServer>& server);
38
39} // namespace sensesp
40
41#endif // SENSESP_NET_HTTP_COMMAND_HANDLER_H_
RouteDefinition(String name, String path, String component_name)
void add_base_app_http_command_handlers(std::shared_ptr< HTTPServer > &server)