Skip to content

Commit e978f35

Browse files
authored
Merge pull request #494 from deXol/develop
[BLE] Handle Erase Data Flash command failure
2 parents a7a4c21 + 472ad5f commit e978f35

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/MPDeviceBleImpl.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,13 @@ void MPDeviceBleImpl::uploadBundle(QString filePath, const MessageHandlerCb &cb,
146146
timer->start();
147147
auto *jobs = new AsyncJobs(QString("Upload bundle file"), this);
148148
jobs->append(new MPCommandJob(mpDev, MPCmd::CMD_DBG_ERASE_DATA_FLASH,
149-
[cbProgress] (const QByteArray &, bool &) -> bool
149+
[cbProgress, this] (const QByteArray &data, bool &) -> bool
150150
{
151+
if (MSG_SUCCESS != bleProt->getFirstPayloadByte(data))
152+
{
153+
qWarning() << "Erase data flash failed";
154+
return false;
155+
}
151156
QVariantMap progress = {
152157
{"total", 0},
153158
{"current", 0},

0 commit comments

Comments
 (0)