Skip to content

Commit

Permalink
Merge pull request #1143 from deXol/develop
Browse files Browse the repository at this point in the history
[BLE] Send response to inform_(un)lock, lock_device, fix #1075
  • Loading branch information
limpkin authored Feb 6, 2023
2 parents 6f153e2 + cbb7c1b commit ac80162
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/MPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8606,6 +8606,12 @@ void MPDevice::lockDevice(const MessageHandlerCb &cb)
const auto afterFn = [](const QByteArray &, bool &) -> bool { return true; };
jobs->append(new MPCommandJob(this, MPCmd::LOCK_DEVICE, afterFn));

connect(jobs, &AsyncJobs::finished, [cb](const QByteArray &)
{
qInfo() << "Lock device was successful.";
cb(true, "");
});

connect(jobs, &AsyncJobs::failed, [cb](AsyncJob *failedJob)
{
Q_UNUSED(failedJob);
Expand All @@ -8629,6 +8635,12 @@ void MPDevice::informLocked(const MessageHandlerCb &cb)
exitMemMgmtMode();
}

connect(jobs, &AsyncJobs::finished, [cb](const QByteArray &)
{
qInfo() << "Inform locked was successful.";
cb(true, "");
});

connect(jobs, &AsyncJobs::failed, [cb](AsyncJob *failedJob)
{
Q_UNUSED(failedJob);
Expand All @@ -8647,6 +8659,13 @@ void MPDevice::informUnlocked(const MessageHandlerCb &cb)
const auto afterFn = [](const QByteArray &, bool &) -> bool { return true; };
jobs->append(new MPCommandJob(this, MPCmd::INFORM_UNLOCKED, afterFn));

connect(jobs, &AsyncJobs::finished, [cb](const QByteArray &)
{
qInfo() << "Inform unlock was successful.";
cb(true, "");
});


connect(jobs, &AsyncJobs::failed, [cb](AsyncJob *failedJob)
{
Q_UNUSED(failedJob);
Expand Down

0 comments on commit ac80162

Please sign in to comment.