aboutsummaryrefslogtreecommitdiffstats
path: root/src/Xpl2Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xpl2Client.cpp')
-rw-r--r--src/Xpl2Client.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Xpl2Client.cpp b/src/Xpl2Client.cpp
index ba6a1ec..54346e0 100644
--- a/src/Xpl2Client.cpp
+++ b/src/Xpl2Client.cpp
@@ -110,6 +110,12 @@ Xpl2Client::getJcVersion ()
sendCommand (m_commandSocket, "GS_JC_VERSION");
}
+void
+Xpl2Client::getPhVersion (int printheadId)
+{
+ sendCommand (m_commandSocket, "GS_PH_VERSION", { printheadId });
+}
+
/* ------------------------------------------------------------------ */
/* Send / dispatch */
/* ------------------------------------------------------------------ */
@@ -141,6 +147,8 @@ Xpl2Client::dispatchCommandMessage (const Xpl2Protocol::ParsedMessage &msg)
handleKaPing (m_commandSocket);
else if (msg.command == "GS_JC_VERSION")
handleGsJcVersion (msg.params);
+ else if (msg.command == "GS_PH_VERSION")
+ handleGsPhVersion (msg.params);
else
qWarning ("%s Unknown command: %s", qPrintable (logTag (&m_commandSocket)),
msg.command.constData ());
@@ -197,6 +205,40 @@ Xpl2Client::handleGsJcVersion (const QVariantList &params)
emit jcVersionReceived ();
}
+void
+Xpl2Client::handleGsPhVersion (const QVariantList &params)
+{
+ if (params.size () < 8)
+ {
+ qWarning () << "GS_PH_VERSION: expected 8 params, got" << params.size ();
+ return;
+ }
+ int cid = params[0].toInt ();
+ int phId = params[1].toInt ();
+ QString mcuFw = params[2].toString ();
+ QString mcuHw = params[3].toString ();
+ QString mcuFwVar = params[4].toString ();
+ QString fpgaFw = params[5].toString ();
+ QString fpgaHw = params[6].toString ();
+ QString bootVer = params[7].toString ();
+ qDebug ("%s PH[%d] mcuFw=%s mcuHw=%s mcuFwVar=%s fpgaFw=%s fpgaHw=%s "
+ "boot=%s",
+ qPrintable (logTag (&m_commandSocket)), phId, qPrintable (mcuFw),
+ qPrintable (mcuHw), qPrintable (mcuFwVar), qPrintable (fpgaFw),
+ qPrintable (fpgaHw), qPrintable (bootVer));
+ emit statusMessage (
+ QStringLiteral (
+ "RX PH[%1] Version: mcuFw=%2 mcuHw=%3 fpgaFw=%4 fpgaHw=%5 boot=%6")
+ .arg (phId)
+ .arg (mcuFw)
+ .arg (mcuHw)
+ .arg (fpgaFw)
+ .arg (fpgaHw)
+ .arg (bootVer));
+ emit phVersionReceived (cid, phId, mcuFw, mcuHw, mcuFwVar, fpgaFw, fpgaHw,
+ bootVer);
+}
+
/* ------------------------------------------------------------------ */
/* Internal */
/* ------------------------------------------------------------------ */