mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Remove max LED number constraint from Matrix layout (#1805)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "QtHttpClientWrapper.h"
|
||||
|
||||
#include <api/JsonAPI.h>
|
||||
#include <api/JsonCallbacks.h>
|
||||
|
||||
WebJsonRpc::WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, bool localConnection, QtHttpClientWrapper* parent)
|
||||
: QObject(parent)
|
||||
@@ -14,8 +15,10 @@ WebJsonRpc::WebJsonRpc(QtHttpRequest* request, QtHttpServer* server, bool localC
|
||||
{
|
||||
const QString client = request->getClientInfo().clientAddress.toString();
|
||||
_jsonAPI = new JsonAPI(client, _log, localConnection, this, true);
|
||||
connect(_jsonAPI, &JsonAPI::callbackMessage, this, &WebJsonRpc::handleCallback);
|
||||
connect(_jsonAPI, &JsonAPI::callbackReady, this, &WebJsonRpc::sendCallbackMessage);
|
||||
connect(_jsonAPI, &JsonAPI::forceClose, [&]() { _wrapper->closeConnection(); _stopHandle = true; });
|
||||
connect(_jsonAPI->getCallBack().get(), &JsonCallbacks::callbackReady, this, &WebJsonRpc::sendCallbackMessage);
|
||||
|
||||
_jsonAPI->initialize();
|
||||
}
|
||||
|
||||
@@ -31,7 +34,7 @@ void WebJsonRpc::handleMessage(QtHttpRequest* request)
|
||||
}
|
||||
}
|
||||
|
||||
void WebJsonRpc::handleCallback(QJsonObject obj)
|
||||
void WebJsonRpc::sendCallbackMessage(QJsonObject obj)
|
||||
{
|
||||
// guard against wrong callbacks; TODO: Remove when JSONAPI is more solid
|
||||
if(!_unlocked) return;
|
||||
|
@@ -26,5 +26,5 @@ private:
|
||||
bool _unlocked = false;
|
||||
|
||||
private slots:
|
||||
void handleCallback(QJsonObject obj);
|
||||
void sendCallbackMessage(QJsonObject obj);
|
||||
};
|
||||
|
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <hyperion/Hyperion.h>
|
||||
#include <api/JsonAPI.h>
|
||||
#include <api/JsonCallbacks.h>
|
||||
|
||||
#include <QTcpSocket>
|
||||
#include <QtEndian>
|
||||
@@ -24,9 +25,11 @@ WebSocketClient::WebSocketClient(QtHttpRequest* request, QTcpSocket* sock, bool
|
||||
|
||||
// Json processor
|
||||
_jsonAPI.reset(new JsonAPI(client, _log, localConnection, this));
|
||||
connect(_jsonAPI.get(), &JsonAPI::callbackMessage, this, &WebSocketClient::sendMessage);
|
||||
connect(_jsonAPI.get(), &JsonAPI::callbackReady, this, &WebSocketClient::sendMessage);
|
||||
connect(_jsonAPI.get(), &JsonAPI::forceClose, this,[this]() { this->sendClose(CLOSECODE::NORMAL); });
|
||||
|
||||
connect(_jsonAPI->getCallBack().get(), &JsonCallbacks::callbackReady, this, &WebSocketClient::sendMessage);
|
||||
|
||||
connect(this, &WebSocketClient::handleMessage, _jsonAPI.get(), &JsonAPI::handleMessage);
|
||||
|
||||
Debug(_log, "New connection from %s", QSTRING_CSTR(client));
|
||||
|
Reference in New Issue
Block a user