From cd9a45c4f6eb1eae4441e29142ba4fe09eb0093e Mon Sep 17 00:00:00 2001 From: "Tobias J. Endres" Date: Thu, 14 Aug 2025 02:47:38 +0200 Subject: [PATCH] Feat: Add logging for outgoing JSON commands Added a qDebug() statement in hgx11net::_sendCommand() to log the JSON command string just before it is sent to the Hyperion server. This will help in debugging why no results are appearing on the Hyperion end, by confirming if commands are being sent and what their content is. --- hgx11.cpp | 2 +- hgx11net.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hgx11.cpp b/hgx11.cpp index 48a6cae..2bf06d3 100644 --- a/hgx11.cpp +++ b/hgx11.cpp @@ -176,7 +176,7 @@ void hgx11::_activity() void hgx11::_setImgSize() { _hclient_p->imgCmdBuf.clear(); - _hclient_p->imgCmdBuf.append("{"command":"image","priority":").append(_hyperionPriority_m.toUtf8()).append(","imageheight":"); + _hclient_p->imgCmdBuf.append("{\"command\":\"image\",\"priority\":").append(_hyperionPriority_m.toUtf8()).append(",\"imageheight\":"); _hclient_p->imgCmdBuf.append(QString::number(_grabber_p->getDest_height()).toUtf8()); _hclient_p->imgCmdBuf.append(",\"imagewidth\":"); _hclient_p->imgCmdBuf.append(QString::number(_grabber_p->getDest_width()).toUtf8()); diff --git a/hgx11net.cpp b/hgx11net.cpp index ba5aacf..929016a 100644 --- a/hgx11net.cpp +++ b/hgx11net.cpp @@ -25,7 +25,7 @@ hgx11net::~hgx11net() void hgx11net::clearLeds() { _cmd_m.clear(); - _cmd_m.append("{"command": "clearall","priority":").append(_priority_m.toUtf8()).append("}\n"); + _cmd_m.append("{\"command\": \"clearall\",\"priority\":").append(_priority_m.toUtf8()).append("}\n"); _sendCommand(); } @@ -81,6 +81,7 @@ void hgx11net::_sendCommand() if (!_isConnected()) { return; } + qDebug() << "Sending command: " << _cmd_m; _sock_p->write(_cmd_m); while (_sock_p->bytesToWrite()) { _sock_p->waitForBytesWritten(); @@ -166,7 +167,7 @@ void hgx11net::_temperatureAdjustment() return; } _cmd_m.clear(); - _cmd_m.append("{\"command\":\"temperature\",\"priority\": + _cmd_m.append("{\"command\":\"temperature\",\"priority\":"); _cmd_m.append(_temperature_m.toUtf8()); _cmd_m.append("}}\n"); _sendCommand();