解决ota路径不能有中文的问题。

This commit is contained in:
luocai 2024-08-29 11:15:15 +08:00
parent 16c7cd080c
commit 72cdbd8d98

View File

@ -1,6 +1,7 @@
#include "DeviceConnection.h"
#include "BoostLog.h"
#include "StringUtility.h"
#include <QFileInfo>
#include <QPointF>
#include <QTimer>
#include <WinSock2.h>
@ -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);