From 72cdbd8d9887d2ea9d06f83660d8e8f1ff36330d Mon Sep 17 00:00:00 2001 From: luocai Date: Thu, 29 Aug 2024 11:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3ota=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=9C=89=E4=B8=AD=E6=96=87=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DeviceConnection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DeviceConnection.cpp b/DeviceConnection.cpp index a7fc53c..4be6fec 100644 --- a/DeviceConnection.cpp +++ b/DeviceConnection.cpp @@ -1,6 +1,7 @@ #include "DeviceConnection.h" #include "BoostLog.h" #include "StringUtility.h" +#include #include #include #include @@ -362,7 +363,8 @@ void DeviceConnection::requestOta(const QString &firmware, const QString &file) request["deviceid"] = "0"; boost::json::object data; data["target_linux04_firmware"] = firmware.toStdString(); - data["datasize"] = std::filesystem::file_size(file.toStdString()); + QFileInfo fileInfo(file); + data["datasize"] = fileInfo.size(); data["md5"] = oss.str(); request["data"] = std::move(data); auto text = boost::json::serialize(request);