Cleanup WebInterface and make RFIDInterface reachable.

This commit is contained in:
Simon Weidacher
2021-12-26 14:00:30 +01:00
parent 1788c9e5aa
commit ad2499506a
5 changed files with 146 additions and 211 deletions

View File

@@ -1,6 +1,10 @@
#include "RFIDInterface.hpp"
#include <esp_log.h>
#include <esp_err.h>
#include <esp_http_server.h>
#include "WebInterface.hpp"
static const char* TAG = "rfid";
@@ -24,3 +28,16 @@ void RFIDInterface::start() {
rc522_start(startConfig);
}
void RFIDInterface::registerWebResources(WebInterface* interface) {
httpd_uri_t config = {
.uri = "/rfid",
.method = HTTP_GET,
.handler = [](httpd_req_t *req) {
httpd_resp_send(req, "it's all fine!", HTTPD_RESP_USE_STRLEN);
return ESP_OK;
}
};
interface->registerResource(&config);
}