minor uodates to routing

This commit is contained in:
Proddy
2023-12-26 15:52:46 +01:00
parent 73a51ae4ad
commit 23d4f608c5
18 changed files with 231 additions and 742 deletions

View File

@@ -208,15 +208,13 @@ esp_err_t WebCustomizationService::device_entities(PsychicRequest * request) {
PsychicJsonResponse response = PsychicJsonResponse(request, true, EMSESP_JSON_SIZE_XXXXLARGE, true); // is array and also msgpack
JsonArray output = response.getRoot();
// TODO add back memory management
// TODO add back memory managegement. Be careful we do need to free()/delete() any object we extend with new()
// while (!response) {
// delete response;
// buffer -= 1024;
// // response = new MsgpackAsyncJsonResponse(true, buffer);
// }
// TODO add msgpack
for (const auto & emsdevice : EMSESP::emsdevices) {
if (emsdevice->unique_id() == id) {
#ifndef EMSESP_STANDALONE

View File

@@ -178,7 +178,7 @@ esp_err_t WebDataService::device_data(PsychicRequest * request) {
PsychicJsonResponse response = PsychicJsonResponse(request, false, EMSESP_JSON_SIZE_XXXXLARGE, true); // is jsonobject and also msgpack
JsonObject output = response.getRoot();
// TODO add back memory management?
// TODO add back memory managegement. Be careful we do need to free()/delete() any object we extend with new()
// check size
// while (!response) {
// delete response;

View File

@@ -80,7 +80,7 @@ void WebLogService::registerURI() {
return request->reply(200);
});
// TODO remove?
// TODO this can be removed when ported over
// server->addHandler(&events_);
}

View File

@@ -48,10 +48,11 @@ class WebLogService : public uuid::log::Handler {
virtual void operator<<(std::shared_ptr<uuid::log::Message> message);
private:
PsychicEventSource _events;
SecurityManager * _securityManager;
PsychicHttpServer * _server;
PsychicEventSource _events;
class QueuedLogMessage {
public:
QueuedLogMessage(unsigned long id, std::shared_ptr<uuid::log::Message> && content);
@@ -65,9 +66,6 @@ class WebLogService : public uuid::log::Handler {
void transmit(const QueuedLogMessage & message);
char * messagetime(char * out, const uint64_t t, const size_t bufsize);
// TODO remove this?
// PsychicJsonHandler setValues_; // for POSTs
esp_err_t fetchLog(PsychicRequest * request);
esp_err_t getValues(PsychicRequest * request);
esp_err_t setValues(PsychicRequest * request, JsonVariant & json);