mirror of
https://github.com/sweidac/kidsbox.git
synced 2025-07-28 03:41:54 +02:00
Cleanup WebInterface and make RFIDInterface reachable.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user