mirror of
https://github.com/sweidac/kidsbox.git
synced 2026-10-28 06:52:57 +01:00
Cleanup WebInterface and make RFIDInterface reachable.
This commit is contained in:
1 parent
1788c9e5aa
commit
ad2499506a
5 files changed
+146
-211
No files matched your search
@@ -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