diff --git a/esp32/include/communication/comm_base.hpp b/esp32/include/communication/comm_base.hpp index cafd346..b1ed5b0 100644 --- a/esp32/include/communication/comm_base.hpp +++ b/esp32/include/communication/comm_base.hpp @@ -38,15 +38,15 @@ class CommAdapterBase { array.add(event); array.add(payload); - // TODO: Only send to subscribed - #if USE_MSGPACK std::string bin; serializeMsgPack(doc, bin); - send(reinterpret_cast(bin.data()), bin.size(), -1); // TODO: Make CID dynamic + xSemaphoreGive(mutex_); + send(reinterpret_cast(bin.data()), bin.size(), -1); #else String out; serializeJson(doc, out); + xSemaphoreGive(mutex_); send(out.c_str(), -1); #endif } diff --git a/esp32/include/communication/websocket_adapter.h b/esp32/include/communication/websocket_adapter.h index af151e6..da2cb1b 100644 --- a/esp32/include/communication/websocket_adapter.h +++ b/esp32/include/communication/websocket_adapter.h @@ -10,7 +10,7 @@ #include -class Websocket : CommAdapterBase { +class Websocket : public CommAdapterBase { public: Websocket(PsychicHttpServer &server, const char *route = "/api/ws");