From a86af9df1cb51489e12f6ed5707fa509292ef3f8 Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Thu, 22 Feb 2024 17:08:23 +0800 Subject: [PATCH] =?UTF-8?q?mqtt=EF=BC=8C=E5=B0=86companyCode=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner2/mainwindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/scanner2/mainwindow.cpp b/app/scanner2/mainwindow.cpp index c1cd1fa3..3896a066 100644 --- a/app/scanner2/mainwindow.cpp +++ b/app/scanner2/mainwindow.cpp @@ -398,7 +398,9 @@ MainWindow::MainWindow(const QString& appLang, QWidget *parent) HGSaneDeviceCustomInfo custemInfo; #endif m_devUser->GetDeviceCustomInfo(&custemInfo); - mqtt_publish_device_properties(custemInfo.ip, custemInfo.driverVer, custemInfo.type, "HG"); + + std::string companyCode = getCfgValue("mqtt", "companyCode", QString("HG")).toStdString(); + mqtt_publish_device_properties(custemInfo.ip, custemInfo.driverVer, custemInfo.type, companyCode.c_str()); m_wndStatusBar->setDeviceStatusInfo(tr("Device %1 is open").arg(m_devUser->GetName()), false); connect(m_devUser, SIGNAL(newImage(void*)), this, SLOT(on_newImage(void*)), Qt::DirectConnection); @@ -4962,7 +4964,9 @@ void MainWindow::on_act_selectDevice_triggered() HGSaneDeviceCustomInfo custemInfo; #endif m_devUser->GetDeviceCustomInfo(&custemInfo); - mqtt_publish_device_properties(custemInfo.ip, custemInfo.driverVer, custemInfo.type, "HG"); + + std::string companyCode = getCfgValue("mqtt", "companyCode", QString("HG")).toStdString(); + mqtt_publish_device_properties(custemInfo.ip, custemInfo.driverVer, custemInfo.type, companyCode.c_str()); m_devUser->Login(); m_wndStatusBar->setDeviceStatusInfo(tr("Device %1 is open").arg(m_devUser->GetName()), false);