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.
This commit is contained in:
parent
b6239241c9
commit
cd9a45c4f6
@ -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());
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user