Unused and untested peripheral endpoint updated to protobufs
This commit is contained in:
+6
-6
@@ -82,12 +82,12 @@ void setupServer() {
|
||||
return apService.protoEndpoint.handleStateUpdate(request, protoReq);
|
||||
});
|
||||
|
||||
// TODO: REMAKE TO PROTO - note: these are unused?
|
||||
server.on("/api/peripherals", HTTP_GET,
|
||||
[&](httpd_req_t *request) { return peripherals.endpoint.getState(request); });
|
||||
server.on("/api/peripherals", HTTP_POST, [&](httpd_req_t *request, JsonVariant &json) {
|
||||
return peripherals.endpoint.handleStateUpdate(request, json);
|
||||
});
|
||||
server.on("/api/peripherals/settings", HTTP_GET,
|
||||
[&](httpd_req_t *request) { return peripherals.protoEndpoint.getState(request); });
|
||||
server.onProto("/api/peripherals/settings", HTTP_POST,
|
||||
[&](httpd_req_t *request, api_Request *protoReq) {
|
||||
return peripherals.protoEndpoint.handleStateUpdate(request, protoReq);
|
||||
});
|
||||
|
||||
#if FT_ENABLED(USE_MDNS)
|
||||
server.on("/api/mdns/settings", HTTP_GET, [&](httpd_req_t *request) { return mdnsService.protoEndpoint.getState(request); });
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
#include <peripherals/peripherals.h>
|
||||
|
||||
Peripherals::Peripherals()
|
||||
: endpoint(PeripheralsConfiguration::read, PeripheralsConfiguration::update, this),
|
||||
_persistence(PeripheralsConfiguration::read, PeripheralsConfiguration::update, this, DEVICE_CONFIG_FILE) {
|
||||
: protoEndpoint(PeripheralsConfiguration_read, PeripheralsConfiguration_update, this,
|
||||
API_REQUEST_EXTRACTOR(peripheral_settings, api_PeripheralSettings),
|
||||
API_RESPONSE_ASSIGNER(peripheral_settings, api_PeripheralSettings)),
|
||||
_persistence(PeripheralsConfiguration_read, PeripheralsConfiguration_update, this,
|
||||
PERIPHERAL_SETTINGS_FILE, api_PeripheralSettings_fields, api_PeripheralSettings_size,
|
||||
PeripheralsConfiguration_defaults()) {
|
||||
_accessMutex = xSemaphoreCreateMutex();
|
||||
addUpdateHandler([&](const std::string &originId) { updatePins(); }, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user