修改升级文件校验。
This commit is contained in:
parent
f230e4cc8b
commit
bf3ad2be2f
@ -258,9 +258,10 @@ void Application::upgradeDevice(const QString &file) {
|
||||
int position = baseName.indexOf(versionPrefix);
|
||||
if (position < 0 || ((baseName.length() - position) < std::strlen(version))) {
|
||||
emit newMessage(2, "OTA升级", "文件名格式不合法!");
|
||||
LOG(error) << "baseName: " << baseName.toStdString() << ", position: " << position;
|
||||
return;
|
||||
}
|
||||
QString firmware = baseName.mid(position, std::strlen(version));
|
||||
QString firmware = baseName.mid(position);
|
||||
if (device->isConnected()) {
|
||||
device->requestOta(firmware, file);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user